problem with handling the response from sending a SOAP message
I just write a simple java program to test about sending soap message, it works.
at the end of the program, I use :
reply.writeTo(System.out);
System.out.println();
to output the response, but is there anyway to convert the response to string, so that I can use it.
is there any function like
reply.toString().....
Thanks
[371 byte] By [
stchonga] at [2007-10-2 5:50:11]

IT seems like you are using Axis. I'm no expert in Axis but the method you called
looks like it expects an OutputStream, so create one on your own and pass it to the method instead of System.out. Thus you could have the contents of the stream dump into a StringBuffer or alike.
Ricardo B.
Here is some code to do what you are looking for:
public static String returnSOAPMessageAsString(SOAPMessage msg)
{
ByteArrayOutputStream baos = null;
String s = null;
try {
baos = new ByteArrayOutputStream();
msg.writeTo(baos);
s = baos.toString();
} catch(Exception e) {
e.printStackTrace();
}
return s;
}