You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by WANG Chi <Ch...@gemalto.com> on 2007/05/29 10:45:26 UTC
nothing happens when add an attachment into SOAP Message
Hi, I want to add an attachment into a SOAP Message, I use the following code but nothing happens, the CampaignManager is a stub generated by wsimport from an WSDL
The WSDL is generated using JAVA2WSDL of Axis 1.4
CampaignManager camMgr = new CampaignManagerService().getCampaignManager();
BindingProvider bp = (BindingProvider)camMgr;
DataHandler dh = new DataHandler(new FileDataSource(new File("C:\\my2.jpg")));
Map<String, DataHandler> dhs = new HashMap<String,DataHandler>();
dhs.put(dh.getName(), dh);
bp.getRequestContext().put(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS,
dhs);
camMgr.uploadTargetFile("111", null);
but the output message does not have an attachment, it's like this
<?xml version="1.0" ?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:uploadTargetFile xmlns="http://soap.ota.gemplus.com" xmlns:ns2="urn:cmm.soap.ota.gemplus.com"><ns2:sessionId>111</ns2:sessionId></ns2:uploadTargetFile></S:Body></S:Envelope>
I wonder what I have done wrong, and I use JAX-WS 2.1.1 . It's a little urgent for me, thanks a lot for any help.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org