Reset response StringBuffer before  writing error message.
Reset response StringBuffer before  writing error message.

Actually, to put  the responsability to pass an empty string buffer on the caller of the
XmlWriter constructor is pretty stupid (and has caused a lot of bugs), because the
string buffer is internal to the XmlWriter anyway. The original idea was to reduce
object instantiation, but I'm not sure it was worth the trouble...

From Chad Ward (cward@arcsight.com):

If an exception occurs during the writing of the response, it is possible that there
is some could be some residual data in the buffer.  In the exception
block a new XmlWriter is created, but the buffer is not cleared.
Because the exception is not printed on the server and the stream is
not parsable by the console, the exception will be lost.


atoulme/xmlrpc