background image

Running MyUddiPing

<< getChildElements() Method | Running HeaderExample >>
<< getChildElements() Method | Running HeaderExample >>
M
Y
U
DDI
P
ING
.
JAVA
159
while (businessInfoIterator.hasNext()) {
SOAPElement businessInfo = (SOAPElement)
businessInfoIterator.next();
Iterator nameIterator =
businessInfo.getChildElements(new QName(
"urn:uddi-org:api_v2", "name"));
while (nameIterator.hasNext()) {
businessName =
(SOAPElement)nameIterator.next();
System.out.println("Company name: " +
businessName.getValue());
}
Iterator descriptionIterator =
businessInfo.getChildElements(new QName(
"urn:uddi-org:api_v2", "description"));
while (descriptionIterator.hasNext()) {
SOAPElement businessDescription =
(SOAPElement) descriptionIterator.next();
System.out.println("Description: " +
businessDescription.getValue());
}
System.out.println("");
}
}
}
Finally, the program closes the connection:
connection.close();
Running MyUddiPing
You are now ready to run MyUddiPing. The
run
target takes two arguments, but
you need to supply only one of them. The first argument is the file
uddi.prop-
erties
, which is supplied by a property that is set in
build.properties
. The
other argument is the first letters of the name of the business for which you want
to get a description, and you need to supply this argument on the command line.
Note that any property set on the command line overrides any value set for that
property in the
build.xml
file.
Use a command like the following to run the example:
asant run -Dbusiness-name=the