Do you know if </soap:Envelope> is ever emitted on the client?

For debugging purposes, read the stream entirely into a byte array and then print the contents out as a string. The parser may either not be getting the final tag (I doubt this, the flush() on client side should send it), OR it may be default have validation turned on, and is waiting for the real "end" of the document so that it can do some sort of validation or display errors. Maybe there is a way to turn this off.

Otherwise your only solution will be to consume the message yourself somehow (maybe by sending a leading number of bytes written to stream, or just by checking until end tag is reached) then just provide a streamsource from bytearrayinputstream.

Using BufferedReader.readLine will almost never work and is a frequent error in network programming as the readLine method will block until an EOL series is reached, which may well never come.

Aaron

Srilekha Mudumbai wrote:
Group,

This is what I am trying to do and I am unable to read the last line of the SOAP
message.


---- on the client side ----
SOAPMessage msg; //created and loaded with contents
msg.writeTo(socket.getOutputStream());
socket.getOutputStream().flush();

----- on the server side -----
SOAPPart sp // obtained from the soap message
sp.setContent(new StreamSource(socket.getInputStream()); // this approach hangs invariably


Hence tried using BufferedReader for the socket input stream

while  (buffreader.readLine() != null) {
   // print line
}

this waits indefinitely for the </soap:Envelope> ( the last line of the soap message)
When I kill the client, the server gets it. I do not want to close the client socket.
I would like to keep it open.


Any suggestions?

Regards
Srilekha




Reply via email to