I need to call asynchronous web service from my apache camel.
for that i need to pass replyTo Address in header from my camel-cxf.xml, when i call end system.
If i pass this as a header from SOAP UI, it work fine for me and end system send me reply to "xxxx" address.
<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"> <wsa:ReplyTo> <wsa:Address>xxxx</wsa:Address> </wsa:ReplyTo> <wsa:MessageID>urn:uuid:111342</wsa:MessageID> </soapenv:Header>
But i need to set this property from my code.
In my process method , i done this
QName qname1=QName.valueOf("{http://www.w3.org/2005/08/addressing}ReplyTo");
SoapHeader header1 = new SoapHeader(qname1, "xxxx");
String requestHeader = "<wsa:ReplyTo xmlns:wsa=\"http://www.w3.org/2005/08/addressing\"> "
+ "<wsa:Address xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">xxxx</wsa:Address>"
+ "</wsa:ReplyTo>"
+ "<wsa:MessageID xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">urn:uuid:111342</wsa:MessageID>";
final List<SoapHeader> headers=new ArrayList<SoapHeader>();
headers.add(new SoapHeader(qname1,DOMUtils.readXml(new StringReader(requestHeader)).getDocumentElement()));
exchange.getIn().setHeader(SoapHeader.HEADER_LIST,headers);
But it's not working.. can any one give me a proper solution?