Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 74324 invoked from network); 7 Nov 2006 08:57:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Nov 2006 08:57:19 -0000 Received: (qmail 65047 invoked by uid 500); 7 Nov 2006 08:57:30 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 64954 invoked by uid 500); 7 Nov 2006 08:57:29 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 64943 invoked by uid 500); 7 Nov 2006 08:57:29 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 64940 invoked by uid 99); 7 Nov 2006 08:57:29 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2006 00:57:29 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2006 00:57:17 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 0F3AF1A9846; Tue, 7 Nov 2006 00:56:51 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r472038 - /webservices/axis2/branches/java/1_1/xdocs/1_1/transport_howto.html Date: Tue, 07 Nov 2006 08:56:50 -0000 To: axis2-cvs@ws.apache.org From: chatra@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061107085651.0F3AF1A9846@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: chatra Date: Tue Nov 7 00:56:50 2006 New Revision: 472038 URL: http://svn.apache.org/viewvc?view=rev&rev=472038 Log: committing minor editorial changes in Jira AXIS2-1628 Modified: webservices/axis2/branches/java/1_1/xdocs/1_1/transport_howto.html Modified: webservices/axis2/branches/java/1_1/xdocs/1_1/transport_howto.html URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/xdocs/1_1/transport_howto.html?view=diff&rev=472038&r1=472037&r2=472038 ============================================================================== --- webservices/axis2/branches/java/1_1/xdocs/1_1/transport_howto.html (original) +++ webservices/axis2/branches/java/1_1/xdocs/1_1/transport_howto.html Tue Nov 7 00:56:50 2006 @@ -1,10 +1,13 @@ + + +

How To Write Your Own Axis2 Transport

Prologue

@@ -22,7 +25,7 @@ transport.
  • TCP - This is the most simple transport, but needs Addressing support to be functional.
  • -
  • SMTP - This can work off a single email account or a mailserver. +
  • SMTP - This can work off a single email account or a mail server. The Mail Transport Receiver is a thread that checks for emails in fixed time intervals.
  • @@ -81,6 +84,7 @@ log.info(e.getMessage()); } +

    Now we need some kind of a Listener to listen to the requests that come in. This you will need to implement according to the transport that you are trying to build. After a message is received at the Receiver you can use the @@ -89,6 +93,7 @@ snippet is extracted from MailListener as an example}

    AxisEngine engine = new AxisEngine(configurationContext);
     MessageContext msgContext = null;
    +
     // create and initialize a message context
     try {
             TransportInDescription transportIn =
    @@ -97,6 +102,7 @@
                     reg.getAxisConfiguration().getTransportOut(new QName(Constants.TRANSPORT_NAME));
             if (transportIn != null && transportOut != null) {
                     //create Message Context
    +                
                     msgContext = new MessageContext(configurationContext, transportIn, transportOut);
                     msgContext.setServerSide(true);
                     msgContext.setProperty(MailSrvConstants.CONTENT_TYPE, message.getContentType());
    @@ -158,11 +164,10 @@
       

    Using a code fragment like -Utils.getParameterValue(transportOut.getParameter(MailSrvConstants.SMTP_USER)) +Utils.getParameterValue(transportOut.getParameter(MailSrvConstants.SMTP_USER)) we can extract the parameters that we insert into the axis2.xml file.

    -

    As you can see getting a new transport receiver up and running is a task -that requires very little effort.

    +

    As you can see getting a new transport receiver up and running is a task that requires very little effort.

    Transport Sender

    @@ -191,21 +196,24 @@ throw new AxisFault( "Both the TO and Property MessageContext.TRANSPORT_WRITER is Null, No way to send response."); } -} +} + -

    Therefor, depending on if your transport is using the same channel to send -the responce or using a different channel, you will need to implement a +

    Therefore, depending on if your transport is using the same channel to send +the response or using a different channel, you will need to implement a sub-set of the methods from the abstract class.

    After implementing the necessary methods you can let Axis2 know about your new transport sender by adding an entry to the axis2.xml file like you did for the Transport Receiver.

    -
       <transportSender name="TRANSPORT_NAME" class="org.apache.Axis2.transport.TRANSPORT_NAME.TRANSPORT_SENDER_CLASS">
    +
    +
      <transportSender name="TRANSPORT_NAME" class="org.apache.Axis2.transport.TRANSPORT_NAME.TRANSPORT_SENDER_CLASS">
             <parameter name="PROPERTY_NAME" locked="false">PROPERTY_VALUE</parameter>
             <parameter name="PROPERTY_NAME_2" locked="false">PROPERTY_VALUE_2</parameter>
       </transportSender>
       
    +

    Have a look at org.apache.Axis2.transport.mail.MailTransportSender for a very simple Transport Sender. Also have a look at org.apache.Axis2.transport.http.CommonsHTTPTransportSender which is used to @@ -214,5 +222,7 @@

    Once we have written our transport receiver and our transport sender, and inserted the needed entries into the axis2.xml file, we are done. It is as simple as that!

    + + --------------------------------------------------------------------- To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org For additional commands, e-mail: axis-cvs-help@ws.apache.org