1 Reply Latest reply on Jan 21, 2008 11:53 AM by asdf jhflj

    Large File transfer from WS Client

    Brian Blasko Newbie

      I have a simple WS that uses MTOM/XOP. I'm using JBossAS 4.0.5 and JBossWS 2.0.1 GA.

      I have the following annotations on the service class

      @WebService(name="E2PIService", serviceName="E2PIService")
      @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)

      and this is the simple WebMethod signature

      @WebMethod(operationName="transferFile", action="transferFile")
       public long transferFile(@XmlMimeType("application/octet-stream")javax.activation.DataHandler data)

      When I invoke this service using a client, it works OK with small files but I get OutOfMemory exceptions on large files.
      I do call setMTOMEnabled(true) on the client side and verified the data is being encoded correctly.
      SOAPBinding binding = (SOAPBinding)((BindingProvider)service).getBinding();
      FileDataSource fds = new FileDataSource(new File("/bigData.dat"));
      long d = service.transferFile(new DataHandler(fds));

      It appears that the client is not streaming the data. If I do the reverse where I send a file from the server to client, it does appear to correctly stream the data.

      How can I enable the client to perform streaming of DataHandler type parameters?