cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Son Tung Nguyen <>
Subject CXF+MTOM attach multiple files
Date Fri, 23 Dec 2011 10:34:34 GMT
I'm trying to create a Webservice with MTOM enabled, that accept 2 binary
files, here's my 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">
                      <entry key="mtom-enabled" value="true"/>

My Client class :


    String address = "http://localhost:8080/MyProject/WS/MyService";
    JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
     Map<String,Object> props = new HashMap<String, Object>();
     props.put("mtom-enabled", "true");

    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" 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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message