It's looking amazingly difficult to use any of the most used soap services framework (at least those I've tried) and come up with this kind of soap request
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://bencws.foobar.com/doc/2008-01-01/"
xmlns:soap="http://www.w3.org/2003/05/soap-envelope/">
<soap:Header xmlns:foo="http://safe.foobar.com/doc/2007-01-01/" xmlns:oof="http://www.w3.org/2005/08/addressing">
<foo:AccessKeyId>0PKRFZMV7GRJ11N791R2</foo:AccessKeyId>
<foo:Timestamp>2008-03-07T23:55:22.693Z</foo:Timestamp>
<foo:Signature>someencodedstring</foo:Signature>
<oof:Action>SomeAction</oof:Action>
<oof:To>http://bencws.foobar.com</oof:To>
<oof:MessageID>120493412293</oof:MessageID>
<oof:ReplyTo>
<oof:Address> http://www.w3.org/2005/08/addressing/anonymous</oof:Address>
</oof:ReplyTo>
</soap:Header>
<soap:Body>
...
With cxf I started using cxf-codegen-plugin to create classes stub from wsdl file. But then the "standard" thingie did not allow to change soap:Header namespace or even add stuff inside the tag (unless you bend over backwards twice)
With axis2 I used WSDL2Java and endend up with the same kind of troubles.
I've come up with what would look like formally "correct" soap requests but freaking foobar service won't accept them anyways unless my soap:Envelope and soap:Header don't look exactly like that.
Any help will be much appreciated. Should I try something else? We're now at the point we're thinking to write the xml requests manually which is something I'd avoid.
With CXF, getting the namespaces declared onto the soap:Envelope is relatively easy. You can provide a Map of namespace -> prefix to the client via a request property:
Thus, if you can have the foo and oof namespaces declared there, you could do that. Adding them onto the soap:Header is definitely not an easy thing to do. :-(