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

SOAPAction value not extracted in the inbound processing if the header name does not match exactly "SOAPAction"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.2
    • 2.4, 2.3.4
    • Soap Binding
    • None
    • Moderate

    Description

      The inbound processing uses org.apache.cxf.binding.soap.interceptor.SoapActionInInterceptor to extract the SOAPAction header from the protocol header and put it in the message's property.The extraction code looks for the exact string "SOAPAction" in the protocol header instead of looking for the soap action header in the case-insenstive way.

      The inbound processing initially converts the names of the transport headers from the web container using HttpHeaderHelper. Later, the converted names are stored in a plain map which is passed as the PROTOCOL_HEADERS property. So, if the soap action header is provided as "SOAPAction" or "soapaction" from the web container, this header is stored with key "SOAPAction" and it can be retrieved later. However, if the name is provided using different mixed casing, it is stored with that name and it can only be retrieved using this exact key.

      Initially, I thought we could change SOAPActionInInterceptor locally to look for the soapaction header. But this will not solve other potential problems with the current map.

      So, instead of just changing the SOAPActionInInterceptor, I am in favor of changing the implementation of the PROTOCOL_HEADERS map to support the case-insensitive lookup while preserving the original keys in the map.

      Another reason favoring this approach is that the current case-sensitive map can have a few other problems. For example, the map currently contains two Content-Type headers after it is created by AbstractHTTPDestination (over Jetty): one with "content-type" and the other with "Content-Type". And this is confusing and may lead to some conflicts. Another problem is the extraction problem for other headers when they are spelled in different mixed casing when they are passed.

      So, I think we should use a specific map class that matches the current interface but supports the case-insensitive lookup while preserving the original case sensitive keys. The attached ProtocolHeaders class satisfies this requirement. Its unit test class ProtocolHeadersTest is also attached.

      This class can be used in AbstractHTTPDestination to create the correct protocol headers map. I added a test case AbstractHTTPDestinationTest to check the extraction of the headers into the protocol headers map. The svn diff of 2.3.2 are attached.

      Please take a look at the files and let me know how you think.
      Thanks.

      Regards, aki

      Attachments

        1. test_patches.tar.gz
          2 kB
          Akitoshi Yoshida
        2. ProtocolHeaders.tar.gz
          2 kB
          Akitoshi Yoshida
        3. diff_rt.transports.txt.gz
          2 kB
          Akitoshi Yoshida

        Activity

          People

            dkulp Daniel Kulp
            ay Akitoshi Yoshida
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 4h
                4h
                Remaining:
                Remaining Estimate - 4h
                4h
                Logged:
                Time Spent - Not Specified
                Not Specified