background image

Running DOMExample and DOMSrcExample

<< Examining DOMSrcExample | Creating an AttachmentPart Object >>
<< Examining DOMSrcExample | Creating an AttachmentPart Object >>
DOME
XAMPLE
.
JAVA AND
DOMS
RC
E
XAMPLE
.
JAVA
165
Running DOMExample and DOMSrcExample
To run DOMExample and DOMSrcExample, you use the file
build.xml
that is
in the directory
<INSTALL>/javaeetutorial5/examples/saaj/dom/
. This
directory also contains several sample XML files you can use:
·
domsrc1.xml
, an example that has a SOAP header (the contents of the
HeaderExample
output) and the body of a UDDI query
·
domsrc2.xml
, an example of a reply to a UDDI query (specifically, some
sample output from the MyUddiPing example), but with spaces added for
readability
·
uddimsg.xml
, similar to
domsrc2.xml
except that it is only the body of the
message and contains no spaces
·
slide.xml
, another file that consists only of a body but that contains
spaces
You can use any of these four files when you run DOMExample. To run
DOMExample, use a command like the following:
asant run-dom -Dxml-file=uddimsg.xml
When you run DOMExample using the file
uddimsg.xml
, you will see output
that begins like the following:
Running DOMExample.
Name is {urn:uddi-org:api_v2}businessList
Attribute name is generic
Attribute value is 2.0
Attribute name is operator
Attribute value is www.ibm.com/services/uddi
Attribute name is truncated
Attribute value is false
Attribute name is xmlns
Attribute value is urn:uddi-org:api_v2
...
You can use either
domsrc1.xml
or
domsrc2.xml
to run DOMSrcExample. To
run DOMSrcExample, use a command like the following:
asant run-domsrc -Dxml-file=domsrc2.xml