Java Mailing List Archive

http://www.java2.5341.com/

Home » axis-user.ws »

Server side attachments and client side null values

DanielBaciarelli

2008-10-01


Author LoginPost Reply

Hi, I have a web service that accept request from a client, receiving a complex java object e returning another complex java object. The web service, also attach a huge xml file to the response message.
The problem is that if I don't attach any file, the client receive the correct java object, if I attach the file, the client receive the file correctly but the result of call.invoke is null.

This is the way I attach the file server side:

        MessageContext msgContext= MessageContext.getCurrentContext();
        Message response = msgContext.getResponseMessage();

        DataHandler buildFile =        new DataHandler(new FileDataSource(toSend));
        AttachmentPart aPart = new AttachmentPart(buildFile);
        response.addAttachmentPart(aPart);
                                       
        response.saveChanges();

Can anyone help me?
©2008 java2.5341.com - Jax Systems, LLC, U.S.A.