Hello,
I'm struggling to send a soap attachment with AXIS2.
Most of the documentation I'm finding online is on receiving, rather than
sending attachments. Here's the closest I've gathered to what the code
should sort of look like (which is surely wrong):
stub._getServiceClient().getOptions().setProperty(Constants.Configuration.ENABLE_MTOM,
Constants.VALUE_TRUE);
FileDataSource dataSource =
new FileDataSource("c:\\myImageAttachment.jpg");
DataHandler dataHandler = new DataHandler(dataSource);
MessageContext.getCurrentMessageContext().addAttachment(dataHandler);
stub.CreateIncident();
But that code does not work since getCurrentMessageContext returns null.
Outside of attachments, the rest of the functionality works fine.
It looks, to me, like the old version of Axis had an addAttachment method
on the stub API, but I don't see anything comparable in 2.
Any help would be appreciated. Thanks.
Sean
</PRE><p><span style="font-size:9.5pt;line-height:115%;font-family:Arial">This
transmission is intended solely for the person or organization to whom it is
addressed and it may contain privileged and cofidential information. If you
are not the intended recipient you should not copy, distribute or take any
action in reliance on it. If you believe you received this transmission in
error please notify the sender.<br>222 Merchandise Mart Plaza, Suite 250,
Chicago, IL 60654, USA</span></p>