You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Michael Allman (JIRA)" <ji...@apache.org> on 2009/10/15 10:42:31 UTC

[jira] Created: (CXF-2474) DocLiteralInInterceptor.handleMessage(Message) does not handle use case where message part is an XMLStreamReader

DocLiteralInInterceptor.handleMessage(Message) does not handle use case where message part is an XMLStreamReader
----------------------------------------------------------------------------------------------------------------

                 Key: CXF-2474
                 URL: https://issues.apache.org/jira/browse/CXF-2474
             Project: CXF
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.2.4, 2.2.5
            Reporter: Michael Allman
         Attachments: DocLiteralInInterceptor.patch

The DocLiteralInInterceptor.handleMessage(Message) method breaks on the use case where the message part is an XMLStreamReader.

The code seems to assume that line 188:

                    o = dr.read(p, xmlReader);

actually "reads" the message XML from xmlReader and advances to the next message part.  Not so when dr is an XMLStreamDataReader.  In that case, o is in fact xmlReader itself.

We need to check in the while condition at line 195 that o != xmlReader (or come up with a more elegant solution).  I'm attaching a patch that does that.

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


[jira] Commented: (CXF-2474) DocLiteralInInterceptor.handleMessage(Message) does not handle use case where message part is an XMLStreamReader

Posted by "Michael Allman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12766472#action_12766472 ] 

Michael Allman commented on CXF-2474:
-------------------------------------

Daniel,

I can't use the SourceDataBinding.  It's DataWriter does not handle the case where the object to write is an instance of XMLStreamWriterCallback.  My invoke method returns an object of that type.  That's one reason I'm not using JAX-WS in the first place, but that's a different story...

Can you elaborate on the "StaxDatabinding feature thing that removes those interceptors" as I don't know what that is?

Cheers.

> DocLiteralInInterceptor.handleMessage(Message) does not handle use case where message part is an XMLStreamReader
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-2474
>                 URL: https://issues.apache.org/jira/browse/CXF-2474
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.2.4, 2.2.5
>            Reporter: Michael Allman
>            Assignee: Daniel Kulp
>             Fix For: 2.2.5
>
>         Attachments: DocLiteralInInterceptor.patch
>
>
> The DocLiteralInInterceptor.handleMessage(Message) method breaks on the use case where the message part is an XMLStreamReader.
> The code seems to assume that line 188:
>                     o = dr.read(p, xmlReader);
> actually "reads" the message XML from xmlReader and advances to the next message part.  Not so when dr is an XMLStreamDataReader.  In that case, o is in fact xmlReader itself.
> We need to check in the while condition at line 195 that o != xmlReader (or come up with a more elegant solution).  I'm attaching a patch that does that.

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


[jira] Commented: (CXF-2474) DocLiteralInInterceptor.handleMessage(Message) does not handle use case where message part is an XMLStreamReader

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12766690#action_12766690 ] 

Daniel Kulp commented on CXF-2474:
----------------------------------


With 2.2.5, the SourceDatabinding properly supports either the Java6  javax.xml.transform.stax.StAXSource object or our own org.apache.cxf.staxutils.StaxSource (subclass of SAXSource) which can hold onto the XMLStreamReader.

