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

LoggingOutInterceptor logs the wrong Content-Type for some scenarios

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.6, 3.1.2
    • Fix Version/s: 3.1.3, 3.0.7
    • Component/s: Core
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      When the content-type is not explicitly set in a JAXRS scenario using JAXRSClientFactory, the LoggingOutIntereceptor logs the wrong content type application/xml. This can be demonstrated by adding the LoggingOutputInterceptor to systests/jaxrs
      JAXRSClientServerBookTest#testProxyWithCollectionMatrixParams

      This problem does not happen when WebClient is directly used to create a client (e.g., when adding the LoggingOutInterceptor to JAXRSClientServerBook#testGetBookRoot).

      Below, the output showing the LoggingOutInterceptor logging the wrong content type different from the one that went over the wire and logged by the LoggingInInterceptor at the server.

      ----------------------------------------------------------------------------------------------------
      Aug 18, 2015 4:12:18 PM org.apache.cxf.interceptor.LoggingOutInterceptor
      INFO: Outbound Message
      ---------------------------
      ID: 1
      Address: http://localhost:9001/bookstore/segment/matrix-list;first=12;first=3
      Http-Method: GET
      Content-Type: application/xml
      Headers: {Content-Type=[application/xml], Accept=[application/xml], Accept-Encoding=[gzip;q=1.0, identity; q=0.5, *;q=0]}
      --------------------------------------
      Aug 18, 2015 4:12:18 PM org.apache.cxf.interceptor.LoggingInInterceptor
      INFO: Inbound Message
      ----------------------------
      ID: 2
      Address: http://localhost:9001/bookstore/segment/matrix-list;first=12;first=3
      Http-Method: GET
      Content-Type: */*
      Headers: {Accept=[application/xml], accept-encoding=[gzip;q=1.0, identity; q=0.5, *;q=0], Cache-Control=[no-cache], connection=[keep-alive], content-type=[*/*], Host=[localhost:9001], Pragma=[no-cache], User-Agent=[Apache CXF 3.1.3-SNAPSHOT-c4ce1dd672146fa49f7d6b0aabc563843828fe93]}
      --------------------------------------
      Aug 18, 2015 4:12:19 PM org.eclipse.jetty.server.handler.ContextHandler doStop
      INFO: Stopped o.e.j.s.h.ContextHandler@43bc63a3{/,null,UNAVAILABLE}
      Aug 18, 2015 4:12:19 PM org.eclipse.jetty.server.AbstractConnector doStop
      INFO: Stopped ServerConnector@175c2241{HTTP/1.1}{localhost:9001}
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ay Akitoshi Yoshida
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: