I want to create a service that has a couple of required SOAP header elements but I don't want those elements passed as parameters to the underlying service methods. I want to use the header for doing some pre-processing before the service method is called. I want to be able to specify the required headers in the WSDL but as far as I can tell, there is no way to do this using WSDD. If header parameters are specified in the <operation> sub-element of a <service>, the deployer assumes that these are parameters to be passed to the service method.

My approach has been to subclass a BasicHandler, override the generateWSDL() method and set the new handler in a <responseFlow>. The handler simply searches out all operation elements in the binding element and adds a header element to the input for each operation:

<wsdl:binding ...>
...
<wsdl:operation ...>
...
<wsdl:input ...>
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="ns" use="encoded"/>
<wsdlsoap:header encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="ns" use="encoded" parts="parm1 parm2"/>
</wsdl:input>
</wsdl:operation>
</wsdl:binding>


What I would like to know is:

1. Is there any way to do what I want to do using WSDD?
2. If no, is my approach valid?
3. Should I be modifying the WSDL in any other way, in particular to specify that the header elements are mandatory?


Thanks,
Dan.

begin:vcard
fn:Dan Ciarniello
n:Ciarniello;Dan
org:CityXpress Corp
adr;dom:;;200 - 1727 West Broadway;Vancouver;BC;V6J 4W5
email;internet:[EMAIL PROTECTED]
title:Software Developer
tel;work:604-638-3800 ext. 322
x-mozilla-html:TRUE
url:http://www.cityxpress.com
version:2.1
end:vcard

Reply via email to