users@glassfish.java.net

Content-Id and Content-ID duplicate present in SAAJ/JAX WS/MTOM web service

From: <forums_at_java.net>
Date: Tue, 10 May 2011 15:32:30 -0500 (CDT)

Hi
I ran into issue where the SOAP with Attachments using JAX WS and MTOM web
service has 2 content id's in AttachmentPart.
*--uuid:5727eaf2-5adc-4beb-96b8-ca92ea63a0e4*
*Content-Id:<c4a23896-86b9-45c5-8848-69608aa5c10f_at_example.jaxws.sun.com>*
*Content-Type: application/octet-stream*
*Content-ID: <c4a23896-86b9-45c5-8848-69608aa5c10f_at_example.jaxws.sun.com>*
*Content-Transfer-Encoding: binary*
The AttachmentPart uses only Content-ID in JDK 1.6 but uses setMimeHeader to
set as Content-ID is part of MimeHeader.
*public void setContentId(String contentId)*
*{*
*setMimeHeader("Content-ID", contentId);*
*}*
The real problem is when the mimeheader contains 2 headers when this method
is being called.

Now using the handler if i try to remove the "Content-Id", It makes the
MimeHeader "Content-ID" to null.
*t.removeMimeHeader("Content-Id");*
Output:
*Content-ID: null*
Is there a way around the implementation?
On side note I can see SOAPPart having the Content-Id. I am not sure if the
JAX-WS RI uses any of the SOAPPart to implement the AttachmentPart which
would be wierd
*public String getContentId() {*
*String[] values = getMimeHeader("Content-Id");*
*if (values != null && values.length > 0)*
*return values[0];*
*return null;*
*}*
*public void setContentId(String contentId)*
*{*
*setMimeHeader("Content-Id", contentId);*
*}*
Thanks


--
[Message sent by forum member 'winkid82']
View Post: http://forums.java.net/node/800901