You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@ws.apache.org by St...@aon.com on 2002/02/11 20:46:39 UTC
Bug report/fix
Hi-
I'm reporting a bug in Apache SOAP 2.2. In SOAPContext.java on line 328
(function addBodyPart) the DataHandler that was passed in as part of the
MimeBodyPart is queried for its Content-Type using DataHandler.getContentType().
The comment says "Assume that a passed MimeBodyPart already has these set to
appropriate values". However, even if the Content-Type is set in the
MimeBodyPart, the Data Handler is still queried. DataHandlers created directly
from a DataSource don't have their Content-Type set (at least, not necessarily,
because I am making a DH from a DS based on an InputStream and getContentType
returns null.)
The fix is to check for the MIME type in the MimeBodyPart, and then only query
the DH if it is not set there, or not at all. Work-around is to make a new
subclass of DataHandler that allows explicit setting of the ContentType and
returns that value if it is set, or else super.getContentType() if not.
I'm not subscribed (Lotus Notes client at work with no agents == filtering) so
please cc me if necessary.
HTH,
S-