Testing CICS SOAP Web services

You can quickly and easily test a Web service without writing a complete client side application just to confirm that the CICS® configuration is correct.

Before you begin

Before you can begin to test your Web service:
  • You must have created a WSDL document using DFHLS2WS that describes a Web service hosted in CICS.
  • You must have deployed a WSBind file into CICS.

About this task

Many tools and products exist for working with WSDL, some of which are free. What follows is a tutorial on how to use the Eclipse development environment to test Web services. In this example, Eclipse V3.3 and the optional Eclipse Web tools plug-ins are being used.

Procedure

  1. Start a new project by choosing File > New > Project and select a General project.
    Creating a new project
  2. Click on Next and give it a name. In this example, the project is called 'Test WSDL'.
    Naming your new project
  3. Click Finish. You will see that an empty project has been created in the Package Explorer.
    Package Explorer contains a new empty project
  4. Right-click on the project and selectImport. Then select a General import from the File System.
    Preparing to import a WSDL file
  5. Navigate to the WSDL document you wish to use:
    Navigating to the desired WSDL file
  6. Click Finish and you will see your WSDL document in the Package Explorer.
    The WSDL document in the Package Explorer
  7. You can now view the WSDL in Eclipse:
    Viewing the WSDL document in Eclipse
  8. Right-click on your WSDL file in Eclipse - in this case it is testZDec.wsdl - and click Web Services > Test with Web Services Explorer. Eclipse generates a web-based client for the remote Web service.
    Generating a Web based client
  9. Before you can call the Web service you must add the real endpoint information (something that you could have put in the WSDL before importing it). Do this by clicking Add and entering the URL that CICS is listening on:
    Providing endpoint information
  10. Click Go and message IWAB0388I appears in the Status area, announcing that the endpoint was successfully added:
    Confirming successful addition of the endpoint
  11. Use the Navigator to select the operation you wish to invoke. In this example, there is only one option - NULLPROGOperation.
    Selecting an available operation
  12. Now you can supply values for all of the input parameters. In this example, the parameters are called test1, test2 and so on.
    Providing parameter values
  13. Now click Go to send the SOAP message to CICS. The output from the Web service is displayed in Eclipse:
    Sending the SOAP message to CICS
    In this example, the NULLPROG program in CICS returns the same data it was invoked with.
  14. Click on the source link to view the actual SOAP messages that flowed on the wire:
    Viewing the SOAP message
  15. In this example, you can see that a SOAP Fault message was returned from CICS (field test1 can only have values between 0 and 1, so the value 2 is too large):
    A SOAP Fault message

Results

This quick demonstration has shown what can be done using free tools to test Web services hosted in CICS.