XML Client Server using Transformer
Hi all,
I am trying to write a Client Server application that performs message exchange using XML.
I have written a small test program that uses javax.xml.transform.Transformer.transform method to send and receive DOM Documents over Socket.
The problem is I don't know how to terminate the XML sending properly. So after I call the `transform` method on the client, it seems like the server never stopped reading.
My question is, is there a standardised way of sending some sort of end of file character so that the server knows to stop receiving? I've tried sending -1, but it just chcks out lots of Exception.
Also, what is the best InputStream, OutputStream combination to use with Transformer.transform method? DataInput/OutputStream, BuffereReader/Writer?
Finally, what is the best way to send XML over Socket?
BTW I want to use just one Socket. I know closing the Socket will send a end of stream to the server, but then I'll have to create and close Socket everytime I want to send something, and that's no good for me.
Thanks.

