axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Veithen (JIRA)" <j...@apache.org>
Subject [jira] Updated: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment
Date Wed, 09 Jun 2010 17:06:14 GMT

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

Andreas Veithen updated AXIS2-4733:
-----------------------------------

    Attachment: LazyDataHandler.java

Some time ago I tried to implement a DataHandler wrapper for the Axiom project and I had the
same issue, i.e. that some JAF implementations don't allow a null DataSource as argument to
DataHandler. I abandoned the solution in favor of a different one (for other reasons), but
I still have the code. What I did was to build a dummy DataSource and pass that to the DataHandler
constructor. See the attached LazyDataHandler.java file.

> Incorrect content-type used in serialized SOAP message for an XML document attachment
> -------------------------------------------------------------------------------------
>
>                 Key: AXIS2-4733
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4733
>             Project: Axis2
>          Issue Type: Bug
>          Components: jaxws
>    Affects Versions: nightly
>            Reporter: Phil Adams
>            Assignee: Rich Scheuerle
>         Attachments: LazyDataHandler.java, patch.txt
>
>
> When using the SAAJ API, a user could add an AttachmentPart to the SOAPMessage and explicitly
set the content type of the attachment by calling AttachmentPart.setContentType().   This
causes the AttachmentPart to maintain the user-specified content type separate from the content
type of the underlying DataHandler.    Within the jaxws module, the DataHandler instance is
saved away and then used to serialize the SOAP message, but we don't maintain the user-specified
content type.  Consequently, the DataHandler's content type is then used unconditionally when
serializing the MIME part in the output message.     Recently, the DataHandler class (or more
likely one of its underlying DataSource implementations) has started using a default content
type of "application/xml" for an XML document attachment.   This has caused a failure in a
Java EE CTS testcase, as the testcase explicitly sets the content type of the AttachmentPart
to "text/xml" and expects that to be used in the outgoing request message.   I'm including
a patch which fixes this problem by introducing a new "WrappedDataHandler" class which maintains
the content type from the AttachmentPart as well as the DataHandler instance.   This allows
for the correct content type to be used when serializing the message...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


Mime
View raw message