Testing the Web service IBM-CICS

Now that all of the resources are created in CICS, and the Web service bind files and wsdl are generated, the service is ready to be tested. A simple way to achieve this is by using the Web Services Explorer in WD/z. The only input required is the wsdl file for the service.

From a previous step the wsdl was generated and saved in the HFS on the remote host. The following steps show how we tested our sample GetHash.wsdl Web service.

  1. Import a copy of the wsdl file into a local project on your work space.
  2. To do this:

    • Select File → Import.
    • In the Select panel, choose Other → Remote File System.
    • Click Next.
    • Browse for the location of the folder containing the wsdl.
    • In the Remote file system panel, select the wsdl to import. This is shown in Figure.
    • Select the remote wsdl to import

      Select the remote wsdl to import

    • Click Finish.
    • The imported files are now displayed in the local project.
  3. Define the location of the Web service on the host.
  4. Use the following steps to do this:

    • Select the GetHash.wsdl in the local project, and double-click to open up the WSDL editor.
    • Choose the Design view of the wsdl object.
    • Click the Port for the service.
    • In the Properties pane, select the General tab, and enter the address of the service. This is the URL of the remote host and the URL of the Web service. This is shown in Figure

    Use the WSDL Editor to specify location

    Define the location of the Web service on the host.

  5. Use the Web Services Explorer to test the Web service.

To start the Web Services Explorer, right-click the wsdl file, and select Web Services → Test with Web Services Explorer. This opens a window that has three panes in it as seen in Figure:

  • The Navigator pane shows a history of all previously tested WSDL files and services. Bindings and operations can be viewed.
  • The Actions pane is used to execute an operation or to change an endpoint at runtime.
  • The Status pane shows any output messages and SOAP envelopes generated for the service.
  • The Web Services Explorer in WD/z

    Use the Web Services Explorer to test the Web service

    To issue the Web service request for testing, click the Operation name (ITSOGH03Operation), and the Action name expands to show the data representation of the service you want to invoke. This is seen in Figure.

    The labels correspond to the names of the fields in the commarea. In our example, our logic takes five address fields as input and returns three fields as output. As we are using the same commarea and have not written a wrapper to manipulate the request and response data, all the fields in the commarea are displayed in the request and the response.

    Enter the request specific data for the Web service on the Action pane

    Enter the request specific data for the Web service on the Action pane

    Enter some data to test, and click Go.

    The result, including any error messages, appear in the Status pane as in Figure, showing the contents of the ITSOGH03OperationResponse.

    The expected results of the Web service test

    The expected results of the Web service test

    The test was successful!



Face Book Twitter Google Plus Instagram Youtube Linkedin Myspace Pinterest Soundcloud Wikipedia

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM-CICS Topics