< Previous | Next >

Lesson 1.5: Validate the Web service traffic WS-I compliance

Before you begin, you must complete Lesson 1.4: Implement the temperature conversion methods.

To ensure that the SOAP envelope request and response pairs are WS-I compliant, you need to direct your Web service traffic through the TCP/IP Monitor:

When creating a Web service using the Web service or Web service client wizards, you can select to set up and run the TCP/IP Monitor automatically. Since you chose this option when creating the Web service, the TCP/IP monitor view should be in your workspace. If it is not, you can open this view by selecting Window > Show View > Other > Debug > TCP/IP Monitor.

Alternately, you can set up the TCP/IP Monitor manually by completing the following steps:

  1. In the sample application, invoke the getEndPoint method. Record this endpoint.
  2. Create a server to act as the TCP/IP Monitor:
    1. From the Window menu, select Preferences.
    2. In the Preferences window, expand Run/Debug and then select TCP/IP Monitor.
    3. Select the Show TCP/IP Monitor View when there is activity check box.
    4. Under the TCP/IP Monitors lists, click Add. A New Monitor dialog box opens.
    5. Specify the following settings:
      Option Description
      Local monitoring port Specify a unique port number on your local machine.
      Host name Specify the host name or IP address of the machine where the server is running.
      Port Specify the port number of the remote server.
      Type Specify whether the request type from the Web browser are sent by HTTP or TCP/IP. If the HTTP option is selected the requests from the Web browser are modified so that the HTTP header points to the remote machine and separated if multiple HTTP requests are received in the same connection. If the TCP/IP option is selected, all the requests are sent byte for byte.
  3. In order to route the Web service through the monitor, the endpoint of the Web service client needs to be changed. The TCP/IP Monitor listens on port 9081. In the Web browser window used in step 1, invoke the setEndPoint method, and change the endpoint so that it directs to port 9081. For example, the default would be: http://localhost:9081/web_module_context_root/servlet/rpcrouter Invoke the getEndPoint method again to ensure that your change has been implemented.

Routing traffic and verifying WS-I compliance

You can route traffic through the TCP/IP monitor and test the traffic for WS-I compliance by following the proceeding steps:

  1. Select a Web service method in the Methods pane. Invoke this method.
  2. Change to the TCP/IP Monitor view by clicking the TCP/IP Monitor tab in the Servers view. This will display request and response pairs that are being routed through the TCP/IP Monitor. It will look similar to the following picture:
    TCP/IP Monitor
  3. To ensure that your Web service SOAP traffic is WS-I compliant, you can generate a log file by clicking the Log file icon icon. In the dialog box that opens, select a name for the log file and specify where you want it to be stored. This log file will be validated for WS-I compliance. You can open the log file in an XML editor to examine its contents.

Lesson checkpoint

Finish your tutorial by reviewing the materials in the Summary.

Feedback

< Previous | Next >