org.apache.axis2.transport.mail
Class MailTransportSender
java.lang.Object
org.apache.axis2.handlers.AbstractHandler
org.apache.axis2.transport.mail.MailTransportSender
- All Implemented Interfaces:
- Handler, TransportSender
public class MailTransportSender
- extends AbstractHandler
- implements TransportSender
0. For this profile we only care about SOAP 1.2
1. There should be no mime text body in this case
2. The SOAP envelope should be base64 encoded and marked with the following headers
SOAP 1.2
Content-Type: application/soap+xml; charset=UTF-8 ; action="soap-action-goes-here"
Content-Transfer-Encoding: base64
Content-Description: "/serviceName"
3. The content-description is the logical name of the service. It should be quoted.
4. The subject can be anything. Perhaps something like "SOAP Message" might be useful to people looking at the mail in a normal mail browser.
5. If there are attachments the there will be a mime multipart. There should only be one part with content-type: application/soap+xml.
6. The service URL will be created as mailto:paul@wso2.com?X-Service-Path=/axis2/services/MyService
or paul@wso2.com?/axis2/services/MyService
Example without attachments
========================
From: rm_client@lenio.dk
To: lenioserver@oiositest.dk
Message-ID: <8868170.01165394158287.JavaMail.hgk@hans-guldager-knudsens-computer.local>
Subject: ANYTHING
MIME-Version: 1.0
Content-Type: application/soap+xml; charset=UTF-8 ; action="http://rep.oio.dk/oiosi/IMessageHandler/RequestRespondRequest"
Content-Transfer-Encoding: base64
Content-Description: /my/service/urlpath
PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz48c29hcGVudjpFbnZlbG9wZSB4
Y3VtZW50YXRpb24uPC9EZXNjcmlwdGlvbj48L05vdGlmaWNhdGlvbj48L3NvYXBlbnY6Qm9keT48
L3NvYXBlbnY6RW52ZWxvcGU+
========================
Example with attachments
========================
From: rm_client@lenio.dk
To: lenioserver@oiositest.dk
Message-ID: <8868170.01165394158287.JavaMail.hgk@hans-guldager-knudsens-computer.local>
Subject: ANYTHING
MIME-Version: 1.0
content-type: multipart/mixed; boundary=--boundary_0_9fdec710-2336-4dc9-8bcd-45f2c06cf605
----boundary_0_9fdec710-2336-4dc9-8bcd-45f2c06cf605
Content-Type: application/soap+xml; charset=UTF-8 ; action="http://rep.oio.dk/oiosi/IMessageHandler/RequestRespondRequest"
Content-Transfer-Encoding: base64
Content-Description: /my/service/urlpath
PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz48c29hcGVudjpFbnZlbG9wZSB4
Y3VtZW50YXRpb24uPC9EZXNjcmlwdGlvbj48L05vdGlmaWNhdGlvbj48L3NvYXBlbnY6Qm9keT48
L3NvYXBlbnY6RW52ZWxvcGU+
----boundary_0_9fdec710-2336-4dc9-8bcd-45f2c06cf605
----boundary_0_9fdec710-2336-4dc9-8bcd-45f2c06cf605
content-type: application/octet-stream
content-transfer-encoding: base64
PHM6RW52ZWxvcGUgeG1sbnM6cz0iaHR0cDovL3d3dy53My5vcmcvMjAwMy8wNS9zb2FwLWVu
dmVsb3BlIiB4bWxuczphPSJodHRwOi8vd3d3LnczLm9yZy8yMDA1LzA4L2FkZHJlc3Npbmci
IHhtbG5zOnU9Imh0dHA6Ly9kb2NzLm9hc2lzLW9wZW4ub3JnL3dzcy8yMDA0LzAxL29hc2lz
LTIwMDQwMS13c3Mtd3NzZWN1cml0eS11dGlsaXR5LTEuMC54c2QiPjxzOkhlYWRlcj48YTpB
Y3Rpb24gczptdXN0VW5kZXJzdGFuZD0iMSI+aHR0cDovL3JlcC5vaW8uZGsvb2lvc2kvSU1l
c3NhZ2VIYW5kbGVyL1JlcXVlc3RSZXNwb25kUmVxdWVzdDwvYTpBY3Rpb24+PGE6TWVzc2Fn
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MailTransportSender
public MailTransportSender()
init
public void init(ConfigurationContext configurationContext,
TransportOutDescription transportOut)
throws AxisFault
- Description copied from interface:
TransportSender
- Initialize
- Specified by:
init
in interface TransportSender
- Throws:
AxisFault
cleanup
public void cleanup(MessageContext msgContext)
throws AxisFault
- Description copied from interface:
TransportSender
- Clean up
- Specified by:
cleanup
in interface TransportSender
- Throws:
AxisFault
sendMimeMessage
public void sendMimeMessage(MessageContext msgContext)
throws AxisFault
- Throws:
AxisFault
writeMimeMessage
public void writeMimeMessage(MessageContext msgContext,
java.io.OutputStream out)
throws AxisFault
- Throws:
AxisFault
stop
public void stop()
- Specified by:
stop
in interface TransportSender
invoke
public Handler.InvocationResponse invoke(MessageContext msgContext)
throws AxisFault
- Description copied from interface:
Handler
- This method will be called on each registered handler when a message
needs to be processed. If the message processing is paused by the
handler, then this method will be called again for the handler that
paused the processing once it is resumed.
This method may be called concurrently from multiple threads.
Handlers that want to determine the type of message that is to be
processed (e.g. response vs request, inbound vs. outbound, etc.) can
retrieve that information from the MessageContext via
MessageContext.getFLOW() and
MessageContext.getAxisOperation().getMessageExchangePattern() APIs.
- Specified by:
invoke
in interface Handler
- Parameters:
msgContext
-
- Returns:
-
- Throws:
AxisFault
Copyright © 2007 Apache Web Services Project. All Rights Reserved.