background image

MyUddiPing.java

<< Request.java Class Code | Examining MyUddiPing >>
<< Request.java Class Code | Examining MyUddiPing >>
M
Y
U
DDI
P
ING
.
JAVA
153
Iterator iterator =
soapBody.getChildElements(bodyName);
bodyElement = (SOAPBodyElement)iterator.next();
String lastPrice = bodyElement.getValue();
System.out.print("The last price for SUNW is ");
System.out.println(lastPrice);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
For
Request.java
to be runnable, the second argument supplied to the
call
method would have to be a valid existing URI, and this is not true in this case.
However, the application in the next section is one that you can run.
MyUddiPing.java
The program
MyUddiPing.java
is another example of a SAAJ client applica-
tion. It sends a request to a Universal Description, Discovery and Integration
(UDDI) service and gets back the response. A UDDI service is a business regis-
try from which you can get information about businesses that have registered
themselves with the registry service. For this example, the MyUddiPing applica-
tion is accessing a test (demo) version of a UDDI service registry. Because of
this, the number of businesses you can get information about is limited. Never-
theless, MyUddiPing demonstrates a request being sent and a response being
received.
Setting Up
The MyUddiPing example is in the following directory:
<INSTALL>/javaeetutorial5/examples/saaj/myuddiping/
Note:
<INSTALL>
is the directory where you installed the tutorial bundle.
In the
myuddiping
directory, you will find three files and the
src
directory. The
src
directory contains one source file,
MyUddiPing.java
.