Problem resolved by enabling 'Addressing' for the endpoint (def.setAddressingOn(true)).
- Asanka

Asanka Abeysinghe wrote:
Hi All,
I'm trying to set the addressing headers of the response message but it dose not set with my input values. I'm setting the wsa:Action, wsa:RelatedTo by using the following code snippet.

String replyAddress = mc.getOptions().getReplyTo().getAddress();
                AddressEndpoint endpoint = new AddressEndpoint();
                EndpointDefinition def = new EndpointDefinition();
                def.setAddress(replyAddress.trim());
                endpoint.setDefinition(def);
org.apache.synapse.MessageContext rmc = new Axis2MessageContext(mc, synCfg, synEnv);
                rmc.setEnvelope(soapEnvelope);
                rmc.setTo(new EndpointReference(replyAddress));
*rmc.setWSAAction(responseAction);* //TODO wsa headers cannot see in the response message, it drops just before dispatching
                rmc.setSoapAction(responseAction);
                if (relatesTo!=null){
                    *rmc.setRelatesTo(new RelatesTo[]{relatesTo});*
                }
                rmc.setResponse(true);
                endpoint.send(rmc);

When I analyze the response message using TCPMON, both wsa:Action and the wsa:RelatedTo headers are missing and SOAPAction contains the SOAPAction of the original message (request). Any idea on what is happening ?

Regards
Asanka



Reply via email to