I'm trying to create a Webservice with MTOM enabled, that accept 2 binary
files, here's my webmethod :
...
@WebMethod()
public String SendFile(
@WebParam(name = "userId", targetNamespace = "my_name_space") String userId,
@WebParam(name = "rawScan", targetNamespace = "my_name_space") byte[] file1,
@WebParam(name = "improvedScan", targetNamespace = "my_name_space")
byte[] file2)
throws SoapFaultException;
...
I also activate in / out logging for envelops checking ...
And my config for WS (with spring) is :
...
<jaxws:endpoint id="sendFileServiceEndpoint"
implementor="#sendFileService" address="/MyService">
<jaxws:properties>
<entry key="mtom-enabled" value="true"/>
</jaxws:properties>
</jaxws:endpoint>
...
My Client class :
....
String address = "http://localhost:8080/MyProject/WS/MyService";
JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
proxyFactory.setServiceClass(IMyWS.class);
proxyFactory.setAddress(address);
Map<String,Object> props = new HashMap<String, Object>();
props.put("mtom-enabled", "true");
proxyFactory.setProperties(props);
IMyWS service = (IMyWS) proxyFactory.create();
//load files's binary
byte[] bFile1 = ...;
byte[] bFile2 = ...;
service.SendFile("myUser", bFile1, bFile2);
When i execute Client class, I have a SoapFault returned by the server. And
when i check for the stacktrace on the server side, i get : "Exception in
thread "main" javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error:
null ... "
And in the outbound message in client side i do not see all attachments,
only the first (for bFile1). And i guess that the cause of "Unmarshalling
Error: null " in the server side ...
Did i miss something in my client (or server) configuration ?
--
~~~~~~~~~~~~~~~~~~~
Sontung NGUYEN