Skip Headers
Oracle® Fusion Middleware Security and Administrator's Guide for Web Services
11g Release 1 (11.1.1)

Part Number B32511-06
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

12 Testing Web Services

This chapter includes the following sections:

Testing Your Web Services

This section describes how to use the Fusion Middleware Control Test Web Service page to verify that you are receiving the expected results from the Web service.

The Test Web Service page allows you to test any of the operations exposed by a Web service. You can test Web services that are deployed on any accessible host; the Web service does not have to be deployed on this host.

Note:

The Test Web Service page can parse WSDL URLs that contain ASCII characters only. If the URL contains non-ASCII characters, the parse operation fails. To test a Web service that has non-ASCII characters in the URL, allow your browser to convert the WSDL URL and use the resulting encoded WSDL URL in the Test Web Service page.

When testing Web services that use policies, the Oracle WSM component must be installed in the same domain from which Fusion Middleware Control is being run. Otherwise, an invalid policy exception will be returned.

You can navigate to the Test Web Service page in many ways. This section describes one typical way to do so.

To test your Web service

  1. In the navigator pane, expand WebLogic Domain to show the domain in which you want to test a Web service.

  2. Select the domain.

  3. From the WebLogic Domain menu, select Web Services, and then Test Web Service. The Test Web Service input page appears.

  4. Enter the WSDL of the Web service you want to test and click Parse WSDL. If you do not know the WSDL, click the search icon and select from the registered Web services, if any.

    If the WSDL is secured with HTTP Basic Authentication, click HTTP Basic Auth Option for WSDL Access and enter the username and password before parsing the WSDL.

    The Test Web Service page appears as shown in Figure 12-1. Note that the test option sections are collapsed by default.

    Figure 12-1 Test Web Service Page in Collapsed View

    Description of Figure 12-1 follows
    Description of "Figure 12-1 Test Web Service Page in Collapsed View"

  5. Select the service and port to be tested. If the WSDL has multiple services and ports, these fields are available as drop-down menus. If the WSDL has only one service and port, these fields are read-only, as shown in Figure 12-1.

  6. Select the operation that you want to test from the Operation menu. The available operations are determined from the WSDL.

    To test a RESTful Web service, select the GET or POST service port operations.

  7. If you want to change the endpoint URL of the test, click Edit Endpoint URL and make the change.

  8. Select the Request tab if it is not already selected.

  9. Expand the test option sections by clicking the plus sign (+) next to the section name. The expanded view of the Test Web Service page is shown in Figure 12-2.

    Figure 12-2 Bottom Portion of Test Web Service Page in Expanded View

    Description of Figure 12-2 follows
    Description of "Figure 12-2 Bottom Portion of Test Web Service Page in Expanded View"

  10. In the Security section, select the security token to verify. The security setting is not determined from a policy in the WSDL; you can specify the type of token you want to test. The default is None. Depending on the option selected, additional fields are displayed. If you do specify a username and password, they must exist and be valid for the WebLogic Server. For more information, see "Enabling Authentication".

    When testing RESTful Web services, because the SOAP protocol is not used, the only security options are HTTP Basic Authentication or None.

  11. In the Quality of Service section, specify whether you want to explicitly test a Reliable Messaging (WS-RM), WS-Addressing, or MTOM policy. For details about the options available, see "Enabling Quality of Service Testing".

    Note:

    This section is not available when testing RESTful Web services.
  12. In the HTTP Transport section, the test mechanism uses the WSDL to determine whether a SOAP action is available to test. If available, specify whether you want send the request with the SOAP action HTTP header. For more information, see "Enabling HTTP Transport Options".

    Note:

    This section is not available when testing RESTful Web services.
  13. In the Additional Test Options section, select the Enable Stress Test option if you want to invoke the Web service multiple times simultaneously. If you select this option, you can also provide values for the stress test options, or accept the defaults. For more information, see "Stress Testing the Web Service Operation".

  14. In the Input Arguments section, enter the input arguments for the Web service in the Value fields. The parameters and type, and the required input values, are determined from the WSDL.

    Select Tree View or XML View to toggle between a hierarchical list of input parameters and the XML content.

  15. Click Test Web Service to initiate the test.

    The test results appear in the Response tab upon completion.

    If the test is successful, the Test Status field indicates Request Successfully received and the response time is displayed, as shown in Figure 12-3.

    Note:

    When running SOA composite tests, the Response tab will indicate whether a new composite was generated. You can also click the Launch Flow Trace button to open the Flow Trace window, where you can view the flow of the message through various composite and component instances.

    Figure 12-3 Successful Test

    Description of Figure 12-3 follows
    Description of "Figure 12-3 Successful Test"

    If the test fails, an error message is displayed. For example, Figure 12-4 shows an error resulting from a type error in the var-Int parameter. In this particular instance, string data was entered when an int was expected.

    Note:

    The results on the Response tab are a simplified version of the standard Web service results.
  16. Figure 12-4 Data Validation Error

    Description of Figure 12-4 follows
    Description of "Figure 12-4 Data Validation Error"

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. Use the drop-down list in the Input Arguments section of the page to toggle between Tree View and XML View.

Enabling Authentication

You can use the Test Web Service Page to test policies that use username tokens to authenticate users.

Note:

Only policies that expect a username and password are supported by the test function, including custom policies. Policies that require certificates or other tokens are not supported. You cannot use this page to test a Web service with a message protection policy.

The security setting is not determined from a policy in the WSDL; you can specify the type of token you want to test. The default is None. If you do specify a username and password, they must exist and be valid.

The password must be passed in plain text. Authentication credentials may be supplied in the request by selecting one of the options in the Security section of the page (Figure 12-5). Select one of the following:

Note:

When testing RESTful Web services, because the SOAP protocol is not used, the only security options are HTTP Basic Authentication or None.

Figure 12-5 Security Parameters on the Web Services Test Page

Description of Figure 12-5 follows
Description of "Figure 12-5 Security Parameters on the Web Services Test Page"

Enabling Quality of Service Testing

Note:

This section is not applicable when testing RESTful Web services.

Three characteristics of Quality of Service (QoS) can be tested: reliable messaging (WS-RM), WS-Addressing, and Message Transmission Optimization Mechanism (MTOM) in the Quality of Service section of the Test Web Service Page (Figure 12-6). For each type of Quality of Service, there are three options:

Figure 12-6 Quality of Service Parameters on the Test Web Service Page

Description of Figure 12-6 follows
Description of "Figure 12-6 Quality of Service Parameters on the Test Web Service Page"

Enabling HTTP Transport Options

Note:

This section is not applicable when testing RESTful Web services.

The test mechanism uses the WSDL to determine whether a SOAP action is available to test. If the WSDL soap:operation has a soapAction attribute, then this is displayed and Enable SOAP Action is enabled.

When a request is sent with Enable SOAP Action enabled, then the SOAP action HTTP header is sent.

To change this behavior, clear the Enable SOAP Action box, in which case the HTTP header is not sent. Or, you can override the behavior by providing a different value in the SOAP Action field. (You must already know the SOAP action that you want to test, and the syntax.)

Figure 12-7 HTTP Transport Options on the Test Web Service Page

Description of Figure 12-7 follows
Description of "Figure 12-7 HTTP Transport Options on the Test Web Service Page"

Stress Testing the Web Service Operation

Select the Enable Stress Test check box (Figure 12-8) to invoke a continuous series of invocations of the Web service operation (Figure 12-8). The following options are available:

When you invoke the test, a progress box indicates the test status. When the stress test is complete, a confirmation page displays the results of the test.

The Response tab provides additional information about the stress test, including the number of tests with errors, and the average, minimum, and maximum response times. Details about each test are provided in tabular form. For each test, you can view the thread and loop numbers, the duration of the test, the start and end times for the test, and the invocation status. You can filter the fields displayed in the table using the View menu.

Figure 12-9 Stress Test Results on Test Web Service Page

Description of Figure 12-9 follows
Description of "Figure 12-9 Stress Test Results on Test Web Service Page"

Disabling the Test Page for a Web Service

Note:

This section does not apply to Java EE Web services.

Disabling the test page for a Web service allows you to increase security by reducing the externally visible details of an application that exposes Web services.

Note:

Disabling the Endpoint Test Enabled control affects only the Web service's externally-visible test page. It does not affect the Web service test feature described in this chapter.

To disable the Test Page using Fusion Middleware Control

  1. Navigate to the Web Services summary page, as described in "Navigating to the Web Services Summary Page for an Application".

  2. In the Web Service Details section of the page, click on the plus (+) for the Web service to display the Web service ports if they are not already displayed.

  3. Click the name of the port to navigate to the Web Service Endpoint page.

  4. Click the Configuration tab.

  5. In the Endpoint Test Enabled field, select False from the list.

  6. Click Apply.