You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Willem Jiang (JIRA)" <ji...@apache.org> on 2011/03/28 09:55:05 UTC

[jira] [Issue Comment Edited] (CAMEL-3806) SOAPAction HTTP header value not copied correctly to from CXF message to Camel message header

    [ https://issues.apache.org/jira/browse/CAMEL-3806?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011946#comment-13011946 ] 

Willem Jiang edited comment on CAMEL-3806 at 3/28/11 7:54 AM:
--------------------------------------------------------------

Because SOAP11 and SOAP12 send the SOAPAction with different protocol:
SOAP11 uses SOAPAction="xxx" http header,
SOAP12 uses action="xxx"  as a part of content-type
If we want to provides the user with consistence result, we need to store the result with key of "SOAPAction" for common using, CXF SOAPActionInterceptor takes care of it and strip the "/"" for using. In camel-cxf we copy the PROTOCOL_HEADER directly into the Camel message header, if the user using SOAP11 binding, the SOAPAction is also a part of the PROTOOL_HEADER. If the user want to get the message header of SOAPAction, he will get.
If the user using SOAP12 binding, he can't get any value with the message header of SOAPAction.

SO my suggestion is we just put the SOAPAction header from CXF message into camel message, in this way the user can get this kind of the message header directly from the camel message whatever the soap binding is.

Willem

      was (Author: njiang):
    Because SOAP11 and SOAP12 send the SOAPAction with different protocol:
SOAP11 uses SOAPAction="xxx" http header,
SOAP12 uses action="xxx"  as a part of content-type
If we want to provides the user with consistence result, we need to store the result with key of "SOAPAction" for common using, CXF SOAPActionInterceptor takes care of it and strip the "/"" for using. In camel-cxf we copy the PROTOCOL_HEADER directly into the Camel message header, if the user using SOAP11 binding, the SOAPAction is also a part of the PROTOOL_HEADER. If the user want to get the message header of SOAPAction, he will get.
If the user using SOAP12 binding, he can't get any value with the message header of SOAPAction.

SO my suggestion is we just put the SOAPAction header from CXF message into camel message, in this way the user can get this kind of the message header directly the camel message whatever the soap binding is using.

Willem
  
> SOAPAction HTTP header value not copied correctly to from CXF message to Camel message header
> ---------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3806
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3806
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.6.0
>         Environment: camel-cxf, CXF consumer endpoint with PAYLOAD data format 
>            Reporter: Torsten Mielke
>            Assignee: Willem Jiang
>              Labels: CXF, HTTP, SOAPAction, header
>             Fix For: 2.8.0
>
>         Attachments: testcase.zip
>
>
> When using camel-cxf consumer endpoint with PAYLOAD data format, the SoapActionInInterceptor correctly strips off any double quotes surrounding the SOAPAction header value, e.g:
> {code}
> SOAPAction: "http://apache.org/hello_world_soap_http/greetMe"
> {code}
> and then sets this header on the message again:
> {code:title=SoapActionInInterceptor.java}
> public void handleMessage(SoapMessage message) throws Fault {
>         String action = getSoapAction(message);
>         if (!StringUtils.isEmpty(action)) {
>             getAndSetOperation(message, action);
>         }
>     }
> {code}
> After the execution of getAndSetOperation(message, action), there are two SOAPAction headers set on the message. The original SOAPAction header value (with surrounding quotes) is part of the org.apache.cxf.message.Message.PROTOCOL_HEADERS. In addition the getAndSetOperation() method also adds 
> SOAPAction=http://apache.org/hello_world_soap_http/greetMe header (without surrounding quotes). 
> Later in org.apache.camel.component.cxf.DefaultCxfBinding.propagateHeadersFromCxfToCamel(), when the CXF message headers get copied to the Camel message, it only retrieves the org.apache.cxf.message.Message.PROTOCOL_HEADERS:
> {code}
> Map<String, List<String>> cxfHeaders = (Map)cxfMessage.get(Message.PROTOCOL_HEADERS);
> {code}
> The SOAPAction header in PROTOCOL_HEADERS wasn't changed by the SoapActionInInterceptor and hence still has enclosed double quotes. These headers then get copied to the Camel In message headers. The header that was set by the SoapActionInInterceptor SOAPAction=http://apache.org/hello_world_soap_http/greetMe does not get copied!
> If later in a Camel route a custom Camel Processor tries to resolve this SOAPAction header, it gets the the value with surrounding double quotes, but these should actually have been stripped off. 
> This behavior is a bug.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira