In my case I am returning two strings. I think it should be the same with you as well. My wsdl seems something like
 
.....
.....
  <message name="methodResponse">
    <part name="returnCode" type="xsd:string"/>
    <part name="returnMessage" type="xsd:string"/>
  </message>
......
......
 
I used WSDL2Java to produce java code, and the method generated will look something like
 
public void method(String arg1, String arg2, javax.xml.rpc.holders.StringHolder string1, javax.xml.rpc.holders.StringHolder string2) {
    javax.xml.rpc.holders.StringHolder  string1.value = new String();
    javax.xml.rpc.holders.StringHolder  string2.value = new String();   
 
..
}
 
I will simply give my value for string1 and string2 in the last 2 lines and SOAP will send 2 strings as return.
 
You will also notice in your deploy.wsdd file, something like
 
        <parameter name="string1" type="tns:string" xmlns:tns="http://www.w3.org/2001/XMLSchema" mode="OUT"/>
        <parameter name="string2" type="tns:string" xmlns:tns="http://www.w3.org/2001/XMLSchema" mode="OUT"/>
 
Observer the mode="OUT".
It should work the same way to you as well. Instead of 2 strings configure your xml and attachment.
Look at the javax.xml.rpc.holders package. Hope this helps
 
regards,
kiran pathuru
 
-----Original Message-----
From: Steve Pruitt [mailto:[EMAIL PROTECTED]
Sent: Monday, February 09, 2004 5:00 PM
To: [EMAIL PROTECTED]
Subject: JAX-RPC with attachments question

I have a service that needs to return xml and an attachment, the xml contains some meta-information about the attachment.  I am using the jax-rpc api.  My question is how to return both an xml document and an attachment.  I can see how to return one or the other, but not both.
 
Can someone point me to a good example, I can't find one.
 
Thanks,
 
-Steve Pruitt

Reply via email to