Hi,

I am having a POJO based camel-cxf service endpoint with ws-addressing
enabled and on upgrading to camel-cxf 2.0.0, Soap headers ceased to show up
in the response. With the help of this thread, I switched to using
camel-cxf-2.1-SNAPSHOT and am now able to see soap headers in the response.
My issues is that one particular header (i.e. Action) has the same value in
the response as it had in the request i.e. it is just being echoed back.

My request soap headers are:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:b="http://docs.oasis-open.org/wsn/b-2";
xmlns:rim="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0"
xmlns:add="http://www.w3.org/2005/08/addressing";>
   <soapenv:Header>
<add:Action>http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/SubscribeRequest</add:Action>
<add:MessageID>982dcdce8-8e84-9abedc-8443-48fd83bca9319</add:MessageID>
</soapenv:Header>
.
.
.
The soap headers in my response are:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
   <soap:Header>
      <Action
xmlns="http://www.w3.org/2005/08/addressing";>http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/SubscribeRequest</Action>
      <MessageID
xmlns="http://www.w3.org/2005/08/addressing";>urn:uuid:2208b69a-51c7-41a6-a092-4a1e33425f85</MessageID>
      <RelatesTo
xmlns="http://www.w3.org/2005/08/addressing";>982dcdce8-8e84-9abedc-8443-48fd83bca9319</RelatesTo>
   </soap:Header>
.
.
.
As you can see, 2 of the response headers [MessageID and RelatesTo] are
having proper values, but the 'Action' header is echoing the value which
came in the request.

I am attaching my wsdl which defines the values for Action.

I tried to force the correct value for Action in my Processor as follows:
                List<SoapHeader> soapHeadersList =
(List<SoapHeader>)exchange.getProperty("soapHeaderList");
                SoapHeader oldActionHeader = soapHeadersList.get(0);            
    
                SoapHeader newActionHeader = null;
                Iterator<SoapHeader> iter = soapHeadersList.iterator();
                while (iter.hasNext()) {
                    Element header = (Element)iter.next().getObject();
                    String headerLocalName = header.getLocalName();
                    if (headerLocalName.equalsIgnoreCase("Action")) {
                        String requestType =
header.getFirstChild().getNodeValue();
                        debug("requestType = [" + requestType + "]");
                        String responseType =
"http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/SubscribeResponse";;
                        header.getFirstChild().setNodeValue(responseType);
                        header.getFirstChild().setTextContent(responseType);
                       newActionHeader = new
SoapHeader(oldActionHeader.getName(),header);
                      
newActionHeader.setDirection(Direction.DIRECTION_OUT);
                    }                     
                }
//replace the old Action Header with the new Action Header
                soapHeadersList.set(0, newActionHeader);  
                exchange.getOut().setHeader(Header.HEADER_LIST,
soapHeadersList);

When I debug, I can see the correct value for Action in the exchange, but my
soapUI client still outputs the old value for Action.

Could you help me figure out whats going wrong or how can I replace the
value of a soapHeader for response.

Thanks a lot for your help.

~Kavita



JIRA j...@apache.org wrote:
> 
> 
>     [
> https://issues.apache.org/activemq/browse/CAMEL-1994?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=54428#action_54428
> ] 
> 
> Claus Ibsen commented on CAMEL-1994:
> ------------------------------------
> 
> I have asked Gert V. to force an update at Hudson.
> 
> So take a look in the next day or so, to see if the Apache repository is
> not updated using that URI you found (its the correct one).
> 
>> WS-Adressing: No headers in the respose, [MAPs retrieved from message
>> null]
>> ---------------------------------------------------------------------------
>>
>>                 Key: CAMEL-1994
>>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1994
>>             Project: Apache Camel
>>          Issue Type: Bug
>>          Components: camel-cxf
>>    Affects Versions: 2.0.0
>>         Environment: Windows XP, Camel 2.0.0, JDK 1.5, Soap-UI
>>            Reporter: Shailesh Soliwal
>>            Assignee: Willem Jiang
>>             Fix For: 2.1.0
>>
>>         Attachments: ebxml_request.xml, IHEXDS.zip, logs.txt,
>> wsa-test.patch
>>
>>
>> I am using a cxf endpoint configured in POJO mode and running in
>> wsdl-first-approach. When a web-service client(Soap-UI) send a request
>> with headers, it expects headers back with appropriate response Action
>> defined in wsdl, however, with this configuration no headers are not
>> being sent back.
>> Error seen on debug logs:
>> ContextUtils                   DEBUG retrieving MAPs from context
>> property javax.xml.ws.addressing.context.inbound
>> ContextUtils                   WARN  WS-Addressing - failed to retrieve
>> Message Addressing Properties from context
>> MAPAggregator                  DEBUG MAPs retrieved from message null
>> ContextUtils                   DEBUG retrieving MAPs from context
>> property javax.xml.ws.addressing.context.outbound
>> ContextUtils                   WARN  WS-Addressing - failed to retrieve
>> Message Addressing Properties from context
>> ContextUtils                   DEBUG retrieving MAPs from context
>> property javax.xml.ws.addressing.context.outbound
>> ContextUtils                   WARN  WS-Addressing - failed to retrieve
>> Message Addressing Properties from context
>> Please find attached detailed logs, a sample project, and a sample xml
>> request.
>> Some more details:
>> Endpoint configuration: CxfEndpoint, WSAdressing Feature enabled, Wsdl
>> First approach
>> Camel Version: 2.0.0
>> CXF Version: 2.2.2
> 
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
> 
> 
> 
http://old.nabble.com/file/p26421247/Subscribe.wsdl Subscribe.wsdl 
-- 
View this message in context: 
http://old.nabble.com/-jira--Created%3A-%28CAMEL-1994%29-WS-Adressing%3A-No-headers-in-the-respose%2C--MAPs-retrieved-from-message-null--tp25333276p26421247.html
Sent from the Camel Development mailing list archive at Nabble.com.

Reply via email to