5.2 Using the Web Services Test Client

Using the Web Services Test Client, you can:

  • Test basic functionality to ensure that the web service was deployed and is operating as expected.

  • Test basic authentication security.

  • Test advanced features, such as web services addressing, atomic transactions, SOAP Message Transmission Optimization Mechanism (MTOM), Fast Infoset, and Oracle Web Service Manager (OWSM) security policies.

    Note:

    For web services that use SOAP over Java Messaging Service (JMS) transport as the connection protocol, you can test only basic features.

  • View the WSDL for the web service and the imported schemas, if applicable.

  • Export and import test cases.

  • Configure Java keystores (JKS) for use in testing security.

  • Configure and use HTTP proxy settings, as required by your environment.

The following sections describe how to use the Web Services Test Client:

5.2.1 Invoking the Web Services Test Client

You can invoke the Web Services Test Client from any browser, using the web service endpoint, or using the Administration Console, as described in the following sections:

Note:

When you first invoke the Web Services Test Client, there will be a brief delay while the application deploys.

To test web services that use SOAP over JMS transport as the connection protocol, the test page must be invoked from the server on which the web service is deployed.

5.2.1.1 Invoking the Web Services Test Client From a Browser

You can invoke the Web Services Test Client from any browser by entering the following URL:

http://host:port/ws_utc

where:

  • host refers to the computer on which WebLogic Server is running.

  • port refers to the port number on which WebLogic Server is listening (default value is 7001).

When prompted, enter the login credentials for the Web Services Test Client.

The Web Services Test Client home page is invoked. To select the web service WSDL, see "Selecting the Web Service to Test" on page 5‐3.

5.2.1.2 Invoking the Web Services Test Client Using the Web Service Endpoint

You can invoke the Web Services Test Client by navigating to the web service endpoint.

  • For an Oracle Infrastructure web service, when you navigate to the web service endpoint, the Web Services Test Client is invoked with the web service WSDL selected.

  • For JAX-WS and JAX-RPC web services, an intermediary page is invoked. Click Test to invoke the Web Services Test Client with the web service WSDL selected.

When prompted, enter the login credentials for the Web Services Test Client.

To test the web service operations, see "Testing Web Service Operations" on page 5‐4.

5.2.1.3 Invoking the Web Services Test Client Using the Administration Console

To test a deployed web service using the Administration Console, follow these steps:

  1. Invoke the Administration Console in your browser using the following URL:
    http://[host]:[port]/console
    

    where:

    • host refers to the computer on which WebLogic Server is running.

    • port refers to the port number on which WebLogic Server is listening (default value is 7001).

  2. Select the web service in the Deployments table that you would like to test. For more information, see "How Web Services Are Displayed in the Administration Console" in Understanding WebLogic Web Services for Oracle WebLogic Server.
  3. Select the Testing tab and click the Test Point link next to the web service endpoint that you want to test.
  4. When prompted, enter the login credentials for the Web Services Test Client.
  5. Follow the procedure described in "Test a Web Service" in Oracle WebLogic Server Administration Console Online Help.

The Web Services Test Client is invoked with the web service WSDL selected. To test the web service operations, see "Testing Web Service Operations" on page 5‐4.

5.2.2 Selecting the Web Service to Test

From the Web Services Test Client home page, enter the WSDL corresponding to the web service that you want to test. Return to this page at anytime by selecting Choose Another WSDL.

To select the web service to test:

  1. Enter the WSDL in the Enter WSDL URL field.
  2. To use the configured HTTP proxy, click the HTTP Proxy check box.

    For information about configuring the proxy, see "Configuring an HTTP Proxy" on page 5‐11.

  3. Click Test.

Alternatively, you can select a WSDL that was previously loaded from the WSDL list. To toggle the list, click Show WSDL List or Hide WSDL List.

The web service operations that are available to test are displayed. For more information, see "Testing Web Service Operations" on page 5‐4.

5.2.3 Testing Web Service Operations

To test a web service operation:

  1. Select the web service operation to test using one of the following methods:
    • Select the operation in the Operations pane.

    • With the web service port folder selected in the Operations pane, click Test associated with the web service operation that you want to test.

  2. Enter a value for each of the parameters in the Parameters section.

    Required parameters are identified using Required operation icon..

    For information about editing the XML source, see "Editing the Input Arguments as XML Source" on page 5‐12.

  3. Configure the basic settings for the test client, such as the endpoint URL, basic authentication settings, encoding and binding types, and whether or not you want to use the configured HTTP proxy. For information, see "Configuring Basic Test Settings" on page 5‐4.
  4. Test the advanced features of your web service by configuring settings (as applicable), as described in "Testing Advanced Web Service Features and Security" on page 5‐5.

    Ensure that the advanced feature settings are compatible with the web service endpoint that you are testing. If they are not, the test will fail and the stack error displays in the Test Results section.

    Note:

    For web services that use SOAP over JMS transport as the connection protocol, you can test only basic features.

  5. Click Invoke.

