No.1 | | 2321 bytes |
| 
I don't think there is an issue if Tony wants to access the MTM attachments
using pure MElements
Hope following samples would help you
*public* MElement mtomSample(MElement element) *throws* Exception {
MElement imageEle = element.getFirstElement();
MElement imageName = (MElement) imageEle.getNMSibling();
MText binaryNode = (MText) imageEle.getFMChild();
String fileName = imageName.getText();
*//Extracting the data and saving
* DataHandler actualDH;
actualDH = (DataHandler)binaryNode.getDataHandler();
//If you need to create completely new envelope then create a new MElement
with a MText as a child and attach the DataHandler to it.
return element; //this will preserve the attachment even in the
response
}
Even in the case of SwA we can use the message context injection to retrieve
the attachments at the service. But if the user needs to send them back,
then he has to explicitly create a new M tree and attach the attachments.
* Axis2 supports sending MTM only * // PLS refer to MTM guide for more
details on this.
Thanks,
~Thilina
1/18/06, Tony Dean <Tony.Dean (AT) sas (DOT) comwrote:
That's right. Access them for input and inject them into the output using
available API.
Message
From: Davanum Srinivas [mailto:davanum (AT) gmail (DOT) com]
Sent: Tuesday, January 17, 2006 2:06 PM
To: axis-dev (AT) ws (DOT) apache.org
Subject: Re: [AXIS2] attachments
:( :(
Please add your requirements to that issue or add another one.
Basically you need to access the attachments directly via an API from your
service right?
-- dims
1/17/06, Tony Dean <Tony.Dean (AT) sas (DOT) comwrote:
Hi,
I plan on using ""
message receiver so that I can perform my own databinding with input/output
messages using generic SAPElement. How can I process attachments included
on the request message as well as add attachments to the response if all
that I have as input/output messages are SAPElements?
Thanks for your help.
Tony Dean
SAS Institute Inc.
919.531.6704
tony.dean (AT) sas (DOT) com
SAS The Power to Know
http://www.sas.com
>
>
>
>