Java Reference
In-Depth Information
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
<passwordHeader xmlns="urn:soacookbook.saaj">s3cr3t</passwordHeader>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<tns:add xmlns:tns="urn:soacookbook.saaj">
<i>5</i>
<j>4</j>
</tns:add>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Header/>
<S:Body>
<ns2:addResponse xmlns:ns2="urn:soacookbook.saaj">
<return>9</return>
</ns2:addResponse>
</S:Body>
</S:Envelope>
All done.
This shows the SOAP envelopes for both the outgoing request and the response that the ser-
vice returns. You can see that your header value is in the right place, and your body's add
child conforms to the schema. Obviously, if you don't structure your SOAP message in con-
formance with the schema and other expectations surrounding the service, the service will not
be able to read the incoming data properly. Depending on how you messed it up, the behavior
at that point is undefined.
Here is what's printed on the server side:
Header value was: s3cr3t
i=5. j=4
This snippet from the server logs shows that you're getting the right parameters to the opera-
tion and that the service is able to read (and thereby process) the value of the header.
See Also
Adding Headers to a SOAP Request for a more in-depth discussion and alternate methods.
(There are a variety of other ways to add headers to an outgoing SOAP message.)
Search WWH ::




Custom Search