background image

DOMExample.java

<< Request Message | Examining DOMExample >>
<< Request Message | Examining DOMExample >>
162
SOAP
WITH
A
TTACHMENTS
API
FOR
J
AVA
<ns:confirmationDesk xmlns:ns="http://gizmos.com/NSURI"
env:mustUnderstand="true"
env:role="http://gizmos.com/confirmations"/>
<ns:billingDesk xmlns:ns="http://gizmos.com/NSURI"
env:relay="true" env:role="http://gizmos.com/billing"/>
</env:Header><env:Body/></env:Envelope>
Header name is {http://gizmos.com/NSURI}orderDesk
Role is http://gizmos.com/orders
mustUnderstand is false
relay is false
Header name is {http://gizmos.com/NSURI}shippingDesk
Role is http://gizmos.com/shipping
mustUnderstand is false
relay is false
Header name is {http://gizmos.com/NSURI}confirmationDesk
Role is http://gizmos.com/confirmations
mustUnderstand is true
relay is false
Header name is {http://gizmos.com/NSURI}billingDesk
Role is http://gizmos.com/billing
mustUnderstand is false
relay is true
DOMExample.java and
DOMSrcExample.java
The examples
DOMExample.java
and
DOMSrcExample.java
show how to add a
DOM document to a message and then traverse its contents. They show two
ways to do this:
·
DOMExample.java
creates a DOM document and adds it to the body of a
message.
·
DOMSrcExample.java
creates the document, uses it to create a
DOMSource
object, and then sets the
DOMSource
object as the content of the message's
SOAP part.
You will find the code for DOMExample and DOMSrcExample in the following
directory:
<INSTALL>/javaeetutorial5/examples/saaj/dom/src/