You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Jinhua Wang (JIRA)" <ji...@apache.org> on 2012/10/17 07:52:04 UTC

[jira] [Reopened] (CXF-4570) Attachment Header Content-ID conversion

     [ https://issues.apache.org/jira/browse/CXF-4570?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jinhua Wang reopened CXF-4570:
------------------------------


Hello
If keep the exact headers, we will get two header named "Content-ID" with different values.
For example, the message contains "Content-ID:<foo>"
headers in jdk Attachment object is
{code}
Content-ID:foo
Content-ID:<foo>
{code}

It is caused by the following code:
method: *org.apache.cxf.binding.soap.saaj.SAAJInInterceptor.handleMessage(SoapMessage)*
{code}
AttachmentPart ap = soapMessage.createAttachmentPart(a.getDataHandler());
ap.setContentId(a.getId());	// 1. jdk invoke setMimeHeader("Content-ID", paramString);
Iterator<String> i = a.getHeaderNames();
while (i != null && i.hasNext()) {
	String h = i.next();
	String val = a.getHeader(h);
	ap.addMimeHeader(h, val);	// 2. jdk invoke headers.addHeader(paramString1, paramString2);
}
soapMessage.addAttachmentPart(ap);
{code}
"*ap.setContentId(a.getId())*" set "Content-ID" header with "foo".
"*ap.addMimeHeader(h, val)*"  add "Content-ID" header with "<foo>"

It is confused to get headers with the same header name but different header values.
I think there is somtehing wrong in *create attachment for cxf* or *copy header to jdk attachment*.

                
> Attachment Header Content-ID conversion
> ---------------------------------------
>
>                 Key: CXF-4570
>                 URL: https://issues.apache.org/jira/browse/CXF-4570
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>            Reporter: Jinhua Wang
>         Attachments: AttachmentUtil.java.patch
>
>
> I have a migrating problem for headers in attachment. 
> For example, the message sent out contains Content-ID:<foo>,
> Content-ID header value is "<foo>" instead of "foo" at server side.
> When creating attachment of the following code:
> org.apache.cxf.attachment.AttachmentUtil.createAttachment(InputStream, InternetHeaders)
> There's a id conversion at first. But in the following header processing, there's no id conversion for Content-ID.
> Since Content-ID conversion is needed for id("new AttachmentImpl(id)"), I think it is also useful for headers.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira