Skip Headers
Oracle® Application Server Web Services Developer's Guide
10g Release 3 (10.1.3)
B14434-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

12 Testing Web Service Deployment

This chapter provides information on how to test if your Web Service deployed successfully. You can do this by either accessing the Web service by using the Web Service Home Page or by accessing the WSDL by using the Web service URL.


Note:

The Web Services Page in the Application Server Control tool lists all of the available Web Services, and links to their Home Pages. For more information, see the topic "Web Services Page" in the Application Server Control on-line help.

Using the Web Services Home Page

Oracle Application Server Web Services provides a Web Service Home Page for each deployed Web service. The Home Page can be used for either JAX-RPC Web services or REST services.

How to Access the Web Services Home Page

To access a Home Page, enter the address of a service endpoint in a Web browser. The address has the format:

http://host:port/context-root/service

Table 12-1 describes the components of the address.

Table 12-1 URL Components for Accessing the Home Page

URL Component Description

context-root

The value specified in the <context-root> element for the web module associated with the Web service. See the META-INF/application.xml in the Web service's EAR file to determine this value.

host

The host name of the Web service's server running OracleAS Web Services.

port

The port name of the Web service's server running OracleAS Web Services.

service

The value specified in the <url-pattern> element for the servlet associated with the Web service. This is the service name. See the WEB-INF/web.xml file in the Web service's WAR file to determine this value.


How to Use the Web Services Home Page

The following steps describe how to access and use the functionality in the Web Services Home Page.

  1. Enter the address of the service endpoint in a Web browser.

    The Web Service Home Page for the service appears in the browser. Figure 12-1 illustrates a sample Home Page. For more information on how to perform this step, see "How to Access the Web Services Home Page". For more information on the Home Page see "Understanding the Web Service Home Page".

  2. Click the link belonging to the operation you want to test.

    The operation's Editor Page opens. Figure 12-2 illustrates the Editor Page.

  3. Enter the parameter values, if any, for the operation.

    If the parameter or element is optional or nillable, then a checkbox will appear next to the parameter or element name. If the checkbox is clear, then the parameter or element will not be included in the Test Page. See "Understanding the Web Service Editor Page" for more information on how to use this page.

  4. Click the Preview SOAP button.

    The Invocation Page opens The Invocation Page contains two text boxes. The top text box displays the SOAP message created by the entries made in the Editor Page. The lower text box contains an empty text area that will contain the SOAP response from the server. See "Understanding the Web Service Invocation Page" for more information on how to use this page.

  5. Click the Invoke button to send the test message to the endpoint.

    The response to the test message will appear in the lower text box in the Invocation Page. See "Understanding the Web Service Invocation Page" for more information on how to use this page.

The following sections describe the components of the Web Services Home Page:

Understanding the Web Service Home Page

The Home Page displays the list of operations available for the Web service, and links to the Web service's WSDL and the service's JavaScript stub.

Each operation name on the Home Page links to the Editor Page where you can input the parameter values that you want to test. "Understanding the Web Service Editor Page" provides more information on this page.

The Service Description link opens the WSDL for the Web service. You can save the file locally.

Figure 12-1 shows the Web Service Home Page for HelloService, at the endpoint:

http://localhost:8888/hello/HelloService

This example also displays a link for this Web service's one operation: hello.

Figure 12-1 Web Service Home Page

Described in the surrounding text.
Description of "Figure 12-1 Web Service Home Page"

Understanding the Web Service Editor Page

The Editor Page opens when you click an operation name in the Web Service Home Page. Use the Editor Page to test a Web service operation for different parameter values. You can also use this page to test security and reliability settings if these management features have been enabled for the service. The following sections describe how you can use the Editor Page to test these operation parameters and management features with different values.

Editing Operation Parameters and Elements

The Editor Page displays a table containing the operation's parameters or elements, their data types, and an editable text box where you can enter parameter values. If the parameter or element is optional or nillable, then a checkbox will appear next to the parameter or element name.

  • Mark the checkbox if you want the parameter or element to participate in the test.

  • Clear the checkbox if you do not want to input values to the optional parameter or element.

  • Click the Preview SOAP button to view the SOAP request for the operation with the parameter or element values.

Click the Preview SOAP button to open the Invocation Page and display the SOAP request that will be sent to the service. For more information on this page, see "Understanding the Web Service Invocation Page".

Figure 12-2 illustrates a sample Editor Page. In this figure, the hello operation is being tested, with the string_1 parameter set to Anonymous.

Figure 12-2 Editor Page for Testing a Web Service Operation

Described in the surrounding text.
Description of "Figure 12-2 Editor Page for Testing a Web Service Operation"

Editing Security and Reliability Settings

if Web service security and/or reliability have been enabled for the service, then the Editor Page also enables you to test the service for different settings for these management features.

If WS-Reliability has been enabled for the service, the Editor Page displays a table containing the WS-Reliability Header label and the reliability features you can test. Figure 12-3 illustrates an Editor Page that displays the entries for WS-Reliability features.

A checkbox next to the WS-Reliability Header label indicates whether the reliability features will participate in the test.

  • Mark the checkbox if you want the test to include reliability features. The reliability SOAP header will be inserted into the SOAP envelope.

  • Clear the checkbox if you do not want the test to include reliability features. The reliability SOAP header will not be inserted into the SOAP envelope.

If you want the test to include reliability, then you can choose different settings for these features:

  • duplicate elimination—turning this feature "on" will insert the DuplicateElimination reliability header into the message. This tells the reliable endpoint to eliminate duplicates of the message that will be sent.

  • guaranteed delivery—turning this feature "on" will insert the GuaranteedDelivery reliability header into the message. This tells the reliable endpoint that it must acknowledge receiving the message.

  • reply to URL—the URL to which acknowledgments and faults will be sent for messages that want asynchronous acknowledgements. The URL is typically the host name of the client, with the port that the listener is on.

  • reply pattern—indicates how the client can interact with the endpoint. The values can be Callback (asynchronous acknowledgment/fault), Response (synchronous acknowledgement/fault), or Polling (the acknowledgment or fault must be polled for).

See "Ensuring Web Service Reliability" in the Oracle Application Server Advanced Web Services Developer's Guide for more information on these reliability features.

If WS-Security has been enabled for the service, the Editor Page displays a table containing the WS-Security Header label and the security features you can test. Figure 12-3 illustrates an Editor page that displays the entries for WS-Security features.

A checkbox next to the WS-Security Header label indicates whether the security features will participate in the test.

  • Mark the checkbox if you want the test to include security features. The security SOAP header will be inserted into the SOAP envelope.

  • Clear the checkbox if you do not want the test to include security features. The security SOAP header will not be inserted into the SOAP envelope.

For WS-Security, you can enter values for these parameters:

  • user name

  • password

For more information on the security features that are available for OracleAS Web Services, see the Oracle Application Server Web Services Security Guide.

Figure 12-3 Editor Page for Testing Web Service Management Features

Description of Figure 12-3 follows
Description of "Figure 12-3 Editor Page for Testing Web Service Management Features"

Understanding the Web Service Invocation Page

The Invocation Page opens when you click the Preview SOAP button in the Editor Page. The Invocation Page contains two text boxes. The upper text box displays the SOAP message created by the values you provide in the Editor page. The lower text box contains an empty text area that will contain the SOAP response from the server. The page also contains a link to return you to the list of the service's operations.

Click the Invoke button to send the request to the service. The lower text box will display the SOAP response from the service.

Figure 12-4 illustrates a sample Invocation Page that will send the Anonymous value for the hello operation to the service.

Figure 12-4 Invocation Page Displaying a SOAP Request

Description of Figure 12-4 follows
Description of "Figure 12-4 Invocation Page Displaying a SOAP Request"

Figure 12-5 illustrates the Invocation Page after clicking Invoke. The lower text box contains the response from the service.

Figure 12-5 Invocation Page Displaying a SOAP Request and Response

Description of Figure 12-5 follows
Description of "Figure 12-5 Invocation Page Displaying a SOAP Request and Response"

Using the Web Services Home Page for REST Services

You can use the Web Services Home Page to test REST Services. REST Services are described in Chapter 11, "Assembling REST Web Services".

The Home Page and Invocation Page for REST Services provide the same functionality as for JAX-RPC Web Services. However, if you select an operation on the Home Page that is REST-enabled, then the Editor Page provides two additional buttons that allow you to preview the XML REST POST request and to invoke the GET URL.

  • Preview REST POST—enables you to generate and invoke a REST POST request.

  • Invoke REST GET—redirects the page to the GET URL.

Figure 12-6 illustrates an Editor Page for a REST-enabled operation.

Figure 12-6 Editor Page for Testing a REST Web Service Operation

Description of Figure 12-6 follows
Description of "Figure 12-6 Editor Page for Testing a REST Web Service Operation"

Click Preview REST POST on the Editor Page to open the Invocation Page for REST Services. The upper text box displays the XML message created by the values you provide in the Editor Page. The lower text box contains an empty text area that will contain the XML response from the service.

Click the Invoke button to send the XML request to the service. The lower text box will display the XML response from the service.

Click Invoke REST GET on the Editor Page to display the XML REST GET invocation. The correct URL will be displayed in the browser. Figure 12-7 illustrates an XML REST GET invocation.

Figure 12-7 REST GET Invocation

Description of Figure 12-7 follows
Description of "Figure 12-7 REST GET Invocation"

Obtaining a Web Service WSDL and Client-Side Proxies Directly

If you do not use the Web Service Home Page to get the WSDL fileor client-side proxy for a Web service, you can obtain this file directly.

To obtain the WSDL service description for a Web service, use the Web service URL and append a query string. The format for the URL to obtain the WSDL service description is:

http://host:port/context-root/service?WSDL

WSDL can be either uppercase or lowercase. Table 12-1 contains a description of the URL components.

This URL returns a WSDL description in the form service.wsdl. The service.wsdl description contains the WSDL for the Web service named service, located at the specified URL. Using the WSDL, you can build a client application to access the Web service.

Limitations

See "Testing Web Service Deployment".

Additional Information

For more information on Web services that can use the Web Services Home Page, see the following chapters:

For more information on Web service security and reliability, see these resources: