Hi,
I think there's a bug in the
com.sun.xml.messaging.saaj.soap.XmlDataContentHandler, specifically
the writeTo method. Here are the reproducible steps:
1. Create a SOAPMessage
2. Add an AttachmentPart (registers the SAAJ content handlers)
3. Using the Java Activation CommandMap, request a DataContentHandler
for text/xml. This should give you the XmlDataContentHandler.
4. call writeTo() on said content handler, with the parameter mimeType
set to "text/xml; charset=UTF-8" (or any other character set)
5. Get a java.io.IOException: Invalid content type "text/xml;
charset=UTF-8" for XmlDCH
This seems due to the mime type check done in the content handler,
which checks for equality with "text/xml" or "application/xml".
Elsewhere in the code, a - more robust - startsWith() comparison is
done.
Let me know if you need any more information.
Best regards,
Arjen
---
Arjen Poutsma
Senior Software Engineer, SpringSource
Spring Web Services Lead
E: arjen.poutsma_at_springsource.com
W: www.springsource.com
B: blog.springsource.com/arjen