users@jax-rpc.java.net

Client with attachments!

From: Oancea Daniel <doancea_at_gmail.com>
Date: Thu, 22 Sep 2005 15:49:42 +0100

Hi all,

I have an problem with an client that has to receive an attachment. From
what I see, using an monitoring tool, the response SOAP Message contain the
attachment that suppose to arrive on client side, but the client is not
capable to dispatch it.

Here is my operation description from the WSDL file:

<wsdl:operation name="getFile">
<soap:operation soapAction="getFile"/>
<wsdl:input>
<soap:body parts="request" use="literal"/>
</wsdl:input>
<wsdl:output>
<mime:multipartRelated>
<mime:part>
<soap:body parts="" use="literal"/>
</mime:part>
<mime:part>
<mime:content part="response" type="application/octet-stream"/>
</mime:part>
</mime:multipartRelated>
</wsdl:output>
</wsdl:operation>

on the client side I made something like that:
.............
DataHandler dh = client.getFile(2);
int resp = data.getInputStream().available();
System.out.println("receive: "+resp+" bytes!");
...............

the error response is:
java.rmi.RemoteException: no attachment with id "response" found in message;
nested exception is:
[java] no attachment with id "response" found in message
[java] at enthrone.StreamFilePortType_Stub.getFile
(StreamFilePortType_Stub.java:79)
[java] at enthrone.Client.main(Client.java:24)
[java] Caused by: no attachment with id "response" found in message
[java] at enthrone.StreamFilePortType_Stub.getAttachment
(StreamFilePortType_Stub.java:194)
[java] at enthrone.StreamFilePortType_Stub.getFile
(StreamFilePortType_Stub.java:72)
[java] ... 1 more

Any suggestions will be overcome!

Thanks