banner



How To Check A Web Service Is Running

As yous develop a web service, you can typically examination it directly past using the Test Client. In some cases, you will need to exam indirectly past creating a separate web service that acts as a client for testing.

Testing Spider web Services with the Test Customer

The Examination Customer provides a user interface through which you can examination spider web service operations with parameter values you choose. With the Test Customer you can:

  • Test a web service from the project tree.
  • Choose which performance you desire to test.
  • Examine functioning and callback results.
  • View the WSDL for the spider web service you're currently testing.
  • Cull another web service to test.

Note: You can also launch the Exam Client without using the IDE.

For an example of using the Exam Customer, meet Web Service Tutorial: Step four: Test the Web Service.

Exam Client User Interface

Basic Testing Steps

When you exam web services with Workshop for WebLogic, yous follow elementary steps that launch the Test Client with a visual interface for invoking the spider web service's operations. Briefly, these steps are:

  1. Outset WebLogic Server.
  2. Expand the project tree to brandish the web service source file.
  3. Right-click the source file, then click Run As -> Run on Server.
  4. When the Test Client is displayed, choose the operation you want to examination.
  5. If the functioning has parameters, enter test values in the boxes provided.
  6. Click the button labeled with the operation's proper name.
  7. Examine the result of the test.
  8. Utilize the Message Log list to view the results of multiple tests.
  9. If the web service is designed to receive a callback, click the callback'south proper name in the Bulletin Log list to view callback values. (You might need to refresh the Test Client if the callback is not designed to execute right abroad.)
  10. Click Evidence Operations to brainstorm another test.

Choosing Operations to Test

When the Test Client is displayed, yous choose an operation to test by clicking the push labeled with the operation's proper name. If the operation has parameters, the Examination Client provides boxes for you to enter the values to test with.

Circuitous Types as Parameters

When an operation includes complex types as parameters, the Test Customer will display an XML template with placeholders for your test values. For example, the following illustration shows a template in which "Gladys Kravitz" has been entered for one Cord placeholder and the other placeholder is about to be replaced with a test value.

Navigating Conversational Spider web Service Tests

The Test Client provides special links through which you tin can examination conversational web services.

When testing a conversational web service, the Test Client volition only display the operations that are valid in the current phase of the conversation. In other words, when you begin testing, only START methods show. The Test Customer provides the following buttons for navigating conversations:

  • Click the Keep this conversation (or the chat's log heading — such as "Conversation 2535 " in the post-obit illustration) link to brandish the list of operations subsequently you invoke a Get-go method — then only Go on and FINISH methods are displayed.
  • Click Start New Conversation to display the listing of operations and so that you can choose one and kickoff a new conversation.
  • Click Re-Invoke to re-invoke an operation (here, requestMessageAsynchronous) on the conversation that is already running.

Notation that the bulletin log groups the operations invoked according to the chat in which they were tested with each bulletin shown chronologically inside the conversation.

Examining Message Contents

When you execute an operation, the Test Client refreshes to display information about the bulletin exchanged past the functioning. The user interface provides a summary of message values likewise as the message XML itself. This information is provided for both operation messages and callback letters. When an exception occurs, a error message is displayed.

Notice that in the bulletin XML, all but the well-nigh important parts of the message payload are displayed in grey.

Operation Messages

After you lot accept executed a web service performance, the Test Client displays information about messages related to the operation. The request summary provides a autograph version of the bulletin'south contents. It gives parameter and render values (if any), forth with time stamp data.

Each test of a web service operation will have its own entry in the Message Log list. In this style y'all can compare tests that use dissimilar values.

Beneath the request summary the message XML is displayed, every bit shown in the following image. Messages for both the operation'south request and its render value are displayed.

Callback Letters

If your web service sends a callback, you lot can view the results of the callback's execution past clicking its name in the Bulletin Log list. Note that because the callback log entry won't evidence up until later the callback executes, you might need to refresh the Test Client after an interval to become the entry (you tin click the Refresh button at the top of the message log).

As with operation messages, the Test Client displays callback bulletin data as a summary likewise as the message XML. The callback request message volition describe the information sent to your spider web service by the callback.

Exception Letters

When testing the web service generates a fault or exception, the Test Client displays the resulting message. Annotation in the following summary example that a fault has been noted. Here, a String was provided for the operation's argument rather than an int.

The message XML below is also displayed.

Viewing the WSDL File

You can view the WSDL file for the web service you're testing by clicking the WSDL URL provided at the pinnacle of the Test Client window.

WSDL link

Choosing Another Spider web Service to Test

Y'all tin can test another spider web service without closing the Examination Client by clicking the Cull Another WSDL link at the superlative of the Examination Client window. The Exam Client will display a page with a box where you enter the WSDL URL, and so click Test to display the exam form for that spider web service.

Launching the Test Customer Without the IDE

You can use the Test Client outside the IDE by launching the customer through a web browser.

  1. With the server running, open a browser window and navigate to the following URL to beginning the Test Client:
  2. http://localhost:7001/wls_utc

  3. In the Enter WSDL URL box, enter the URL for the WSDL of the spider web service you want to test, then click Test.

Setting Up a Web Service Client for Indirect Testing

Some web services tin not be tested standalone with the Test Client. In these cases, you will need to create a separate web service to act as a client of the master spider web service for the purpose of testing. You lot will need to test in this "indirect" fashion if the web service you desire to exam:

  • Contains reliable messaging.
  • Contains message-level security.

You lot can test information technology past setting up a service control and a client web service for that control. The following gives the basic steps for setting upwardly a service control and control client. Note that you practice non demand to create a separate web service client for every testing scenario.

  1. To create a new web service project, select File > New > Project > Web Services > Web Service Project. Y'all should create all of your client-related classes in a dissimilar project than the target web services.
  2. To generate a WSDL file, on the Package Explorer tab, right-click the target web service file and select Web Services > Generate WSDL. When the WSDL file has been generated, drag and drop it into the new spider web service project. The WSDL should be dropped into an appropriate package under the src directory.
  3. To generate a web service control, right-click the WSDL file and select Spider web Services > Generate Service Command.
  4. To generate a client web service, select File > New > WebLogic Web Service. Complete the New Web Service dialog to create a web service class.
  5. Add together the web service control to the client past right-clicking anywhere in the source view of the client form and selecting Insert > Control. Select the service command generated above.
  6. Add any event handler to the client by right-clicking anywhere in the source view of the client class and selecting Insert > Control Event Handler. Select the desired result methods from the service control.
  7. Finally add methods to the client that invoke methods on the service control.
  8. Run the client past correct-clicking it in the Parcel Explorer and selecting Run As > Run on Server. By default, web services are shown in Test Client.

Debugging Transactional and Conversational Web Services

When debugging a transactional web service, you lot should consider increasing the transaction timeout menses in gild to compensate for delays caused past the debugger. The default timeout is xxx seconds, which may be too short in some debugging situations, specially when the spider web service is conversational.

To increase the timeout period, use the timeout attribute on the @weblogic.jws.Transactional annotation:

          @WebService     @Transactional(value=true,          timeout=600) // Increase the timeout period to 600 seconds/10 minutes.     public class TransactionalService implements Serializable {         ...     }

Source: https://docs.oracle.com/cd/E13224_01/wlw/docs100/guide/webservices/conTestingWebServices.html

Posted by: lukensorms1986.blogspot.com

0 Response to "How To Check A Web Service Is Running"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel