On Monday 21 January 2008, Frederick N. Brier wrote:
> The WSDL2Java CXF generated web service is not sending a SOAP header.
> Perhaps it is because it is an implicit header?  I tried the -exsh,
> but that did not cause the header to be generated.  The doc seems to
> indicate that it causes the header to be processed if it is not there,
> implying that this is more a server side feature than the client.  Is
> that correct?  Is there another (easy <crossed fingers>) way of
> forcing SOAP header to be generated?  Thank you.

I'd probably have to see the wsdl to see if the code generator would even 
pick it up with the "-exsh true" stuff.   The exsh grabs headers that 
are declared in the soap:binding, but aren't in the same message as the 
other parameters of the method.

If you just want to send a header that ISN'T really declared as a header 
in the wsdl, you can do it, it's just a bit more complex as the JAX-WS 
spec doesn't really address how to do that other than to use an SAAJ 
handler thing, which kind of sucks.

With CXF, you can pass additional headers in through the request context.  
The test case could be used as an example:
http://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/outofband/header/OOBHeaderTest.java

Basically, you create your header object (JAXB or DOM is fine), add it to 
a List<Header> thing, add that to the context, and they'll get sent off.   
Likewise, headers coming in off the wire would be in the response 
context.

-- 
J. Daniel Kulp
Principal Engineer, IONA
[EMAIL PROTECTED]
http://www.dankulp.com/blog

Reply via email to