In previous versions of the workbench, web services could
be tested with a sample JSP or with the web services Explorer. New
in this release is the Generic Service Client, which allows testing
of a greater variety of web services than other testing mechanisms
- such as JMS web services or secured web services.
The purpose of the generic service client is to invoke calls to
any kind of service that uses an HTTP, JMS or WebSphere® MQ transport
and to view the message returned by the service. The generic service
client is useful for debugging or testing a service when you do not
have access to a dedicated client to invoke the service call. You
can set up a large variety of transport and security configurations
for the service, edit the parameters of the call and send attachments.
This topic provides an overview of how to use the generic service
client to test web services. For more detailed information, refer
to: Sending service requests with the generic service client.
Supported services
The generic service client
enables you to invoke requests for many types of services that use
the following transport protocols:
- HTTP
- Java™ Message Service (JMS),
including JBoss and WebSphere® implementations
- WebSphere MQ
The Generic Service Client does not support testing secured web
services at this time.
Watch a demonstration of the Generic
Service Client being used to test a web service: Testing web services with the Generic Service Client
Launching the generic service client
You
can launch the Generic Service Client in the following ways:
- Right-click a WSDL file in the Enterprise Explorer view and select
- Right-click a service node in the Services view and select Test
with Generic Service Client
- From the Run menu select Launch the Generic Service
Client
- In the web services wizards, select the Generic Service Client
as your test facility. You can also set it as your default test facility
in the web services Preferences.
- Click the Launch the Generic Service Client toolbar
button:
Invoking the generic service client from a WSDL file
Prerequisite:- Ensure that you have a valid WSDL file in your workspace (as opposed
to a dynamically generate WSDL file as is supported in JAX-WS web
services). Ensure that the WSDL files use the correct syntax for the
test environment. The generic service client might not work with some
web Services Description Language (WSDL) files.
To invoke a service call based on a WSDL file:
- Launch the generic service client using one of the methods listed
above, and add the WSDL file to it if necessary. This will add the
WSDL file to the Call Library.
- In the Call Library, expand the WSDL, binding, and operation,
and then select the call element. The call is automatically configured
with any SOAP or JMS endpoints that are available in the WSDL. The
generic service client shows 3 steps: Edit Data, Invoke and View
Response. The details for the call are displayed under
the Edit Data step.
- On the Message page, use the Form, Tree,
or Source views to edit the contents of the call. Each view proposes
a different display of the same data. If you want to add or remove
XML elements in the Form or Tree view, you can click to comply with an XML Schema Definition (XSD) specified
in the Schema Catalog.
- On the Attachments page, specify any file
attachments that will be sent with the call. You must have configured
the environment with the correct libraries and configuration files
to handle file attachments.
- On the Transport page, specify an HTTP,
JMS, or WebSphere MQ transport
configuration to be used by the call. You can create and edit transport
and security configurations by clicking the Transport tab.
- On the Security for Request and Security
for Response pages, specify whether you want to override
the security settings for the WSDL. If you want to edit the current
security settings for the WSDL, click Edit WSDL Security to
open the WSDL Security Editor.
- When you are ready, click Invoke to invoke
the service call. The generic service client sends the request and
displays the message return under the View Response step.
Limitations:
Certain functions within the
generic service client, for example the ability to record tests, require
that Rational® Performance
Tester or Rational Service
Tester be installed.
Arrays are not supported.
Because
of a lack of specification, attachments are not supported with the Java Message Service (JMS) transport.
The envelope is directly sent using UTF-8 encoding.
All security
algorithms are not always available for every Java Runtime Environment (JRE) implementation.
If a particular security implementation is not available, add the
required libraries to the class path of the JRE that this product
uses.
The generic service tester displays the envelope as reflected
in the XML document. However, security algorithms consider the envelope
as a binary. Therefore, you must set up the SOAP security configuration
so that incoming and outgoing messages are correctly encrypted but
remain decrypted inside the test.