Actually, after looking at some of the CXF samples, I see that CXF is
expecting the WSDL to be a bit different than how I have done it.
CXF expects the header to be defined as a part in the request message,
as well as to be specified in the wsdl:binding. For example:
<wsdl:message name="MyOperationRequest">
<wsdl:part name="credentials" element="types:UserCredentials"/>
<wsdl:part name="body" element="types:MyOperation"/>
</wsdl:message>
...
<wsdl:operation name="MyOperation">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:header message="tns:MyOperationRequest" part="credentials"
use="literal" />
<soap:body parts="body" use="literal"/>
</wsdl:input>
...
</wsdl:operation>
My current WSDL defines a separate message type for the header rather
than adding it as a part in the request message. It references this
header in the wsdl:binding. This worked in XFire:
<wsdl:message name="UserCredentials">
<wsdl:part name="credentials" element="types:UserCredentials"/>
</wsdl:message>
<wsdl:message name="MyOperationRequest">
<wsdl:part name="body" element="types:MyOperation"/>
</wsdl:message>
...
<wsdl:operation name="MyOperation">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:header message="tns:UserCredentials" part="credentials"
use="literal" />
<soap:body use="literal"/>
</wsdl:input>
...
</wsdl:operation>
Is my WSDL in bad form? Or is this something CXF should be able to
handle? I prefer my current method as it is a little less verbose when
re-using the header over several operations.
Thanks,
Chris
-----Original Message-----
From: Christopher Moesel [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 04, 2007 5:32 PM
To: [email protected]
Subject: How To Get Object From SOAP Header?
I have a custom authentication type that clients send me through the
SOAP header. In XFire, it generated the service interface with the
header message sent in as a parameter. CXF does not do that.
How can I get access to that data from within my service implementation?
Thanks,
Chris