The Test Results section is displayed at the bottom of the content area, displaying the SOAP request and response messages. If the test fails, the stack error information is displayed in the Test Results section.

5.2.4 Configuring Basic Test Settings

You can configure basic settings for the Web Services Test Client, including the username and password for basic authentication, by clicking the Basic Settings tab in the Settings section, setting the values defined in Table 5–1, and clicking Invoke to invoke the web service.


Table 5-1 Basic Test Client Settings

Setting Description

Endpoint URL

Override the web service endpoint address.

User Name

Username to use for testing basic authentication.

Note: You configure the JKS keystores, as described in "Configuring the JKS Keystores" on page 5‐11

Password

Password to use for testing basic authentication.

Note: You configure the JKS keystores, as described in "Configuring the JKS Keystores" on page 5‐11

Encoding

Encoding standard. Valid values include: UTF-8 and UTF-16.

BindingType

Binding type. Valid values include:

  • SOAP Binding—Standard SOAP web service.

  • REST/HTTP Binding—SOAP over HTTP using the invoke() method of the javax.xml.ws.Provider<T> interface.

HTTP Proxy

Flag that specifies whether the HTTP proxy is enabled. You can configure the global HTTP proxy setting, as described in "Configuring an HTTP Proxy" on page 5‐11.

Note: This setting is available in development mode only.


5.2.5 Testing Advanced Web Service Features and Security

To test the advanced features of a web service, refer to the following sections:

Note:

For web services that use SOAP over JMS transport as the connection protocol, you can test only basic features.

5.2.5.1 Testing Addressing

WS-Addressing provides a transport-neutral mechanism to address web services and their associated messages. Using WS-Addressing, endpoints are uniquely and unambiguously defined in the SOAP header. For more information, see "Using Web Services Addressing" in Developing JAX-WS Web Services for Oracle WebLogic Server.

You can test WS-Addressing, if enabled on the web service, by clicking the Addressing tab in the Settings section, setting the values defined in Table 5–2, and clicking Invoke to invoke the web service.


Table 5-2 Test Settings for WS-Addressing

Setting Description

Enabled

Flag that specifies whether WS-Addressing is enabled on the Web Service Test Client.

Version

WS-Addressing version. Valid values include:

ReplyTo

Type of the ReplyTo header. Valid values include: anonymous, non-anonymous, and Addressing None.

FaultTo

Type of the FaultTo header. Valid values include: anonymous, non-anonymous, and Addressing None.


5.2.5.2 Testing Atomic Transactions

web services enable interoperability with other external transaction processing systems, such as Websphere, Microsoft .NET, and so on, through the support of the following specifications:

For more information about web services atomic transactions, see "Using Web Services Atomic Transactions" in Developing JAX-WS Web Services for Oracle WebLogic Server.

You can test atomic transactions, if enabled on the web service, by clicking the Atomic Transaction tab in the Settings section, setting the values defined in Table 5–4, and clicking Invoke to invoke the web service.


Table 5-3 Test Settings for Atomic Transactions

Setting Description

Enabled

Flag that specifies whether atomic transactions are enabled on the Web Service Test Client.

Version

Version of the web services atomic transaction coordination context that is used for the Web Service Test Client. Valid values include: default, wsat, wsat11, and wsat12. The default value for web service clients is wsat (equivalent to WS-AT 1.0).

Transaction Flow Type

Flag that specifies whether the web services atomic transaction coordination context is passed with the transaction flow. For information about setting this value, see "Enabling Web Services Atomic Transactions on Web Services" in Developing JAX-WS Web Services for Oracle WebLogic Server.

Action After Invocation

Action required after invocation. Valid values include commit or rollback the transaction.


5.2.5.3 Testing MTOM

SOAP Message Transmission Optimization Mechanism/XML-binary Optimized Packaging (MTOM/XOP) defines a method for optimizing the transmission of XML data of type xs:base64Binary or xs:hexBinary in SOAP messages. When the transport protocol is HTTP, Multipurpose Internet Mail Extension (MIME) attachments are used to carry that data while at the same time allowing both the sender and the receiver direct access to the XML data in the SOAP message without having to be aware that any MIME artifacts were used to marshal the base64Binary or hexBinary data.

For more information about MTOM, see:

You can test MTOM, if enabled on the web service, by clicking the MTOM tab in the Settings section, setting the values defined in Table 5–5, and clicking Invoke to invoke the web service.


Table 5-4 Test Settings for MTOM

Setting Description

Enabled

Flag that specifies whether MTOM is enabled on the Web Service Test Client.

Threshold

Attachment threshold (in bytes) that specifies whether xs:binary64 data is sent inline or as an attachment. This value defaults to 0 (all data is sent as an attachment).


5.2.5.4 Testing Fast Infoset

Fast Infoset is a compressed binary encoding format that provides a more efficient serialization than the text-based XML format. For more information about Fast Infoset, see

You can test Fast Infoset, if enabled on the web service, by clicking the Fast Infoset tab in the Settings section, setting the values defined in Table 5–6, and clicking Invoke to invoke the web service.


Table 5-5 Test Settings for Fast Infoset

Setting Description

Enabled

Flag that specifies whether atomic transactions are enabled on the Web Service Test Client.

Negotiation Type

Negotiation strategy. Valid values include:

  • none—No negotiation strategy.

  • optimistic—Client assumes that Fast Infoset is enabled.

  • pessimistic—Initial client request, Fast Infoset is not enabled. Subsequent requests will use Fast Infoset if enabled on the service.

For more information about the content negotiation strategy, see:

  • JAX-WS: "Configuring the Content Negotiation Strategy" in Developing JAX-WS Web Services for Oracle WebLogic Server.

  • Oracle Infrastructure Web Services: "Configuring the Content Negotiation Strategy" in Developing Oracle Infrastructure Web Services.


5.2.5.5 Testing OWSM Security Policies

You can test OWSM security policies by clicking the OWSM tab in the Settings section, setting the values defined in Table 5–8, and clicking Invoke to invoke the web service.

Note:

For Java EE web services, this tab is available only if you have OWSM installed.

Only a subset of the OWSM predefined policies is available, and you can configure only the attributes presented for those policies. All of the other policy attributes use only the policy defaults.

This means that copies you made of the predefined policies are not available. It also means that you cannot enable Secure Conversation, change the message security algorithm suite, and so forth.


Table 5-6 Test Settings for OWSM

Setting Description

Enabled

Flag that specifies whether OWSM policies are enabled on the Web Service Test Client.

Policies

Select the policies that you want to test on the client by selecting the associated check box. You can test only a subset of security policies.

Note: For the policy selected, you must configure the required properties below. Otherwise, an exception is thrown.

Username

Username used for basic authentication.

Password

Password used for basic authentication.

Keystore Location

Location of the keystore file. Click Choose File to navigate to the file in your local directory, which is typically in DOMAIN_HOME\domain_name\config\fmwconfig.

Remote Keystore Location

Location of the remote keystore. If not specified, the keystore local to the server is used.

Keystore Password

Password used for keystore access.

Encryption Key Alias

Alias of the key within the keystore that will be used to decrypt the response from the service. This property is not used in WSS11 policies.

Encryption Key Password

Password for the key within the keystore that will be used for decryption. This property is not used in WSS11 policies.

Signature Key Alias

Alias of the key within the keystore that is used for digital signatures. For WSS11 policies, this property is used for mutual authentication only.

Signature Key Password

Password for the alias of the key within the keystore that is used for digital signatures.

Recipient Key Alias

Alias for the recipient's public key that is used to encrypt type outbound message.

SAML Audience URI

Relying party, as a comma-separated URI. This property accepts wildcards.

SAML Issuer Name

SAML issuer name to use when trying access a service that is protected using SAML mechanism.

Include User Roles

User roles in a SAML assertion.

Attesting Mapping Attribute

Mapping attribute used to represent the attesting entity. Only the DN is currently supported. This attribute is applicable only to sender vouches message protection use cases. It is not applicable to SAML over SSL policies.


5.2.6 Viewing the WSDL and Imported Schemas

To view the WSDL for the current web service, click WSDL.

To view the imported WSDL and schemas, click Imported WSDL and Schema. From the dialog box, click the imported file that you wish to view. Click x in the upper right corner to close the dialog box.

5.2.7 Configuring the Web Services Test Client

Note:

Configuration settings are available in development only.

You can configure the Web Services Test Client to define an HTTP proxy, set the default working directory, or define a Java Keystore (JKS), as described in the following sections:

5.2.7.1 Configuring an HTTP Proxy

You configure an HTTP proxy for your Web Services Test Client on the General Settings page.

To configure an HTTP proxy:

  1. Click settings icon in the upper-right corner of the Web Services Test Client.
  2. Click General in the navigation pane.
  3. Enter the proxy host in the Http Proxy Host field.
  4. Enter the proxy port in the Http Proxy Port field.
  5. Click Submit.

