Fred,
WSDL describes soap message headers using the “message/part” element.
Let’s say you had a CreateOrder service that defined a message called CreateOrderRequestMessage (and also a CreateOrderResponseMessage). The CreateOrderRequestMessage might be defined with a single part initially like this:
[highlight=XML]
[/highlight]
To add a part representing a Security element in the soap header you could do the following assuming you had imported a definition for the wsse:Security element:
[highlight=XML]
[/highlight]
I have been using the WSDL Editor in XML Spy Enterprise Edition to create WSDL’s that use modular design with imported schemas. In a recent blog entry, Mark Griffin turned me on to the new WSDL Editor that is part of the Eclipse 3.1 Web Tools Platform 1.0.
I was able to add a message part that referenced an imported schema in the Eclipse WSDL Editor as well. The only thing I found to be problematic is that the Eclipse-based WSDL Editor did not seem to validate the WSDL adequately, but perhaps I just haven’t found that function yet.
Note: The webMethods Web Services Connector wizard does not understand how to generate code to populate soap headers. It will generate code to populate each message part, but the generated Flow will attempt to add the header to the soap body instead of the soap header. This is not correct since a soap message can only have one body element.
Fortunately, you can just replace the generated call to pub.soap.utils:addBody with a call to pub.soap.utils:addHeaderEntry with virtually the same inputs.
Regular readers will know that I don’t recommend using the web services connector. This is just another reason to avoid it.
HTH,
Mark
#soa#webMethods#API-Management