In anycase, if you configure in a feature of class org.apache.cxf.databinding.stax.StaxDataBindingFeature  (see http://cxf.apache.org/docs/features.html), it should remove the interceptors it has problems with and put in a new one.

> DocLiteralInInterceptor.handleMessage(Message) does not handle use case where message part is an XMLStreamReader
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-2474
>                 URL: https://issues.apache.org/jira/browse/CXF-2474
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.2.4, 2.2.5
>            Reporter: Michael Allman
>            Assignee: Daniel Kulp
>             Fix For: 2.2.5
>
>         Attachments: DocLiteralInInterceptor.patch
>
>
> The DocLiteralInInterceptor.handleMessage(Message) method breaks on the use case where the message part is an XMLStreamReader.
> The code seems to assume that line 188:
>                     o = dr.read(p, xmlReader);
> actually "reads" the message XML from xmlReader and advances to the next message part.  Not so when dr is an XMLStreamDataReader.  In that case, o is in fact xmlReader itself.
> We need to check in the while condition at line 195 that o != xmlReader (or come up with a more elegant solution).  I'm attaching a patch that does that.

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


[jira] Commented: (CXF-2474) DocLiteralInInterceptor.handleMessage(Message) does not handle use case where message part is an XMLStreamReader

Posted by "Michael Allman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12767642#action_12767642 ] 

Michael Allman commented on CXF-2474:
-------------------------------------

I have verified that the StaxDataBindingFeature works for me. This eliminates my need to use the patch.

Thank you.

> DocLiteralInInterceptor.handleMessage(Message) does not handle use case where message part is an XMLStreamReader
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-2474
>                 URL: https://issues.apache.org/jira/browse/CXF-2474
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.2.4, 2.2.5
>            Reporter: Michael Allman
>            Assignee: Daniel Kulp
>             Fix For: 2.2.5
>
>         Attachments: DocLiteralInInterceptor.patch
>
>
> The DocLiteralInInterceptor.handleMessage(Message) method breaks on the use case where the message part is an XMLStreamReader.
> The code seems to assume that line 188:
>                     o = dr.read(p, xmlReader);
> actually "reads" the message XML from xmlReader and advances to the next message part.  Not so when dr is an XMLStreamDataReader.  In that case, o is in fact xmlReader itself.
> We need to check in the while condition at line 195 that o != xmlReader (or come up with a more elegant solution).  I'm attaching a patch that does that.

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


[jira] Issue Comment Edited: (CXF-2474) DocLiteralInInterceptor.handleMessage(Message) does not handle use case where message part is an XMLStreamReader

Posted by "Michael Allman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12766472#action_12766472 ] 

Michael Allman edited comment on CXF-2474 at 10/16/09 1:37 AM:
---------------------------------------------------------------

Daniel,

I can't use the SourceDataBinding.  Its DataWriter does not handle the case where the object to write is an instance of XMLStreamWriterCallback.  My invoke method returns an object of that type.  That's one reason I'm not using JAX-WS in the first place, but that's a different story...

Can you elaborate on the "StaxDatabinding feature thing that removes those interceptors" as I don't know what that is?

Cheers.

      was (Author: msa@allman.ms):
    Daniel,

I can't use the SourceDataBinding.  It's DataWriter does not handle the case where the object to write is an instance of XMLStreamWriterCallback.  My invoke method returns an object of that type.  That's one reason I'm not using JAX-WS in the first place, but that's a different story...

Can you elaborate on the "StaxDatabinding feature thing that removes those interceptors" as I don't know what that is?

Cheers.
  
> DocLiteralInInterceptor.handleMessage(Message) does not handle use case where message part is an XMLStreamReader
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-2474
>                 URL: https://issues.apache.org/jira/browse/CXF-2474
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.2.4, 2.2.5
>            Reporter: Michael Allman
>            Assignee: Daniel Kulp
>             Fix For: 2.2.5
>
>         Attachments: DocLiteralInInterceptor.patch
>
>
> The DocLiteralInInterceptor.handleMessage(Message) method breaks on the use case where the message part is an XMLStreamReader.
> The code seems to assume that line 188:
>                     o = dr.read(p, xmlReader);
> actually "reads" the message XML from xmlReader and advances to the next message part.  Not so when dr is an XMLStreamDataReader.  In that case, o is in fact xmlReader itself.
> We need to check in the while condition at line 195 that o != xmlReader (or come up with a more elegant solution).  I'm attaching a patch that does that.

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


[jira] Updated: (CXF-2474) DocLiteralInInterceptor.handleMessage(Message) does not handle use case where message part is an XMLStreamReader

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

Michael Allman updated CXF-2474:
--------------------------------

    Attachment: DocLiteralInInterceptor.patch

Proposed fix

> DocLiteralInInterceptor.handleMessage(Message) does not handle use case where message part is an XMLStreamReader
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-2474
>                 URL: https://issues.apache.org/jira/browse/CXF-2474
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.2.4, 2.2.5
>            Reporter: Michael Allman
>         Attachments: DocLiteralInInterceptor.patch
>
>
> The DocLiteralInInterceptor.handleMessage(Message) method breaks on the use case where the message part is an XMLStreamReader.
> The code seems to assume that line 188:
>                     o = dr.read(p, xmlReader);
> actually "reads" the message XML from xmlReader and advances to the next message part.  Not so when dr is an XMLStreamDataReader.  In that case, o is in fact xmlReader itself.
> We need to check in the while condition at line 195 that o != xmlReader (or come up with a more elegant solution).  I'm attaching a patch that does that.

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


[jira] Commented: (CXF-2474) DocLiteralInInterceptor.handleMessage(Message) does not handle use case where message part is an XMLStreamReader

Posted by "Michael Allman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12766954#action_12766954 ] 

Michael Allman commented on CXF-2474:
-------------------------------------

WRT SourceDatabinding, yes, I see that it supports javax.xml.transform.stax.StAXSource.  However, it does not support return values of type XMLStreamWriterCallback.  Are there plans to support this?  Writing the response using an XMLStreamWriter is *much* easier than using an XMLStreamReader.  If you want, I can work on a patch.

As far as the StaxDataBindingFeature goes, I've written the code but have been unable to test it yet.  I will write again when I've confirmed it's working.

Thanks.

> DocLiteralInInterceptor.handleMessage(Message) does not handle use case where message part is an XMLStreamReader
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-2474
>                 URL: https://issues.apache.org/jira/browse/CXF-2474
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.2.4, 2.2.5
>            Reporter: Michael Allman
>            Assignee: Daniel Kulp
>             Fix For: 2.2.5
>
>         Attachments: DocLiteralInInterceptor.patch
>
>
> The DocLiteralInInterceptor.handleMessage(Message) method breaks on the use case where the message part is an XMLStreamReader.
> The code seems to assume that line 188:
>                     o = dr.read(p, xmlReader);
> actually "reads" the message XML from xmlReader and advances to the next message part.  Not so when dr is an XMLStreamDataReader.  In that case, o is in fact xmlReader itself.
> We need to check in the while condition at line 195 that o != xmlReader (or come up with a more elegant solution).  I'm attaching a patch that does that.

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


[jira] Resolved: (CXF-2474) DocLiteralInInterceptor.handleMessage(Message) does not handle use case where message part is an XMLStreamReader

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

Daniel Kulp resolved CXF-2474.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.2.5
         Assignee: Daniel Kulp


I did provide the suggested fix, but one major note is that the StaxDatabinding specifically states in it's javadoc that it doesn't work with the standard interceptors.   You should be using the StaxDatabinding feature thing that removes those interceptors.

Either that or (preferrably for 2.2.5) change to the SourceDatabinding which does work with better with them and provides some extra flexibility as well as better testing (due to the JAX-WS providers using it).   Additional features and stuff will be added to the SourceDatabinding and probably not the StaxDatabinding.



> DocLiteralInInterceptor.handleMessage(Message) does not handle use case where message part is an XMLStreamReader
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-2474
>                 URL: https://issues.apache.org/jira/browse/CXF-2474
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.2.4, 2.2.5
>            Reporter: Michael Allman
>            Assignee: Daniel Kulp
>             Fix For: 2.2.5
>
>         Attachments: DocLiteralInInterceptor.patch
>
>
> The DocLiteralInInterceptor.handleMessage(Message) method breaks on the use case where the message part is an XMLStreamReader.
> The code seems to assume that line 188:
>                     o = dr.read(p, xmlReader);
> actually "reads" the message XML from xmlReader and advances to the next message part.  Not so when dr is an XMLStreamDataReader.  In that case, o is in fact xmlReader itself.
> We need to check in the while condition at line 195 that o != xmlReader (or come up with a more elegant solution).  I'm attaching a patch that does that.

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