-
Bug
-
Resolution: Done
-
Major
-
jboss-ws4ee-4.0.2
-
None
The JAFConfigService installs mappings for text/xml and application/xml to use the class org.jboss.webservice.jaf.XMLDataContentHandler.
The writeTo() method of this class expects the object that is to be written to an OutputStream to be of type javax.xml.transform.Source and doesn't guard against other Object types or provide support for them.
For example, if application code like the following is used
Datahandler dh = new DataHandler( "<? xml version=....etc.", "text/xml" );
InputStream istream = dh.getInputStream();
the first time the InputStream is read, an EOF indication will be returned.
I would suggest that the code block starting at XMLDataContentHandler.writeTo() on line 133
if (obj instanceof StreamSource)
should have an addition else block after
else if (obj instanceof SAXSource)
something along the lines of
else
{
String charset = getCharSetFromMimeType( mimeType );
os.write( obj.toString().getBytes( charset );
}
- is incorporated by
-
JBAS-2242 Webservice bug fixes for 4.0.3
- Closed