Hi,

> I have the MTOM examples setup and working, uploading and downloading a
> binary file.  All good on that.  Thanks!

Nice..

>
> So, now, Im trying to get the SOAP w/ Attachments examples working.   I
> have the UPLOAD example working,
> but cant get the DOWNLOAD version working.
>
> I have a couple questions:
>
> 1) I noticed you have a method signature like:
>
> public OMElement getFile(OMElement element)
>
> Why are you using OMElement as the argument and return value?
>
> Couldn't you just send a String to request a specific file and return a
> String with the ContentID specified for a reference to the attachment?

Yes... It's possible.. But u need to make sure you return the correct
content-id of the attachment you attached.
                   String graphImageID =
outMessageContext.addAttachment(graphImageDataHandler);


> Or even better use a SwA reference, something like this in the WSDL:

AFAIK Axis2 does not support code generating to SwARef..

>
>
> 2) I noticed you use in your services.xml file:
> <messageReceiver
>   class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
> Is there a reason you chose this class to be your receiver instead of:
> <messageReceiver
>
>   mep=http://www.w3.org/2004/08/wsdl/in-out
>
>   class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
>
> which is what the UPLOAD method uses in the SwA attachment method.

You can use either of them.

>
>
> 3) I was under the impression that the main difference between MTOM and SwA
> methods of attachment is that in the MTOM method, the encoded binary file is
> INSIDE the envelope of the message instead of outside of the envelope, yet,
> when I look at what is being transmitted, it looks like the binary file is
> still being sent as an attachment outside of the envelope no matter which
> method is used. Why is this? Am I not understading the differences
> correctly?

The wire level format is more or less that same for MTOM & SwA.. It's the
referencing mechanism that's different.. That small difference gives a lot
of advantages at the XML level. Also when using MTOM, binary data can go in
the envelope (base64 encoded) or can go as attachments without making any
difference to the XML object models of the sending/receiving sides..

Have a look at http://ws.apache.org/axis2/1_4/mtom-guide.html..
Specifically at the message traces given at the
http://ws.apache.org/axis2/1_3/mtom-guide.html#33

thanks,
Thilina


>
>
> __
> Marc Lefebvre, Principle Software Engineer
> Akimeka, 1305 N. Holopono Street, Kihei, HI 96753
> Phone: (808)442-7168, Email: [EMAIL PROTECTED]
> echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq' | dc
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>



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

Reply via email to