« Return to Thread: HttpUrl Input/Output stream problems

HttpUrl Input/Output stream problems

by Alistair Young :: Rate this Message:

Reply to Author | View in Thread

Hi there,

I have an interesting problem and was wondering if anyone's seen it  
before? I'm saving a document to an HttpUrl output stream and then  
reading the result from the server and parsing a new document:

XmlOptions xmlOptions = new XmlOptions();
xmlOptions.setSavePrettyPrint();
xmlOptions.setSavePrettyPrintIndent(2);
xmlOptions.setUseDefaultNamespace();
...
OutputStream out = httpURL.getOutputStream();
efDoc.save(out, xmlOptions);
out.flush();
...
InputStream in = httpURL.getInputStream();
EframeworkDocument efResponseDoc = EframeworkDocument.Factory.parse(in);

it works fine the first 2 times. The 3rd time the server always  
throws this exception:

org.apache.xmlbeans.XmlException: error: Unexpected end of file after  
null

when it does:

SomeDocument doc = SomeDocument.Factory.parse(request.getInputStream());

thanks,

Alistair


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...

 « Return to Thread: HttpUrl Input/Output stream problems