Generating the WSDL and binding

To create a web service provider from a CICS® application, you must generate the WSDL document to describe the web service and create a binding that defines how the application data is transformed to and from XML.

About this task

This scenario is about creating two web services for the general insurance application; one web service can inquire on customers and the other web service can add customers to the application database. The COBOL application has two programs that drive this business logic. To create a web service for each operation, you must generate a WSDL document that describes the application interface. This generation process also creates a web service binding that describes how the application data is transformed to and from XML.

You can use either the CICS web services assistant, a batch tool that uses Java™ to run against your program copybooks, or you can use Rational® Developer for z System z®. This task assumes you are using the batch job, DFHLS2WS. For more information about the assistant, see The CICS web services assistant.

Procedure

  1. Edit the parameters in the supplied sample JCL called @WSAAC01.
    The JCL is supplied in the CNTL data set for the general insurance application.
  2. Edit the sample JCL to change the values for your environment:
    1. Change the JAVADIR parameter to the installation directory of Java. The value of this parameter is appended to /usr/lpp to produce a complete path name.
    2. Change the USSDIR parameter to the name of the CICS TS directory in UNIX Systems Services. The value of this parameter is appended to /usr/lpp/cicsts to produce a complete path name.
    3. Change the LOGFILE parameter to select a suitable directory in zFS to contain the logs for the job. You must have write access to this directory.
    4. Change the WSBIND and WSDL parameters to select the pipeline pickup directory in zFS to contain the WSDL and binding. If you put these files in the same directory, you can perform validation on the web service.
    The following example shows the JCL with the variables:
    //JOBPROC JCLLIB ORDER=CTS420.CICS670.SDFHINST          
    //*                                                     
    //LS2WS     EXEC DFHLS2WS,                              
    //    JAVADIR='path',             
    //    USSDIR='uss_path',                  
    //    PATHPREF='',                                      
    //    TMPDIR='/tmp',                                    
    //    TMPFILE='LS2WS'                                   
    //INPUT.SYSUT1 DD *                                     
     PDSLIB=userhlq.CB12.SOURCE                              
     LANG=COBOL                                             
     PGMNAME=LGACUS01                                       
     REQMEM=SOAIC01                                         
     RESPMEM=SOAIC01                                        
     LOGFILE=/u/userid/genapp/logs/LS2WS_LGACUS01.LOG      
     URI=GENAPP/LGACUS01                                    
     PGMINT=COMMAREA                                        
     WSBIND=/u/userid/genapp/wsdir/LGACUS01.wsbind         
     WSDL=/u/userid/genapp/wsdir/LGACUS01.wsdl             
    
    /*                                                      

    The COBOL program LGACUS01 contains the logic to add a customer to the application database. The high-level language structure (copybook) that describes the interface for the program is called SOAIC01. This copybook describes the input and output for the program and is therefore specified in both the REQMEM and RESPMEM parameters. The URI parameter specifies the relative URI that the web service requester will use to access the web service. This value is used to generate a URIMAP resource.

  3. Run the job to generate the WSDL document and the web service binding.
    The output files are saved in the directories that you specified on the WSBIND and WSDL parameters.
  4. Edit the parameters in the job @WSAIC01 to generate the WSDL and binding for the customer inquiry web service.
    The job is in the CNTL data set.
    //JOBPROC JCLLIB ORDER=CTS420.CICS670.SDFHINST          
    //*                                                     
    //LS2WS     EXEC DFHLS2WS,                              
    //    JAVADIR='Java_SDK_dir',             
    //    USSDIR='uss_path',                  
    //    PATHPREF='',                                      
    //    TMPDIR='/tmp',                                    
    //    TMPFILE='LS2WS'                                   
    //INPUT.SYSUT1 DD *                                     
     PDSLIB=userhlq.CB12.SOURCE                              
     LANG=COBOL                                             
     PGMNAME=LGICUS01                                       
     REQMEM=SOAIC01                                         
     RESPMEM=SOAIC01                                        
     LOGFILE=/u/userid/genapp/logs/LS2WS_.LOG      
     URI=GENAPP/LGICUS01                                   
     PGMINT=COMMAREA                                        
     WSBIND=/u/userid/genapp/wsdir/LGICUS01.wsbind         
     WSDL=/u/userid/genapp/wsdir/LGICUS01.wsdl             
    
    /*                                                      

    The structures of the COMMAREA for the add and inquire application functions use the same layout and therefore use the same copybook.

  5. Run the job to generate the WSDL document and the web service binding.
    The output files are saved in the directories that you specified on the WSBIND and WSDL parameters.

Results

You have created the WSDL documents and bindings for the web services in a directory in zFS. You can view the files by opening the z/OS® perspective in CICS Explorer® and browsing to the pipeline pickup directory in the z/OS UNIX Files view:
Screen capture showing the logs, web service bindings, and WSDL documents.

What to do next

You can deploy the web services in CICS.