Hi, I have a Problem with cxf soap-headers. I set up an cxf-project with the Contract-firs-development method. I want to call a web service with an cxf-component which uses a wsld: _____________________________________________________________________ <cxf:cxfEndpoint id="ICCSCustomerService" address="http://localhost:8080/iccs-xsoap/CustomerService/updateCustomer" serviceClass="de.iccs.xsoap.customer.v1.CustomerServiceImpl" wsdlURL="wsdl/CustomerService.wsdl"> </cxf:cxfEndpoint> ______________________________________________________________________ I want to send an pojo throw an queue as an request for the ws. But I need to implement a soap header like this one: ______________________________________________________________________ <ns2:Header> <simpleAuth xmlns="http://xsoap.iccs.de/v1" password="s2m3s" username="admin"/> </ns2:Header> ______________________________________________________________________ To archive this I wrote an processor like this one: ______________________________________________________________________ @Override public void process(Exchange exchange) throws Exception {
List<SoapHeader> soapHeaders = CastUtils.cast((List<?>)exchange.getOut().getHeader(Header.HEADER_LIST)); // Insert a new header String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?><outofbandHeader " + "xmlns=\"http://cxf.apache.org/outofband/Header\" hdrAttribute=\"testHdrAttribute\" " + "xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" soap:mustUnderstand=\"1\">" + "<name>simpleAuth username=\"yyy\" password=\"xxx\" xmlns=\"http://xsoap.iccs.de/v1\"</name></outofbandHeader>"; SoapHeader newHeader = new SoapHeader(new QName("http://xsoap.iccs.de/v1", "simpleAuth"), DOMUtils.readXml(new StringReader(xml)).getDocumentElement()); // make sure direction is OUT since it is a response message. newHeader.setDirection(Direction.DIRECTION_OUT); //newHeader.setMustUnderstand(false); soapHeaders.add(newHeader); ______________________________________________________________________ My route looks like this: ______________________________________________________________________ <route id="CustomerServiceUpdateCustomerTest"> <camel:from uri="direct:iccsUpdateCustomerRequest"/> <camel:process ref="addCredentials"/> <to uri="cxf:bean:ICCSCustomerService"/> <camel:to uri="stream:out"/> </route> Unfortunatly I get an null-pointer Exception in this statement: List<SoapHeader> soapHeaders = CastUtils.cast((List<?>)exchange.getOut().getHeader(Header.HEADER_LIST)); Obviously there are no soap-headers in this message. And it seems not to be an soap message at all. Even an <camel:marshal> <soapjaxb contextPath="de.iccs.xsoap.customer.v1" /> </camel:marshal> <camel:process ref="addCredentials"/> does not work, as it produces only an soap-envelope without an soap-header. Could you provide me an example how to get an soap message (with soap-header) from an pojo-message. Thank you Gabriel -- View this message in context: http://camel.465427.n5.nabble.com/add-custom-soap-header-from-pojo-message-tp5725764.html Sent from the Camel - Users mailing list archive at Nabble.com.