background image

Running HeaderExample

<< Running MyUddiPing | Request Message >>
<< Running MyUddiPing | Request Message >>
160
SOAP
WITH
A
TTACHMENTS
API
FOR
J
AVA
The program output depends on the contents of the registry. For example:
Content extracted from the reply message:
Company name: The Coffee Break
Description: Purveyor of the finest coffees. Established 1950
The program will not return any results until you have run the examples in Chap-
ter 6
If you want to run MyUddiPing again, you may want to start over by deleting the
build
directory and the
.class
file it contains. You can do this by typing the fol-
lowing at the command line:
asant clean
HeaderExample.java
The example
HeaderExample.java
, based on the code fragments in the section
Adding Attributes (page 139), creates a message that has several headers. It then
retrieves the contents of the headers and prints them. The example generates
either a SOAP 1.1 message or a SOAP 1.2 message, depending on arguments
you specify. You will find the code for
HeaderExample
in the following direc-
tory:
<INSTALL>/javaeetutorial5/examples/saaj/headers/src/
Running HeaderExample
To run HeaderExample, you use the file
build.xml
that is in the directory
<INSTALL>/javaeetutorial5/examples/saaj/headers/
.
To run HeaderExample, use one of the following commands:
asant run -Dsoap=1.1
asant run -Dsoap=1.2
This command executes the
prepare
,
build
, and
run
targets in the
build.xml
and
targets.xml
files.