You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rampart-dev@ws.apache.org by "Phil Adams (JIRA)" <ji...@apache.org> on 2010/06/08 00:17:13 UTC

[jira] Created: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

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


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


[jira] Resolved: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle resolved AXIS2-4733.
-----------------------------------

    Resolution: Fixed

> 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, patch2.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


[jira] Updated: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Adams updated AXIS2-4733:
------------------------------

    Attachment: patch2.txt

Here's an updated patch for this issue.   I changed the WrappedDataHandler ctor according to Andreas' suggestion.

> 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, patch2.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


[jira] Commented: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12876516#action_12876516 ] 

Rich Scheuerle commented on AXIS2-4733:
---------------------------------------

Hi Phil,

I inspected the patch,  and I understand the need for a WrappedDataHandler.

However, you also need to change the Axis2 SAAJ implementation (org.apache.axis2.saaj.AttachmentPartImpl) to override the setContentType method and use the WrappedDataHandler.

This means that the WrappedDataHandler (and tests) will need to be moved to a different package and module that is accessible from the Axis2 SAAJ module.

I suggest that it should be moved to the kemel module and the org.apache.axis2.util package since this is a common utility.
We also need an Axis2 SAAJ test to make sure Axis2 SAAJ AttachmentPart behaves correctly.

Comments ?

Rich Scheuerle

> 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: 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


[jira] Resolved: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle resolved AXIS2-4733.
-----------------------------------

    Resolution: Fixed

Thanks Phil for the contribution.

Committed revision 952971.

> 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: 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


[jira] Resolved: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle resolved AXIS2-4733.
-----------------------------------

    Resolution: Fixed

> 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, patch2.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


[jira] Resolved: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle resolved AXIS2-4733.
-----------------------------------

    Resolution: Fixed

Thanks Phil for the contribution.

Committed revision 952971.

> 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: 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


[jira] Updated: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Adams updated AXIS2-4733:
------------------------------

    Attachment: patch2.txt

Here's an updated patch for this issue.   I changed the WrappedDataHandler ctor according to Andreas' suggestion.

> 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, patch2.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


[jira] Updated: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Adams updated AXIS2-4733:
------------------------------

    Attachment: patch.txt

Attaching patch.txt which contains the "svn diff" of my changes...

> 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
>         Attachments: 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


[jira] Commented: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12876696#action_12876696 ] 

Rich Scheuerle commented on AXIS2-4733:
---------------------------------------

Phil and I discussed the change.

I am going to commit the patch, but also move the WrapperDataHandler to the org.apache.axis2.util package.

> 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: 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


[jira] Assigned: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle reassigned AXIS2-4733:
-------------------------------------

    Assignee: Rich Scheuerle

> 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: 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


[jira] Commented: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12877163#action_12877163 ] 

Phil Adams commented on AXIS2-4733:
-----------------------------------

Andreas, thanks for posting LazyDataHandler.java.   That's pretty much what I was going to do to fix my issue :)

> 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


[jira] Resolved: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle resolved AXIS2-4733.
-----------------------------------

    Resolution: Fixed

> 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, patch2.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


[jira] Commented: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12876516#action_12876516 ] 

Rich Scheuerle commented on AXIS2-4733:
---------------------------------------

Hi Phil,

I inspected the patch,  and I understand the need for a WrappedDataHandler.

However, you also need to change the Axis2 SAAJ implementation (org.apache.axis2.saaj.AttachmentPartImpl) to override the setContentType method and use the WrappedDataHandler.

This means that the WrappedDataHandler (and tests) will need to be moved to a different package and module that is accessible from the Axis2 SAAJ module.

I suggest that it should be moved to the kemel module and the org.apache.axis2.util package since this is a common utility.
We also need an Axis2 SAAJ test to make sure Axis2 SAAJ AttachmentPart behaves correctly.

Comments ?

Rich Scheuerle

> 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: 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


[jira] Assigned: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle reassigned AXIS2-4733:
-------------------------------------

    Assignee: Rich Scheuerle

> 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: 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


[jira] Updated: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Adams updated AXIS2-4733:
------------------------------

    Attachment: patch2.txt

Here's an updated patch for this issue.   I changed the WrappedDataHandler ctor according to Andreas' suggestion.

> 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, patch2.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


[jira] Commented: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12877163#action_12877163 ] 

Phil Adams commented on AXIS2-4733:
-----------------------------------

Andreas, thanks for posting LazyDataHandler.java.   That's pretty much what I was going to do to fix my issue :)

> 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


[jira] Commented: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12876696#action_12876696 ] 

Rich Scheuerle commented on AXIS2-4733:
---------------------------------------

Phil and I discussed the change.

I am going to commit the patch, but also move the WrapperDataHandler to the org.apache.axis2.util package.

> 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: 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


[jira] Commented: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12876696#action_12876696 ] 

Rich Scheuerle commented on AXIS2-4733:
---------------------------------------

Phil and I discussed the change.

I am going to commit the patch, but also move the WrapperDataHandler to the org.apache.axis2.util package.

> 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: 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


[jira] Commented: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12876547#action_12876547 ] 

Phil Adams commented on AXIS2-4733:
-----------------------------------

Rich,
I don't quite understand the need for the extra changes you mentioned.   The AttachmentPartImpl already supports getContentType()/setContentType() (inherited from javax.xml.soap.AttachmentPart), so it already maintains the content type separate from the DataHandler instance (the DataHandler has a getContentType() method but this returns only the implicit content type of the DataHandler's data source; the user has no way to set the content type directly on the DataHandler but AttachmentPart does provide that).

The reason that I made the changes only in the jaxws module is because the org.apache.axis2.jaxws.message.impl.MessageFactoryImpl class processes AttachmentParts by adding just their DataHandler to the Message by calling Message.addDataHandler().   This is the step where we essentially lose the content-type that was stored on the AttachmentPart (which *could* be set by the user to a value that's different from the implicit content type associated with the DataHandler).   So, by wrapping the AttachmentPart's DataHandler at that point and storing the AttachmentPart's content type in the WrappedDataHandler, we maintain the content type that was set in the AttachmentPart.

> 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: 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


[jira] Commented: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12877163#action_12877163 ] 

Phil Adams commented on AXIS2-4733:
-----------------------------------

Andreas, thanks for posting LazyDataHandler.java.   That's pretty much what I was going to do to fix my issue :)

> 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


[jira] Commented: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12876516#action_12876516 ] 

Rich Scheuerle commented on AXIS2-4733:
---------------------------------------

Hi Phil,

I inspected the patch,  and I understand the need for a WrappedDataHandler.

However, you also need to change the Axis2 SAAJ implementation (org.apache.axis2.saaj.AttachmentPartImpl) to override the setContentType method and use the WrappedDataHandler.

This means that the WrappedDataHandler (and tests) will need to be moved to a different package and module that is accessible from the Axis2 SAAJ module.

I suggest that it should be moved to the kemel module and the org.apache.axis2.util package since this is a common utility.
We also need an Axis2 SAAJ test to make sure Axis2 SAAJ AttachmentPart behaves correctly.

Comments ?

Rich Scheuerle

> 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: 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


[jira] Resolved: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle resolved AXIS2-4733.
-----------------------------------

    Resolution: Fixed

> 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, patch2.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


[jira] Updated: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Adams updated AXIS2-4733:
------------------------------

    Attachment: patch.txt

Attaching patch.txt which contains the "svn diff" of my changes...

> 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
>         Attachments: 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


[jira] Updated: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Adams updated AXIS2-4733:
------------------------------

    Attachment: patch.txt

Attaching patch.txt which contains the "svn diff" of my changes...

> 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
>         Attachments: 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


[jira] Commented: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12876547#action_12876547 ] 

Phil Adams commented on AXIS2-4733:
-----------------------------------

Rich,
I don't quite understand the need for the extra changes you mentioned.   The AttachmentPartImpl already supports getContentType()/setContentType() (inherited from javax.xml.soap.AttachmentPart), so it already maintains the content type separate from the DataHandler instance (the DataHandler has a getContentType() method but this returns only the implicit content type of the DataHandler's data source; the user has no way to set the content type directly on the DataHandler but AttachmentPart does provide that).

The reason that I made the changes only in the jaxws module is because the org.apache.axis2.jaxws.message.impl.MessageFactoryImpl class processes AttachmentParts by adding just their DataHandler to the Message by calling Message.addDataHandler().   This is the step where we essentially lose the content-type that was stored on the AttachmentPart (which *could* be set by the user to a value that's different from the implicit content type associated with the DataHandler).   So, by wrapping the AttachmentPart's DataHandler at that point and storing the AttachmentPart's content type in the WrappedDataHandler, we maintain the content type that was set in the AttachmentPart.

> 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: 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


[jira] Updated: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Adams updated AXIS2-4733:
------------------------------

    Attachment: patch.txt

Attaching patch.txt which contains the "svn diff" of my changes...

> 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
>         Attachments: 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


[jira] Updated: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ 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


[jira] Commented: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12876547#action_12876547 ] 

Phil Adams commented on AXIS2-4733:
-----------------------------------

Rich,
I don't quite understand the need for the extra changes you mentioned.   The AttachmentPartImpl already supports getContentType()/setContentType() (inherited from javax.xml.soap.AttachmentPart), so it already maintains the content type separate from the DataHandler instance (the DataHandler has a getContentType() method but this returns only the implicit content type of the DataHandler's data source; the user has no way to set the content type directly on the DataHandler but AttachmentPart does provide that).

The reason that I made the changes only in the jaxws module is because the org.apache.axis2.jaxws.message.impl.MessageFactoryImpl class processes AttachmentParts by adding just their DataHandler to the Message by calling Message.addDataHandler().   This is the step where we essentially lose the content-type that was stored on the AttachmentPart (which *could* be set by the user to a value that's different from the implicit content type associated with the DataHandler).   So, by wrapping the AttachmentPart's DataHandler at that point and storing the AttachmentPart's content type in the WrappedDataHandler, we maintain the content type that was set in the AttachmentPart.

> 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: 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


[jira] Assigned: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle reassigned AXIS2-4733:
-------------------------------------

    Assignee: Rich Scheuerle

> 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: 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


[jira] Updated: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Adams updated AXIS2-4733:
------------------------------

    Attachment: patch2.txt

Here's an updated patch for this issue.   I changed the WrappedDataHandler ctor according to Andreas' suggestion.

> 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, patch2.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


[jira] Reopened: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Adams reopened AXIS2-4733:
-------------------------------


Unfortunately, the change for this issue caused a problem in the build.    I'm investigating...

> 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: 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


[jira] Resolved: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle resolved AXIS2-4733.
-----------------------------------

    Resolution: Fixed

Thanks Phil for the contribution.

Committed revision 952971.

> 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: 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


[jira] Reopened: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Adams reopened AXIS2-4733:
-------------------------------


Unfortunately, the change for this issue caused a problem in the build.    I'm investigating...

> 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: 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


[jira] Resolved: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle resolved AXIS2-4733.
-----------------------------------

    Resolution: Fixed

Thanks Phil for the contribution.

Committed revision 952971.

> 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: 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


[jira] Reopened: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Adams reopened AXIS2-4733:
-------------------------------


Unfortunately, the change for this issue caused a problem in the build.    I'm investigating...

> 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: 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


[jira] Assigned: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle reassigned AXIS2-4733:
-------------------------------------

    Assignee: Rich Scheuerle

> 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: 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


[jira] Commented: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12876516#action_12876516 ] 

Rich Scheuerle commented on AXIS2-4733:
---------------------------------------

Hi Phil,

I inspected the patch,  and I understand the need for a WrappedDataHandler.

However, you also need to change the Axis2 SAAJ implementation (org.apache.axis2.saaj.AttachmentPartImpl) to override the setContentType method and use the WrappedDataHandler.

This means that the WrappedDataHandler (and tests) will need to be moved to a different package and module that is accessible from the Axis2 SAAJ module.

I suggest that it should be moved to the kemel module and the org.apache.axis2.util package since this is a common utility.
We also need an Axis2 SAAJ test to make sure Axis2 SAAJ AttachmentPart behaves correctly.

Comments ?

Rich Scheuerle

> 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: 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


[jira] Assigned: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle reassigned AXIS2-4733:
-------------------------------------

    Assignee: Rich Scheuerle

> 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: 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


[jira] Reopened: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Adams reopened AXIS2-4733:
-------------------------------


Unfortunately, the change for this issue caused a problem in the build.    I'm investigating...

> 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: 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


[jira] Updated: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Adams updated AXIS2-4733:
------------------------------

    Attachment: patch.txt

Attaching patch.txt which contains the "svn diff" of my changes...

> 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
>         Attachments: 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


[jira] Updated: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ 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


[jira] Commented: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12876516#action_12876516 ] 

Rich Scheuerle commented on AXIS2-4733:
---------------------------------------

Hi Phil,

I inspected the patch,  and I understand the need for a WrappedDataHandler.

However, you also need to change the Axis2 SAAJ implementation (org.apache.axis2.saaj.AttachmentPartImpl) to override the setContentType method and use the WrappedDataHandler.

This means that the WrappedDataHandler (and tests) will need to be moved to a different package and module that is accessible from the Axis2 SAAJ module.

I suggest that it should be moved to the kemel module and the org.apache.axis2.util package since this is a common utility.
We also need an Axis2 SAAJ test to make sure Axis2 SAAJ AttachmentPart behaves correctly.

Comments ?

Rich Scheuerle

> 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: 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


[jira] Updated: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ 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


[jira] Reopened: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Adams reopened AXIS2-4733:
-------------------------------


Unfortunately, the change for this issue caused a problem in the build.    I'm investigating...

> 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: 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


[jira] Resolved: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle resolved AXIS2-4733.
-----------------------------------

    Resolution: Fixed

> 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, patch2.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


[jira] Updated: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Adams updated AXIS2-4733:
------------------------------

    Attachment: patch2.txt

Here's an updated patch for this issue.   I changed the WrappedDataHandler ctor according to Andreas' suggestion.

> 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, patch2.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


[jira] Commented: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12876547#action_12876547 ] 

Phil Adams commented on AXIS2-4733:
-----------------------------------

Rich,
I don't quite understand the need for the extra changes you mentioned.   The AttachmentPartImpl already supports getContentType()/setContentType() (inherited from javax.xml.soap.AttachmentPart), so it already maintains the content type separate from the DataHandler instance (the DataHandler has a getContentType() method but this returns only the implicit content type of the DataHandler's data source; the user has no way to set the content type directly on the DataHandler but AttachmentPart does provide that).

The reason that I made the changes only in the jaxws module is because the org.apache.axis2.jaxws.message.impl.MessageFactoryImpl class processes AttachmentParts by adding just their DataHandler to the Message by calling Message.addDataHandler().   This is the step where we essentially lose the content-type that was stored on the AttachmentPart (which *could* be set by the user to a value that's different from the implicit content type associated with the DataHandler).   So, by wrapping the AttachmentPart's DataHandler at that point and storing the AttachmentPart's content type in the WrappedDataHandler, we maintain the content type that was set in the AttachmentPart.

> 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: 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


[jira] Commented: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12876696#action_12876696 ] 

Rich Scheuerle commented on AXIS2-4733:
---------------------------------------

Phil and I discussed the change.

I am going to commit the patch, but also move the WrapperDataHandler to the org.apache.axis2.util package.

> 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: 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


[jira] Commented: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12877163#action_12877163 ] 

Phil Adams commented on AXIS2-4733:
-----------------------------------

Andreas, thanks for posting LazyDataHandler.java.   That's pretty much what I was going to do to fix my issue :)

> 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


[jira] Commented: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12877163#action_12877163 ] 

Phil Adams commented on AXIS2-4733:
-----------------------------------

Andreas, thanks for posting LazyDataHandler.java.   That's pretty much what I was going to do to fix my issue :)

> 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


[jira] Updated: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ 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


[jira] Resolved: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle resolved AXIS2-4733.
-----------------------------------

    Resolution: Fixed

Thanks Phil for the contribution.

Committed revision 952971.

> 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: 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


[jira] Commented: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12876696#action_12876696 ] 

Rich Scheuerle commented on AXIS2-4733:
---------------------------------------

Phil and I discussed the change.

I am going to commit the patch, but also move the WrapperDataHandler to the org.apache.axis2.util package.

> 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: 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


[jira] Commented: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Phil Adams (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12876547#action_12876547 ] 

Phil Adams commented on AXIS2-4733:
-----------------------------------

Rich,
I don't quite understand the need for the extra changes you mentioned.   The AttachmentPartImpl already supports getContentType()/setContentType() (inherited from javax.xml.soap.AttachmentPart), so it already maintains the content type separate from the DataHandler instance (the DataHandler has a getContentType() method but this returns only the implicit content type of the DataHandler's data source; the user has no way to set the content type directly on the DataHandler but AttachmentPart does provide that).

The reason that I made the changes only in the jaxws module is because the org.apache.axis2.jaxws.message.impl.MessageFactoryImpl class processes AttachmentParts by adding just their DataHandler to the Message by calling Message.addDataHandler().   This is the step where we essentially lose the content-type that was stored on the AttachmentPart (which *could* be set by the user to a value that's different from the implicit content type associated with the DataHandler).   So, by wrapping the AttachmentPart's DataHandler at that point and storing the AttachmentPart's content type in the WrappedDataHandler, we maintain the content type that was set in the AttachmentPart.

> 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: 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


[jira] Updated: (AXIS2-4733) Incorrect content-type used in serialized SOAP message for an XML document attachment

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ 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