Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-6106

ClientResponseFilterInterceptor wraps client response exchange message into ClientRequestContextImpl - as a result code can't access client request context

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 3.0.1, 3.0.2
    • 3.0.3, 2.7.14, 3.1
    • JAX-RS
    • Novice

    Description

      Long story short: ClientResponseFilter gets invalid ClientRequestContext objects. As a result the majority of functionality doesn't work, e.g. requestContext.getUri() will always return null.

      This happens due to these lines:

      at org.apache.cxf.jaxrs.client.spec.ClientResponseFilterInterceptor.handleMessage(ClientResponseFilterInterceptor.java:57)
      ClientRequestContext reqContext = new ClientRequestContextImpl(inMessage.getExchange().getInMessage(),
                                                                  true);
      

      Thus ClientRequestContext implementation wraps response message instead of request:

      As a result majority of request context functionality is broken including predefined fields like ClientRequestContext.getUri().

      Attachments

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            kozlovda Dmitry Kozlov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: