IBM Support

Testing CICS Web services

Question & Answer


Question

You have a WSDL document created using DFHLS2WS that describes a Web service hosted in CICS. You have deployed the WSBind file into CICS. You would like to know, how can you quickly and easily test the Web service?

Cause

You might be unfamiliar with the many tools that are available for working with WSDL documents and for testing Web services. You do not wish to write a complete client side application just to test that the CICS configuration is correct.

Answer

Many tools and products exist for working with WSDL, some of which are free. What follows is a quick 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 plugins are being used.

  1. Go to the Eclipse download site at http://www.eclipse.org and click on Downloads or Download Eclipse. Then download both Eclipse and the 'Web Tools' plugins free from the download site.

    Note: The Eclipse project continues to evolve. At the time this document was written, the Eclipse downloads page offered several software packages some of which automatically contain the Web Tools plugins (previously referred to as the WST project). The author of this document used an Eclipse download package called 'Eclipse IDE for Java EE Developers'.


  2. Start a new project by clicking on File->New->Project. Select a General project.





  3. Click on Next and give it a name. In this example, the project was given the name 'Test WSDL' .





  4. Click on Finish. You will see an empty project has been created in the Package Explorer.





  5. Right click on the project and select Import. Then select a General import from the File System.





  6. Navigate to the WSDL document you want to use:





  7. Click Finish. You can now see your WSDL document in the Package Explorer.





  8. You will now be able to view the WSDL in Eclipse:





  9. Right click on your 'testZDec.wsdl' file in the Eclipse package explorer and click on Web Services->Test with Web Services Explorer. Eclipse will then generate a web based client for the remote Web service.






  10. Before you can call the Web service you have to add the real Endpoint information (something that you could have put in the WSDL before importing it). You can do this by clicking Add and entering the URL that CICS is listening on:





  11. Now click on Go and you will see message IWAB0388I in the status stating that the Endpoint was successfully added:






  12. Select the operation you want to invoke using the navigator. In this example there is only one option 'NULLPROGOperation'.





  13. Now you can supply values for all of the input parameters, in this example the parameters are called 'test1', 'test2', etc.. You can supply values as follows:





  14. Now click on Go to send the SOAP message to CICS. The output from the Web service will be displayed in Eclipse:



    In this example the NULLPROG program in CICS returns the same data it was invoked with.


  15. You can click on the source link to see the actual SOAP messages that flowed on the wire:





  16. In the following 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 of '2' is too large):





Other tools exist that can be used to quickly and simply test Web services, including the IBM Rational Developer for System z range of products. This quick demonstration of what can be done using free tools should indicate how trivial it can be to test Web services hosted in CICS.

[{"Product":{"code":"SSGMGV","label":"CICS Transaction Server"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Web Services","Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"4.1;4.2;5.1;5.2;5.3;5.4","Edition":"","Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]

Product Synonym

CICS/TS CICS TS CICS Transaction Server

Document Information

Modified date:
21 June 2018

UID

swg21268824