Hi there.

I've got a client/server app that communicates with XML.

I've used Castor to generate the Java classes from an XSD. 

The client instantiates an object and sets the necessary values on it, in 
accordance with the schema. The client connects to the server, and uses an 
OutputStreamWriter based on the OutputStream from the Socket to marshal the 
XML (with a call like blah.marshal(writer); writer.flush()). I do call 
flush() on the OutoutStreamWriter.

The server gets the connection and gets an InputStreamReader in the same 
manner as above, from the InputStream from the accepted Socket. Then it tries 
to unmarshal the XML from the InputStreamReader (with something like 
blah.unmarshal(reader);).

The problem is this: the server never actually gets the XML - the call to 
unmarshal(InputStreamReader) blocks.

I have tried some things. If I close the socket on the client side, the server 
successfully manages to unmarshal the XML, but then it can't reply to the 
client because it complains that the socket is closed.

Is there anyone else who's had a similar problem? I'd be interested in knowing 
if anyone knows how to get around this.

Thanks in advance.
Daniel

Attachment: pgpSCpJjAbEsF.pgp
Description: PGP signature

Reply via email to