You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Eamonn Dwyer (JIRA)" <ji...@apache.org> on 2009/06/26 15:57:07 UTC

[jira] Created: (CXF-2322) Interceptors cannot make a copy of the returned input stream in JaxRS clients

Interceptors cannot make a copy of the returned input stream in JaxRS clients
-----------------------------------------------------------------------------

                 Key: CXF-2322
                 URL: https://issues.apache.org/jira/browse/CXF-2322
             Project: CXF
          Issue Type: Bug
          Components: REST
    Affects Versions: 2.2.2
            Reporter: Eamonn Dwyer
             Fix For: 2.2.3


The JaxWS clients use the stream object stored as inMessage.setContent(InputStream.class, is) which allows other interceptors to make copies of the returned stream. The JaxRS client however always goes back to the HttpInputStream stored in the HTTPURLConnection object. If you try to make a copy of the stream data you drain the HttpInputStream data and eventually the respose call will fail because the HttpInputStream is empty. 

I'ld like to propose a change to get the JaxRS client to always first check to see if a call to inMessage.getContent(InputStream) returns a stream and if not then default back to the HttpURLConnection's HttpInputStream. This will allow other intercpetors to make copies of the stream data.

Patch to follow very soon

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


[jira] Commented: (CXF-2322) Interceptors cannot make a copy of the returned input stream in JaxRS clients

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

Hudson commented on CXF-2322:
-----------------------------

Integrated in CXF-Trunk-JDK16 #97 (See [http://hudson.zones.apache.org/hudson/job/CXF-Trunk-JDK16/97/])
    [] can't publish endpoint with XmlBeans databinding when build servicemodel from class


> Interceptors cannot make a copy of the returned input stream in JaxRS clients
> -----------------------------------------------------------------------------
>
>                 Key: CXF-2322
>                 URL: https://issues.apache.org/jira/browse/CXF-2322
>             Project: CXF
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 2.2.2
>            Reporter: Eamonn Dwyer
>            Assignee: Sergey Beryozkin
>             Fix For: 2.2.3, 2.3
>
>         Attachments: CXF-2322.patch
>
>
> The JaxWS clients use the stream object stored as inMessage.setContent(InputStream.class, is) which allows other interceptors to make copies of the returned stream. The JaxRS client however always goes back to the HttpInputStream stored in the HTTPURLConnection object. If you try to make a copy of the stream data you drain the HttpInputStream data and eventually the respose call will fail because the HttpInputStream is empty. 
> I'ld like to propose a change to get the JaxRS client to always first check to see if a call to inMessage.getContent(InputStream) returns a stream and if not then default back to the HttpURLConnection's HttpInputStream. This will allow other intercpetors to make copies of the stream data.
> Patch to follow very soon

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


[jira] Updated: (CXF-2322) Interceptors cannot make a copy of the returned input stream in JaxRS clients

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

Eamonn Dwyer updated CXF-2322:
------------------------------

    Attachment: CXF-2322.patch

I also made the getter and setter methods  for the InInterceptors and OutInterceptors on the AbstractClient class public so that a client can add interceptors to the list.

> Interceptors cannot make a copy of the returned input stream in JaxRS clients
> -----------------------------------------------------------------------------
>
>                 Key: CXF-2322
>                 URL: https://issues.apache.org/jira/browse/CXF-2322
>             Project: CXF
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 2.2.2
>            Reporter: Eamonn Dwyer
>             Fix For: 2.2.3
>
>         Attachments: CXF-2322.patch
>
>
> The JaxWS clients use the stream object stored as inMessage.setContent(InputStream.class, is) which allows other interceptors to make copies of the returned stream. The JaxRS client however always goes back to the HttpInputStream stored in the HTTPURLConnection object. If you try to make a copy of the stream data you drain the HttpInputStream data and eventually the respose call will fail because the HttpInputStream is empty. 
> I'ld like to propose a change to get the JaxRS client to always first check to see if a call to inMessage.getContent(InputStream) returns a stream and if not then default back to the HttpURLConnection's HttpInputStream. This will allow other intercpetors to make copies of the stream data.
> Patch to follow very soon

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


[jira] Assigned: (CXF-2322) Interceptors cannot make a copy of the returned input stream in JaxRS clients

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

Sergey Beryozkin reassigned CXF-2322:
-------------------------------------

    Assignee: Sergey Beryozkin

> Interceptors cannot make a copy of the returned input stream in JaxRS clients
> -----------------------------------------------------------------------------
>
>                 Key: CXF-2322
>                 URL: https://issues.apache.org/jira/browse/CXF-2322
>             Project: CXF
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 2.2.2
>            Reporter: Eamonn Dwyer
>            Assignee: Sergey Beryozkin
>             Fix For: 2.2.3
>
>         Attachments: CXF-2322.patch
>
>
> The JaxWS clients use the stream object stored as inMessage.setContent(InputStream.class, is) which allows other interceptors to make copies of the returned stream. The JaxRS client however always goes back to the HttpInputStream stored in the HTTPURLConnection object. If you try to make a copy of the stream data you drain the HttpInputStream data and eventually the respose call will fail because the HttpInputStream is empty. 
> I'ld like to propose a change to get the JaxRS client to always first check to see if a call to inMessage.getContent(InputStream) returns a stream and if not then default back to the HttpURLConnection's HttpInputStream. This will allow other intercpetors to make copies of the stream data.
> Patch to follow very soon

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


[jira] Commented: (CXF-2322) Interceptors cannot make a copy of the returned input stream in JaxRS clients

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12724641#action_12724641 ] 

Sergey Beryozkin commented on CXF-2322:
---------------------------------------

Hi Eamonn - thanks for the patch.
There's one thing which I'd like to think more about. I was quite keen on making sure the WebClient and Client could expose only the methods to do with the http. So I might want to introduce another interface/class which can be used to customize things like in/out cxf interceptors, contexts, etc...
I'll see if it can be dome or not and then get back to you
thanks, Sergey

> Interceptors cannot make a copy of the returned input stream in JaxRS clients
> -----------------------------------------------------------------------------
>
>                 Key: CXF-2322
>                 URL: https://issues.apache.org/jira/browse/CXF-2322
>             Project: CXF
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 2.2.2
>            Reporter: Eamonn Dwyer
>             Fix For: 2.2.3
>
>         Attachments: CXF-2322.patch
>
>
> The JaxWS clients use the stream object stored as inMessage.setContent(InputStream.class, is) which allows other interceptors to make copies of the returned stream. The JaxRS client however always goes back to the HttpInputStream stored in the HTTPURLConnection object. If you try to make a copy of the stream data you drain the HttpInputStream data and eventually the respose call will fail because the HttpInputStream is empty. 
> I'ld like to propose a change to get the JaxRS client to always first check to see if a call to inMessage.getContent(InputStream) returns a stream and if not then default back to the HttpURLConnection's HttpInputStream. This will allow other intercpetors to make copies of the stream data.
> Patch to follow very soon

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


[jira] Commented: (CXF-2322) Interceptors cannot make a copy of the returned input stream in JaxRS clients

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

Daniel Kulp commented on CXF-2322:
----------------------------------


Well, we already have an InterceptorProvider interface for the interceptors.   :-)

> Interceptors cannot make a copy of the returned input stream in JaxRS clients
> -----------------------------------------------------------------------------
>
>                 Key: CXF-2322
>                 URL: https://issues.apache.org/jira/browse/CXF-2322
>             Project: CXF
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 2.2.2
>            Reporter: Eamonn Dwyer
>             Fix For: 2.2.3
>
>         Attachments: CXF-2322.patch
>
>
> The JaxWS clients use the stream object stored as inMessage.setContent(InputStream.class, is) which allows other interceptors to make copies of the returned stream. The JaxRS client however always goes back to the HttpInputStream stored in the HTTPURLConnection object. If you try to make a copy of the stream data you drain the HttpInputStream data and eventually the respose call will fail because the HttpInputStream is empty. 
> I'ld like to propose a change to get the JaxRS client to always first check to see if a call to inMessage.getContent(InputStream) returns a stream and if not then default back to the HttpURLConnection's HttpInputStream. This will allow other intercpetors to make copies of the stream data.
> Patch to follow very soon

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


[jira] Resolved: (CXF-2322) Interceptors cannot make a copy of the returned input stream in JaxRS clients

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

Sergey Beryozkin resolved CXF-2322.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.3

Hi Eamonn - I applied the pacth, though I did a minor modification to the system test, I added interceptors before WebClient is created. I'll look at the way interceptors/etc can be retrieved from WebClient as part of working on  - I'd like to see if I can introduce some configuration holder

https://issues.apache.org/jira/browse/CXF-2323

thanks, Sergey

> Interceptors cannot make a copy of the returned input stream in JaxRS clients
> -----------------------------------------------------------------------------
>
>                 Key: CXF-2322
>                 URL: https://issues.apache.org/jira/browse/CXF-2322
>             Project: CXF
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 2.2.2
>            Reporter: Eamonn Dwyer
>            Assignee: Sergey Beryozkin
>             Fix For: 2.2.3, 2.3
>
>         Attachments: CXF-2322.patch
>
>
> The JaxWS clients use the stream object stored as inMessage.setContent(InputStream.class, is) which allows other interceptors to make copies of the returned stream. The JaxRS client however always goes back to the HttpInputStream stored in the HTTPURLConnection object. If you try to make a copy of the stream data you drain the HttpInputStream data and eventually the respose call will fail because the HttpInputStream is empty. 
> I'ld like to propose a change to get the JaxRS client to always first check to see if a call to inMessage.getContent(InputStream) returns a stream and if not then default back to the HttpURLConnection's HttpInputStream. This will allow other intercpetors to make copies of the stream data.
> Patch to follow very soon

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