32 Testing and Monitoring Web Services

This chapter introduces you to the tools available for developing and administering WebLogic Web services.

This chapter includes the following topics:

Testing Web Services

You can test basic and advanced features of your Web service, such as security, quality of service (QoS), HTTP headers, and so on. You can also perform stress testing of the security features. For information about testing Web services using the Web Services Test Client or Fusion Middleware Control Test Web Service page, see "Testing Web Services" in Administering Web Services.

Monitoring Web Services and Clients

You can monitor runtime information for Web services and clients, such as number of invocations, errors, faults, and so on, using the Administration Console or WLST.

The following naming convention is used to identify the Web service or client in the monitoring pages:

<application_name>#<application_version>!<service_name><contextpath><url_pattern>

Where:

Monitoring Web Services

To monitor a Web service using the Administration Console, click on the Deployments node in the left pane and in the Deployments table that appears in the right pane, locate the Enterprise application in which the Web service is packaged. Expand the application by clicking the + node; the Web services in the application are listed under the Web Services category. Click on the name of the Web service and click the Monitoring tab.

Alternatively, click the Deployments node in the left pane, the Monitoring tab that appears in the right pane, and then the Web Service tab. Click on the name of the Web service for which you want to view monitoring statistics.

The following table lists the tabs that you can select to monitor Web service information. The pages aggregate the statistics of all the servers on which the Web service is running.

Note:

For JAX-WS Web services, the built-in Ws-Protocol operation displays statistics that are relevant to the underlying WS-* protocols. This information is helpful in evaluating the application performance.

Table 32-1 Monitoring Web Services

Click this tab . . . To view . . .

Monitoring> General

General statistics about the Web services, including total error and invocations counts.

Monitoring> Invocations

Invocation statistics, such as dispatch and execution times and averages.

Monitoring> WS-Policy

Policies that are attached to the Web service, organized into the following categories: authentication, authorization, confidentiality, and integrity.

Monitoring> Ports

Table listing the Web service endpoints (ports). The table provides a summary of information for each port. Click a port name to view more details.

Monitoring> Ports > General

General statistics about the Web service endpoint. The page displays information such as the Web service endpoint name, its URI, and its associated Web service, Enterprise application, and application module. Error and invocations counts are aggregated for all Web service endpoint operations.

Monitoring> Ports > Invocations

Invocation statistics for the Web service endpoint, such as success, fault, and violation counts.

Monitoring> Ports > Cluster Routing

Cluster routing statistics for the Web service endpoint, such as request and response, and routing failures.

Monitoring> Ports > Make Connection

MakeConnection anonymous endpoints for a Web service. For each anonymous endpoint, runtime monitoring information is displayed, such as the number of messages received, the number of messages pending, and so on. You can customize the information that is shown in the table by clicking Customize this table.

Click the name of an anonymous endpoint to view more details.

Monitoring> Ports > Reliable Message

Reliable messaging sequences for a Web service. For each reliable messaging sequence, runtime monitoring information is displayed, such as the sequence state, the source and destination servers, and so on. You can customize the information that is shown in the table by clicking Customize this table.

Click the sequence ID to view more details.

Monitoring> Ports > Reliable Message > Requests

Reliable messaging requests for a Web service. For each reliable messaging request, runtime monitoring information is displayed. You can customize the information that is shown in the table by clicking Customize this table.

Click the reliable message ID to view more details.

Monitoring> Ports > WS-Policy

Statistics related to the policies that are attached to the Web service endpoint, organized into the following categories: authentication, authorization, confidentiality, and integrity.

Monitoring> Ports > Operations

List of operations for the Web service endpoint.

For each operation, runtime monitoring information is displayed, such as the number of times the operation has been invoked since the WebLogic Server instance started, the average time it took to invoke the Web service, the average time it took to respond, and so on. You can customize the information that is shown in the table by clicking Customize this table.

Note: For JAX-WS Web services, the built-in Ws-Protocol operation displays statistics that are relevant to the underlying WS-* protocols. For example, for Web services reliable messaging, this operation captures message statistics for CreateSequence and AckRequested messages received or sent by the reliable messaging subsystem on behalf of the Web service or client. This information is helpful in evaluating the application performance.

Click the name of an operation to view more information. Click the General or Invocations tab to display general statistics or invocation statistics, respectively, for the selected operation.


Monitoring Web Service Clients

To monitor a Web service client using the Administration Console, click on the Deployments node in the left pane and, in the Deployments table that appears in the right pane, locate the Enterprise application in which the Web service client is packaged. Expand the application by clicking the + node and click on the application module within which the Web service client is located. Click the Monitoring tab, then click the Web Service Clients tab.

Alternatively, click the Deployments node in the left pane, the Monitoring tab that appears in the right pane, and then the Web Service Clients tab. Click on the name of the Web service client for which you want to view monitoring statistics.

The table provides a summary of runtime information for each Web service client. Click the client name in the table to view more information.

Note:

For JAX-WS Web services, the Web services runtime creates system-defined client instances within a Web service endpoint that are used to send protocol-specific messages as required by that endpoint. These client instances are named after the Web service endpoint that they serve with the following suffix: -SystemClient. Monitoring information relevant to the system-defined client instances is provided to assist in evaluating the application.

Table 32-2 Monitoring Web Service Clients

Click this tab . . . To view . . .

Monitoring> General

General statistics about the Web service clients, including total error and invocations counts. The page displays the Web service client name, its associated Enterprise application and application module, and context root. Error and invocations statistics are aggregated for all servers on which the Web service is running.

Monitoring> Invocations

Invocation statistics, such as dispatch and execution times and averages.

Monitoring> WS-Policy

Policies that are attached to the Web service client, organized into the following categories: authentication, authorization, confidentiality, and integrity.

Monitoring> Servers

Table listing the server on which the client is currently running. Click the client name and then use the tabs in the following steps to view more information about the Web service client on that server.

Monitoring> Servers > General

General statistics about the Web service client. The page displays information such as the Web service client port, its associated Enterprise application, and application module, context root, and so on. Error and invocations counts are aggregated for all Web service client operations.

Monitoring> Servers > Invocations

Invocation statistics for the Web service client, such as success, fault, and violation counts.

Monitoring> Servers > Cluster Routing

Cluster routing statistics for the Web service client, such as request and response, and routing failures. For more information, see Chapter 23, "Monitoring Cluster Routing Performance."

Monitoring> Servers > Make Connection

MakeConnection anonymous endpoints for a Web service client. For each anonymous endpoint, runtime monitoring information is displayed, such as the number of messages received, the number of messages pending, and so on. You can customize the information that is shown in the table by clicking Customize this table.

Click the name of an anonymous endpoint to view more details.

Monitoring> Servers > Reliable Message

Reliable messaging sequences for a Web service client. For each reliable messaging sequence, runtime monitoring information is displayed, such as the sequence state, the source and destination servers, and so on. You can customize the information that is shown in the table by clicking Customize this table.

Click the name of an anonymous endpoint to view more details.

Monitoring> Servers > WS-Policy

Statistics related to the policies that are attached to the Web service client, organized into the following categories: authentication, authorization, confidentiality, and integrity.

Monitoring> Servers > Operations

List of operations for the Web service client. For each operation, runtime monitoring information is displayed, such as average response, execution, and dispatch times, response, invocation and error counts, and so on. You can customize the information that is shown in the table by clicking Customize this table.

Click the name of an operation to view more information. Click the General or Invocations tab to display general statistics or invocation statistics, respectively, for the selected operation.


Using Work Managers to Prioritize Web Services Work and Reduce Stuck Execute Threads

After a connection has been established between a client application and a Web service, the interactions between the two are ideally smooth and quick, whereby the client makes requests and the service responds in a prompt and timely manner. Sometimes, however, a client application might take a long time to make a new request, during which the Web service waits to respond, possibly for the life of the WebLogic Server instance; this is often referred to as a stuck execute thread. If, at any given moment, WebLogic Server has a lot of stuck execute threads, the overall performance of the server might degrade.

If a particular Web service gets into this state fairly often, you can specify how the service prioritizes the execution of its work by configuring a Work Manager and applying it to the service. For example, you can configure a response time request class (a specific type of Work Manager component) that specifies a response time goal for the Web service.

The following shows an example of how to define a response time request class in a deployment descriptor:

<work-manager>
    <name>responsetime_workmanager</name>
        <response-time-request-class>
            <name>my_response_time</name>
            <goal-ms>2000</goal-ms>
        </response-time-request-class>
</work-manager>

You can configure the response time request class using the Administration Console, as described in "Work Manager: Response Time: Configuration" in Oracle WebLogic Server Administration Console Online Help.

For more information about Work Managers in general and how to configure them for your Web service, see "Using Work Managers to Optimize Scheduled Work" in Administering Server Environments for Oracle WebLogic Server.