javasoapcxfsoap-clientsoapheader

CXF: Multiple parts in soap header


I need a soap header like this:

<MyHeader xmlns:foo="http://foourl" xmlns:bar="http://barurl" bar:someParam="true", otherParam="hereiam">WORLD</MyHeader>

I tried to create it like:

new SoapHeader(new QName("http://foourl", "MyHeader", "foo"),
                "WORLD", new JAXBDataBinding(String.class)));

But I just get

<MyHeader xmlns:foo="http://foourl">WORLD</MyHeader>

How can I set the other parts of the header (xmlns:bar, bar:someParam, otherParam)? TIA!


Solution

  • I found a solution for myself:

    https://manoj29.wordpress.com/2011/12/29/apache-cxf-adding-custom-soap-headers-to-a-soap-message/