Testing a Web service using the Data Web Services Test Client without IBM Data Studio
One of
the main benefits of the Data Web Services Test Client is that it can be
launched and used to test your Web services independently of the IBM Data Studio IDE.
To launch
the Data Web Services Test Client from a Web browser without a local
copy of IBM Data Studio installed, enter the
URL of your application server and the Web service of the form: http://server:port/context_root.
The server keyword is the hostname (or IP
address) of the application server. In this series, since Ive assumed youve
installed IBM WebSphere Application Server
Community Edition on your local machine, you can just use localhost to represent the IP address or
hostname of your server.
The port keyword is the port number that
the application server is listening on for incoming requests. We defined this
when we configured the target application server in the Servers tab in Part
11 Transforming Business Logic into a Web Services.
If you
dont remember this port number, in the Servers tab, select that target
application server, right-click, and select Open, as shown below:
The Server Overview window opens:
The HTTP Port field in the Port Configuration
section shows the port that this application server is listening on; the
default port number that IBM WebSphere Application Server Community
Edition (Application Server/CE) listens on is port 8080.
In the Security
section, you can see the default user ID and password for the target
installation for Application Server/CE. Use this user account information to
log into Application Server/CE and manage the application server itself using the
built-in link to the application servers management console. To launch this
console, select the application server, right-click, and select Launch
Community Edition Console:

The context_root keyword is a string that
represents the data development project name, the name of the Web services
project, and the name of the Data Web Services Test Client Web page. In this
series, the name of the data development project is DatabaseJournalProjectSOA,
the name of the Web service built is SOA_FEMALEPERSONNEL, and the Data
Web Services Test Client application resides in the TestClient folder
and is called testClient.html. Therefore, to launch the Data Web
Services Test Client directly from any Web browser, in our example, you would
enter the following URL: http://localhost:8080/DatabaseJournalProjectSOA_FEMALEPERSONNEL/TestClient/testClient.html as shown below:
At this
point, just follow the steps outlined in this article to test the Web service;
after all, its the same rich testing application that you used within IBM Data
Studio.
Wrapping it all up
In this
article, I showed you a richer testing interface provided by the IBM Data Web Services component called the Data Web
Services Test Client. This client provides a richer and more user-friendly
environment for testing your Web services. As I showed you, the Data Web
Services Test Client can be launched from within IBM Data Studio or externally from a Web browser, with no
installation of IBM Data Studio required. In the next
article, were going to create a more complex Web service to introduce you to
the Extensible Stylesheet Language Transformation (XSLT) capabilities of IBM Data Studio; I will show you how to transform the
XML output from the Web services tested thus far into a format used for a
target application.
»
See All Articles by Columnist Paul C. Zikopoulos
Trademarks
IBM, DB2, and WebSphere are registered trademarks of
International Business Machines Corporation in the United States, other
countries, or both.
Linux is a registered trademark of Linus Torvalds in the United
States, other countries, or both.
Other company, product, or service names may be trademarks
or service marks of others.
Copyright International Business Machines Corporation, 2008.
Disclaimers
The opinions, solutions, and advice in this article are from
the authors experiences and are not intended to represent official
communication from IBM or an endorsement of any products listed within. Neither
the author nor IBM is liable for any of the contents in this article. The
accuracy of the information in this article is based on the authors knowledge
at the time of writing.