[Thilina]: OMElement as in ServiceClient.sendReceive(OMElement
elem) represents the XML payload which goes inside the SOAP body. IMHO SwA
attachments belong to the SOAP message level. They do not belong to the SOAP envelope
or the XML payload, since they do not have defined relationship to the XML
payload. According to what I understand MessageContext is the Axis2 entity
which contains the SOAP message level information. I believe SwA attachments
should be put in to MsgContext. I do not see any justifiable placeholder
for SwA type attachments in XML representation of the payload. This is just how
I feel:). [Hamid]: Thilina, you are right about this. I forgot that the method
ServiceClient.sendReceive(OMElement) puts the element inside the SOAP body. How about the following: ·
add a method getAttachments() to the interface org.apache.axiom.soap.SOAPMessage ·
add an instance variable of type org.apache.axiom.attachments.Attachments
to the classes org.apache.axiom.soap.impl.llom.SOAPMessageImpl and org.apache.axiom.soap.impl.dom.SOAPMessageImpl ·
add appropriate methods to the interface org.apache.axiom.soap.SOAPMessage
for adding attachments (things like addDataHandler(dh), addAttachment(File
file, String contentID), etc....) ·
add some flag, as suggested by Paul, not to the OMText, but
to the SOAPMessage interface to indicate whether the SOAPMessage will be a
MimeMessage when serialized over the wire or it will be in an MTOM
serialization format. If an OMText element is added to the SOAP header or SOAP
body of the SOAPMessage and the OMText object is an MTOM thing, then the flag
of the SOAPMessage interface should automatically change to indicate the
SOAPMessage object will be serialized in MTOM format. ·
Modify the serialization method of the SOAPMessageImpl
classes to take into consideration the mime flag of the SOAPMessage interface and
if the SOAPMessage is an SwA that is non-MTOM, then the serialization should
write the MimeHeaders correctly, together with the attachments. (in Axis-1.x,
the SOAPMessage when serialized over the wire, it writes the MimeHeaders as
well as the attachments). ·
Add methods to the ServiceClient class such as: public
SOAPMessage sendReceive(SOAPMessage), sendReceiveNonBlocking(SOAPMessage,
Callback), etc... (unlike the sendReceive(OMElement) behavior, these new
methods will not put the argument in the SOAP body, but would serialize the
object directly as it is on the wire). ·
On the receiving side, if the input stream is a MimeMessage
stream, the axis servlet should construct a SOAPMessage object and put it as a
property in the MessageContext (instead of putting the Attachment object in the
MessageContext). Or keep the implementation as it is, but add a flag to the
MessageContext to indicate that the received message is a SwA that is not an
MTOM. ·
Modify the transport senders so that they first check the
MessageContext if it has a SOAPMessage object stored as a property. If that’s
the case, then serialize the SOAPMessage object (it will be a MimeMessage serialization).
If the MessageContext does not have a SOAPMessage object stored as a property,
then do the normal serialization of the SOAPEnvelope that is present in the
MessageContext. ·
Write a MessageReceiver that would support delivery of javax.mail.internet.MimeMessage
objects to a service. The MessageReceiver would convert the response javax.mail.internet.MimeMessage
object to a org.apache.axiom.soap.SOAPMessage object and store it in the
MessageContext, or it would just put the SOAPEnvelope in the MessageContext and
construct an Attachment object, and then set a flag in the MessageContext
indicating that the response should be serialized in the MimeMessage format and
not in the MTOM format. |
- RE: [Axis2] SwA Ben Malek, Hamid
- Re: [Axis2] SwA Thilina Gunarathne
- Re: [Axis2] SwA Davanum Srinivas