Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SAAJ: how to add start parameter in Content-Type

843834Apr 24 2003 — edited Mar 24 2009
I 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 21 2009
Added on Apr 24 2003
4 comments
486 views