5.2.7.2 Configuring the JKS Keystores

You configure the JKS keystores that are associated with the OWSM security policies that you are testing on the Web Services Test Client Security Settings page.

For more information about defining the JKS keystores on WebLogic Server, see "How to Configure a JKS Keystore on WebLogic Server" in Securing Web Services and Managing Policies with Oracle Web Services Manager.

To configure the Java Keystores (JKS):

  1. Click settings icon in the upper-right corner of the Web Services Test Client.

  2. Click Security in the navigation pane.

  3. To add a new JKS keystore:

    1. Click Add.

    2. Enter a name for the JKS keystore in the Setting Name field.

    3. Enter the password for the JKS keystore in the Keystore Password field.

      Note:

      Defining the password for the JKS keystore in a production environment is not recommended.

    4. Enter the path to the file in the Keystore File field, or click Choose File to navigate to the file in your local directory.

    5. Click Submit.

  4. To edit or delete an existing JKS keystore:

    1. Click Edit.

    2. To delete a JKS keystore, click delete icon.

    3. To edit a JKS keystore, click edit icon, edit the fields, and click Submit Edit.

    4. To exit edit mode, click Cancel Edit.

5.2.7.3 Configuring the Default Working Directory

You can configure the default working directory for the Web Services Test Client. By default, the working directory is set to the following subdirectory within the domain directory:

<domain-directory>/tmp/WSTestPageWorkDir

To configure the default working directory:

  1. Click settings icon in the upper-right corner of the Web Services Test Client.
  2. Click General in the navigation pane.
  3. Edit the Current Working Home field to reflect the desired working home directory.
  4. Click Submit.

5.2.8 Editing the Input Arguments as XML Source

You can view the input arguments in a user-friendly form, or you can edit the XML source code directly. If you edit the XML source directly, you must enter valid XML. To view the input argument as XML, click Raw Message. To toggle back to the user-friendly form, click Form Entry.

5.2.9 Viewing the History

Note:

The Invocation History pane displays only after you invoke your first test operation and is available in development mode only.

You can view the results for tests executed previously within the current session by clicking on the operation in the Invocation History pane. Failed test instances appear in red in the Invocation History pane.

5.2.10 Exporting and Importing Test Cases

Note:

This feature is available in development mode only.

You can export individual test cases from the Web Services Test Client and then import them into another test environment, as described in the following sections:

5.2.10.1 Exporting a Test Case

To export a test case, click export test case in the upper-right corner of the Web Services Test Client. The test case is saved as an XML file using the following filename: ws-testcase.xml. If you save multiple test cases, a suffix is added to the filename as follows: ws-testcase(n).xml, where n is incremented each time a new test case is saved.

5.2.10.2 Importing a Test Case

To import a text case:

  1. Click import test case in the upper-right corner of the Web Services Test Client.
  2. Click Choose File.
  3. Navigate to the test case file, and click Open.

    Click Import.

5.2.11 Enabling and Disabling the Web Services Test Client

In a development environment, the Web Services Test Client is enabled, by default. In a production environment, the Web Services Test Client is disabled (and undeployed), by default.

You can enable or disable the Web Services Test Client in one of the following ways:

  • Using the Administration Console, as described below.

  • Using Fusion Middleware Control at the domain or web service endpoint level, as described in "Enabling or Disabling the Web Services Test Client Using Fusion Middleware Control" on page 4‐25.

  • Using WLST, as described in "Enabling or Disabling the Web Services Test Client Using WLST" on page 4‐58.

You should disable the Web Services Test Client to increase security by reducing the externally visible details of an application that exposes web services.

Note:

It is recommended that you not enable the Web Services Test Client in production mode. For information about production mode, see "Domain Modes" in Understanding Domain Configuration for Oracle WebLogic Server.

To enable or disable the Web Services Test Client at the domain level using the Administration Console:

  1. Invoke the Administration Console, as described in "Accessing Oracle WebLogic Administration Console" on page 2‐2.
  2. Click Domain in the Domain Configurations section of the console home page.
  3. Select Configuration > General to display the general configuration options for the domain.
  4. Click Advanced to view the advanced configuration settings.
  5. Toggle the Enable Web Service Test Page configuration flag to enable or disable the Web Services Test Client.
  6. Click Save.
  7. Restart the server so that the configuration settings take effect.

    When enabling the Web Service Test Client in a production environment, the client will be deployed when you restart the server.

5.2.12 Logging Out of the Web Services Test Client

You can log out of the Web Services Test Client at any time by clicking Logout button. in the upper-right corner of the Web Services Test Client.