So... if the header must be defined as a part in the message, then it is impossible to use SOAP headers in a CXF doc/literal wrapped service?
Section 2.3.1.2 of the JAX-WS spec states that an operation is only considered to be wrapper style if the input and output messages each only have a *single* part. It appears that CXF honors the spec: after changing my WSDL to specify the header as a part in each message, CXF now generates the service interface in the BARE style. Ugh. What to do? -Chris -----Original Message----- From: Tully, Gary [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 04, 2007 6:13 PM To: [email protected] Subject: RE: How To Get Object From SOAP Header? Hi Chris, >From my reading of the basic profile I think the only the sample wsdl is correct. Check out these relevant bits[1][2] for some more detail. Hope this helps, Gary. [1] http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html#R2208 [2] http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html#R2738 > -----Original Message----- > From: Christopher Moesel [mailto:[EMAIL PROTECTED] > Sent: 04 April 2007 22:54 > To: [email protected] > Subject: RE: How To Get Object From SOAP Header? > > Ugh. I apologize for the weird way my email client formatted > those xml fragments. I've tried to fix them below-- let's > see if it works! > > -----Original Message----- > From: Christopher Moesel [mailto:[EMAIL PROTECTED] > Sent: Wednesday, April 04, 2007 5:51 PM > To: [email protected] > Subject: RE: How To Get Object From SOAP Header? > > 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 >
