Design of Mail Transport for Apache Axis2/C
Currently Apache Axis2/C uses HTTP(S) as the general transport. The aim of this project is to give users the ability to use EMAIL as a fully fledge transport to exchanges SOAP messages. When developing the Mail Transport(aka Mail Transport) we need to consider two protocols, SMTP and POP. SMTP is the sending part(aka Mail Transport Sender) and POP as the receiving part(aka Mail Transport Receiver). EMAIL is inherently ONE-WAY asynchronous.
The initial implementation of the Mail Transport concern with Asynchronous + WS-Addressing+Non-Blocking architecture, Axis2/Java has a synchronous behavior without addressing and it will be done if the time permit to finish first asynchronous part.
As mentioned this project mainly concern with writing Mail Transport Sender(for SMTP) and Mail Transport Receiver(for POP) in independent way ,thus server and the client could use them orthogonally.
In the client side message goes through and at the end it comes to the transport sender , where Axis2 pick the transport and send the SOAP message. In the client side Client API is used to send the SOAP message to the target endpoint as follows.
// create required env etc.. options = axis2_options_create(env); address = " mailto:firstname.lastname@example.org?X-Service-Path=\"/my/service/urlpath\"";
Please note that the address is "mailto:" indicating client is using the Mail Transport .
endpoint_ref = axis2_endpoint_ref_create(env, address); axis2_options_set_to (options, env, endpoint_ref);
Following normal client API we create the svc client and send the SOAP message to the mail server and listen to the response. So at this point Axis2/C engine should be able to pick the Mail Transport Sender (Configured in the configuration file <transportSender name="mailto"
</transportSender name> ).
and send the SOAP message using Mail Transport Sender. This message will be sent as a base64 encoded MIME attachment as in . The Mail Transport Sender is a part Mail Transport is responsible for encoding the SOAP envelope using base64 encoding mechanism and send it to the Mail server. At the same time Mail Transport Receiver in the client side will periodically download the EMAILS from the mail server. Mail Transport Receiver in client side is responsible for downloading Emails from the Inbox and generate a SOAP envelope for further processing at client side.
The server part is also consists of a Mail Transport Sender and a Mail Transport Receiver. At the server side the Mail Transport Receiver listen to the incoming connection (once you configured Axis2/C to use Mail Transport) and periodically will download the Emails from the mail server. After that the SOAP envelope will be generated and will be submitted to normal processing through phases and handlers. Once the result is available Mail Transport Sender is there to encode the SOAP envelope in base64 and send that to the mail server.
Please look at the path of the SOAP message.
At the end of the project there will be a Mail Transport Sender and a Mail Transport Receiver client and server side. The end result will be a shared resource (possibly libaxis2_mail_sender.so,libaxis2_mail_receiver.so on Unix like systems and axis2_mail_sender.dll and axis2_mail_receiver.dll on MS windows) which implement the Mail Transport.
The C Mail API plays a major role in the Mail Transport behind the seen doing the all hard work. The C Mail API which is going to use is the c-client API  of the UW IMAP tool kit. It is used in application scuh as Pine and EasyMail and MailManager for the Next.