SAAJ: how to add start parameter in Content-Type
843834Apr 24 2003 — edited Mar 24 2009I am using SUN's RI for SAAJ (by setting com.sun.xml.messaging.saaj.soap.MessageFactoryImpl as the message factory)
When creating SOAP message with attachment, the Content-Type in the root header is generated as :
Content-Type: multipart/related; type="text/xml";
boundary="----=_Part_0_7640919.1051207929498"
Noticing the absence of the start parameter. I can't seem to find a way to set it. I tried to append a start myself:
String[] contentType = msg.getMimeHeaders().getHeader("Content-Type");
msg.getMimeHeaders().setHeader("Content-Type", contentType[0]+";start=\"XYZ\"");
But that gets overwritten when msg.saveChanges() is called.
The start parameter is strongly recommended in W3C's SOAPwAttachment spec. I don't know why SUN's implementation doesn't generate that automatically. Without it the webservice server side (I am using WebLogic 7.0) throws a SOAPException complaining specifically about it.
(
javax.xml.soap.SOAPException: No start attachment specified in the Multipart/Related document
at weblogic.webservice.core.soap.SOAPMessageImpl.handleMimeMessage(SOAPMessageImpl.java:174)
)
Does anyone know how to set this value?
TIA
Chin