Hi Hamid,
Trying not to be too verbose in this email, here is the short version for
those who don't like to read long emails:
Short version:

It seems to me that the current implementation in Axis2-1.2 does not have
Mime Multipart/Related message formatter.
Here is the short answer :), We use the SOAPMessageFormatter to do all
the MIME heavy liftings..

Longer version:

Back in the past when Axis2 was still at version 1.0 (axis2-1.0), I had
noticed that SwA was not fully supported and I sent an email to the dev list
explaining the importance of supporting SwA in Axis2.
We have almost full support now..
A year later or so, we
now voted ebMS-3 draft as a Committee Spec at Oasis
(www.oasis-open.org/committees/tc_home.php?wg_abbrev=ebxml-msg
), and I am about to embark on implementing ebMS-3 as an open source, based
on the Axis2 platform.
I always wished they'll use MTOM in the newest version of the spec :(..
First thing I did to verify that Axis2-1.2 fully
supports SwA, was to run the "soapwithattachments" example that comes with
the binaries. At the client side, I was attaching a jpg image, and the
webservice class was simply saving the attachment to a file. This worked
great. The second step was to look at the message itself (the format of the
message while traveling the network). So I needed a way to log the request
message to a file so that I look at it.
You may have used a tcp sniffer like tcpmon
(ws.apache.org/commons/tcpmon). But make sure not to send too large
attachments through sniffers as they tend to break with large
attachments.
and I discovered that the
code uses a MessageFormatter concept (which is by the way a brilliant
architecture design).
Thanks :)...

The whole message is attached to this email. As you can see, the SOAP
Envelope was serialized twice and in the second time the
content-transfer-encoding is set to binary (the SOAP Envelope should be
serialized only once not twice). The second issue is that there is no mime
headers at the beginning of the message, before the first mime part. The
beginning of the message should start like this (before the first mime
part):
Please use the tcpmon to see the real wire level messaege...

To summarize, here is what it should be done (assuming that I am not
mistaken):

·         Write a new class
(MimeMultipartRelatedMsgFormatter) that implements
org.apache.axis2.transport.MessageFormatter interface

·         Declare this class in axis2.xml among the existing message
formatters.

·         Modify AxisConfiguration class to return this class when passed
the string HTTPConstants.MEDIA_TYPE_MULTIPART_RELATED in
its getMessageFormatter method.
We currrently use the SOAPMessageFormatter it self and it works...
Currenty no plans..But if needed we'll be able to abstract out a
formatter, just like the MIMEBuilder...

You may look at the following article & tutorial for more details on
Axis2 SwA support.
1. Using SOAP with Attachments in Apache Axis2 : http://wso2.org/library/1148

2. Downloading a Binary File from a Web Service using Axis2 and SOAP
with Attachments : http://wso2.org/library/1675

Thanks,
Thilina




Thank you.



Hamid.



P.S: I think Axis2 has lots of potential as I very much like its
architecture. The developers did a great job. I just want to thank you all
for this great work.
Thanks again :)...
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Thilina Gunarathne  -  http://www.wso2.com - http://thilinag.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to