ibm enterprise modernization for system

Upload: jnfilho

Post on 06-Apr-2018

226 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/3/2019 IBM Enterprise Modernization for System

    1/40

    IBM Enterprise Modernization for System z: Wrapexisting COBOL programs as Web Services withIBM Rational Developer for System z

    Extend value of existing enterprise software assets

    Skill Level: Intermediate

    Reginaldo Barosa ([email protected])

    Executive IT SpecialistIBM

    25 Feb 2008

    This tutorial shows how IBM Rational Developer for System z can help speedefficiency of traditional mainframe, Web development and composite applications. Thenew capabilities help customers reduce cost and risks of rewrites by reusing andintegrating core application assets with Web services and modern user interfaces.

    Service-based integration is the most-common approach to exposing the businessfunctions buried in existing systems. You can tap into the business value in yourcurrent systems by using IBM Rational Developer for System z to craft modularcomponents from existing code written in COBOL, PL/I or Java, and by assemblingand deploying services as part of an SOA. This can also position your IT for rapidfuture changes to the business model. In xx minutes this scenario will show you thesteps of how to wrap existing CICS/IMS programs and transactions into businesscomponents and Web services. You will then deploy and test this as CICS WebService on System z.

    Section 1. Before you start

    Learn what to expect from this tutorial and how to get the most out of it.

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System z Copyright IBM Corporation 1994, 2008. All rights reserved. Page 1 of 40

    mailto:[email protected]://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtmlmailto:[email protected]
  • 8/3/2019 IBM Enterprise Modernization for System

    2/40

    About this series

    Walk through this scenario and others online as part of the Enterprise ModernizationSandbox for System z

    About this tutorial

    This tutorial takes you through the steps of using the Enterprise Service Tools (EST)feature of IBM Rational Developer for System z (Version 7.1 and later) totransform an existing IBM CICS COBOL program. Thereafter, you can access itas a Web service through the CICS Web Services facilities of CICS TransactionServer for IBM z/OS (Version 3 and later).

    Objectives

    You will learn how to generate:

    COBOL assets that can be deployed as CICS Services.

    WSDL (Web Services Description Language that describe the CICSservice created).

    Test the deployed CICS Services using the WSDL generated.

    Prerequisites

    Be familiar with COBOL programming.

    Section 2. Components of the solution

    Enterprise Service Tools

    Enterprise Service Tools (EST) are a set of features that lets you transform COBOL-and PL/I-based business programs and applications, thereby exposing them as Webservices.

    developerWorks ibm.com/developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System zPage 2 of 40 Copyright IBM Corporation 1994, 2008. All rights reserved.

    http://www.ibm.com/developerworks/downloads/emsandbox/systemz/assets/?S_TACT=105AGX15&S_CMP=EMDOChttp://www.ibm.com/developerworks/downloads/emsandbox/systemz/assets/?S_TACT=105AGX15&S_CMP=EMDOChttp://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/developerworks/downloads/emsandbox/systemz/assets/?S_TACT=105AGX15&S_CMP=EMDOChttp://www.ibm.com/developerworks/downloads/emsandbox/systemz/assets/?S_TACT=105AGX15&S_CMP=EMDOC
  • 8/3/2019 IBM Enterprise Modernization for System

    3/40

    The Enterprise Service Tools perspective provides views and editors that allow youto develop service flow projects and EST single-service projects (including Webservices for CICS projects, SOAP for CICS projects, IMS SOAP Gateway projects,

    and Batch, TSO, and USS projects).XML Services for the Enterprise

    The XML Services for the Enterprise (XSE) tools are part of Enterprise ServiceTools, along with other tools, such as the Service Flow features

    The XSE capability of Rational Developer provides tools that let you easily adaptCOBOL-based applications so that they can consume and produce XML messages.This adaptation is accomplished without modifying the existing COBOL applications;and, more importantly, without modifying other applications that call the existingCOBOL application. A COBOL application must be able to process XML messages

    to become a Web service, because XML is the transport used to describe the Webservice request and the parameters that are passed to the existing application. XSEsupports the creation of driver programs that work with existing CICS or IMSapplications.

    XSE consists of the following wizards:

    The Create New Service Interface (bottom-up) wizard that generates anew Web service interface for an existing running program. Typically, thisis called a bottom-up approach, because the existing COBOL applicationis at the "bottom" of the new Web service creation process. This tutorial

    covers this capability.

    The Create New Service Implementation (top-down) wizard thatgenerates a new Web service implementation template for a CICS WebService runtime. Typically, this is called a top-down approach, becausethe COBOL application is created "top-down," starting from the existingWeb service definition (typically, a WSDL file).

    The XML to COBOL mapping wizard and tools that help map existingWeb service interfaces (or an XML data definition) to the existing COBOLprogram.

    The Batch processor that allows you to generate the Web serviceinterface in unattended (batch) mode. The Batch processor currentlysupports the bottom-up Web services creation with compiled XMLmessage conversion technology at runtime. The functionality provided bythe Batch processor is equivalent to that of the Create new service

    ibm.com/developerWorks developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System z Copyright IBM Corporation 1994, 2008. All rights reserved. Page 3 of 40

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    4/40

    interface (Bottom up) wizard for compiled XML conversion.

    This tutorial focuses on the bottom-up approach. In this scenario, you generate aWeb service description and runtime-specific XML message processing artifacts

    from a high-level language data structure, as shown in Figure 1. This enables you toexpose an application program as a service provider.

    Figure 1. Components of the bottom-up approach

    These are the components shown in Figure 1.

    WSBind. This is the Web service binding file used by CICS TransactionServer for z/OS to perform the mapping between application datastructures and XML based SOAP messages. This is generated when theWeb Services for CICS converter type is specified.

    Web Services Description Language (WSDL) file. This is anXML-based language for describing a Web service and how to access it.

    These are generated only if you choose the Compiled XML Conversion optioninstead of Interpretive XML Conversion alternative:

    developerWorks ibm.com/developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System zPage 4 of 40 Copyright IBM Corporation 1994, 2008. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    5/40

    Web Services for CICS Driver Program. This is the COBOL programthat determines how the input and output converters that interact with theexisting COBOL application.

    CICS SOAP Inbound XML converter. This is a COBOL program thattakes an incoming XML document and maps it into the correspondingCOBOL data structure that the existing COBOL application expects.

    Outbound XML converter. This is a COBOL program that takes theCOBOL data results returned from the existing COBOL application andmaps them to an outbound XML document.

    Inbound XML schema definition (XSD). This is the XML schema thatdescribes the incoming XML document for processing by the inputconverter.

    Outbound XML schema definition (XSD). XML schema that describesthe outgoing XML document produced by the output converter.

    CICS Web Services

    Previous support for Web services in CICS Transaction Server for z/OS wasprovided through the SOAP for CICS feature. This support has now been fullyintegrated into CICS Transaction Server for z/OS, as shown in Figure 2. With thisnew release of CICS, applications can now act in the role of both service provider

    and service requester, where the services are defined using WSDL. Theinfrastructure provided as part of CICS Transaction Server includes a distributedtransaction coordination capability compatible with the WS-Atomic Transactionspecification.

    The support for Web services includes the CICS Web Services Assistant Integration,a batch utility that can help you:

    Transform an existing CICS application into a Web service

    Enable a CICS application to use a Web service provided by an externalprovider

    The assistant can create a WSDL document from a simple language structure, or alanguage structure from an existing WSDL document. It supports COBOL, C/C++,and PL/I. It also generates information used to enable automatic runtime conversionof the SOAP messages to containers and COMMAREA, and vice versa.

    ibm.com/developerWorks developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System z Copyright IBM Corporation 1994, 2008. All rights reserved. Page 5 of 40

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    6/40

    The XML Services for the Enterprise capability of Rational Developer for zSeriesextends and complements this by providing conversion for COBOL types andconstructs which are not covered natively by CICS. For example, OCCURSDEPENDING ON

    andREDEFINES

    used in data description entries are not supportedby the CICS Web services assistant.

    Figure 2. CICS Web services support

    Overview of development tasks

    This tutorial creates a CICS Web Service from an existing COBOL/CICS program(LAB3POT) that is invoked by another one (LAB3CLI), as shown in Figure 3.

    Figure 3. Structure for CICS Web service

    developerWorks ibm.com/developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System zPage 6 of 40 Copyright IBM Corporation 1994, 2008. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    7/40

    The COBOL program LAB3CLI sends a 3270 map and asks for a customer number.

    If the customer number is valid, it invokes another COBOL program namedLAB3POT using EXEC CICS LINK via CICS COMMAREA. LAB3POT receives thecustomer number, reads a KSDS VSAM dataset, and sends back to theCOMMAREA the data retrieved (Name, last name and address). When LAB3CLIreceives the control it display the data received back to the 3270 screen.

    Because the objective here is to learn CICS Web services, this example is quitesimple, using VSAM instead of IBM DB2 to simplify the deployment of thegenerated artifacts.

    The idea is to create a WSDL and use the Web Services Explorer tool, which will

    invoke the server using CICS Web services without making any change in theexisting server program, as shown in Figure 4.

    Figure 4. Invoke the server

    These are the main tasks that you will perform:

    ibm.com/developerWorks developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System z Copyright IBM Corporation 1994, 2008. All rights reserved. Page 7 of 40

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    8/40

    1. Create a Project to hold the assets.

    2. Import the COBOL program into a Web Services for CICS Project .

    3. Generate the converter driver, input and output. converters, XMLschemas, WSDL, and CICS required file (WSBind).

    4. Use the Web Services explorer to test the CICS-based Web service.

    Section 3. Create a project to hold the created assets

    1. Select Windows > Open Perspective > Other, as shown in Figure 5.Figure 5. Using the Enterprise Service Tools perspective

    2. Select Enterprise Service Tools and click OK, as shown in Figure 6.Figure 6. Selecting the Enterprise Service Tools option

    developerWorks ibm.com/developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System zPage 8 of 40 Copyright IBM Corporation 1994, 2008. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    9/40

    3. The Welcome Page should open. if it does not, right-click the blank areaof the EST Project Explorer view and select Open Welcome Page, asshown in Figure 7.From this page, you can start learning how to use the Enterprise ServiceTools. There are links for demos and tutorials.Figure 7. Enterprise Service Tools welcome page

    4. Close the Welcome window (Ctrl+F4).

    5. To create a CICS Web services Project, select File > New > CICS WebServices Project, as shown in Figure 8.Figure 8. Creating a CICS Web services Project

    What you have done so farYou have created a Web Services for CICS project. Next, you willimport the program LAB3POT into your workspace, because thisprogram is the one that you will invoke via CICS Web Services.

    ibm.com/developerWorks developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System z Copyright IBM Corporation 1994, 2008. All rights reserved. Page 9 of 40

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    10/40

    6. Type LAB3_CICS_Services as the project name and click Finish, asshown in Figure 9.Figure 9. Naming the CICS Web services Project

    7. This creates an empty project. In the next section, you will import theCOBOL source that you need to create the Web Services.

    Section 4. Import the COBOL program into a Web servicefor CICS Project

    You will now create a Web service for your CICS project, and import the COBOLprogram LAB3POT and its required copybooks to this project.

    Note that you could do this directly from the z/OS system if you were connected tothe z/OS.

    LAB3POT is the CICS COBOL program, which you have previously tested. Thisprogram is on your workstation but also at your dataset xxx.POT.COBOL.

    You need to import the COBOL program LAB3POT that you will use in the Webservices dialog.

    developerWorks ibm.com/developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System zPage 10 of 40 Copyright IBM Corporation 1994, 2008. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    11/40

    1. Click the EST Project Explorer tab to switch to the Project Explorer view.

    2. Using the Enterprise Service Tools perspective and the EST ProjectExplorer view, right-click LAB3_CICS_Services, and select Import >Source Files, as shown in Figure 10.

    Figure 10. Using the Enterprise Service Tools Perspective and the EST ProjectExplorer view

    3. Click File System (because your file is on your workstation) and makesure that *.cbl is specified in the Files of type field, as shown in Figure11.

    Figure 11. Step 2: Using the Enterprise Service Tools Perspective and the ESTProject Explorer view

    4. Navigate to C:\RDZ_POT_V7\LAB3, select LAB3POT.cbl, and click

    Open, as shown in Figure 12.

    Figure 12. Navigating to the saved file

    ibm.com/developerWorks developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System z Copyright IBM Corporation 1994, 2008. All rights reserved. Page 11 of 40

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    12/40

    5. Verify that the program to be imported is correct, and then click Finish, as

    shown in Figure 13.

    Figure 13. Verify the program

    developerWorks ibm.com/developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System zPage 12 of 40 Copyright IBM Corporation 1994, 2008. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    13/40

    6. Repeat these steps to import the two copybooks that are part of this code,as follows: Right-click LAB3_CICS_Services, and select Import >Source Files > File System.

    7. In the Files of type field, click the drop-down list and select *.cpy, asshown in Figure 14.

    Copybook FAQs

    Q: How do I find the required COPYBOOKS used in the COBOLcode?'

    A: If you import your code from the z/OS (remote), you candetermine the required copybooks in Rational Developer for Systemz by using the Check Dependencies capability.

    Q: Can I use just the DFHCOMMAREA copybook instead of the

    ibm.com/developerWorks developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System z Copyright IBM Corporation 1994, 2008. All rights reserved. Page 13 of 40

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    14/40

    whole program?

    A: Yes, you can use only data structures. But the copybook (*.cpy)is expected to have the whole structure that would include the 01level (or 77 levels). You do not need to have the whole program,and the wizard can accept only the data structure that has theDFHCOMMAREA (or container). However, if you do decide to use aprogram, then it must be complete (with all copybooks). This tutorialuses the complete program so that you can understand it. In thiscase you will need all of the required copybooks, otherwise thewizard will flag the compile errors. You can also change MoreCOBOL Options by selecting Windows > Preferences > Importer >COBOL if you need extensions other than *.cpy for the datastructure.

    Figure 14. Selecting the file type from the dropdown list

    8. Using the Ctrl key, select COMAREA.cpy and POTVSAM.cpy, and then

    click Open, as shown in Figure 15.

    Figure 15. Selecting the .cpy files

    developerWorks ibm.com/developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System zPage 14 of 40 Copyright IBM Corporation 1994, 2008. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    15/40

    9. Verify that the copybooks to be imported are correct, and then clickFinish, as shown in Figure 16.

    Figure 16. Verifying the copybooks

    ibm.com/developerWorks developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System z Copyright IBM Corporation 1994, 2008. All rights reserved. Page 15 of 40

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    16/40

    10. The imported code should appear as shown in Figure 17.

    What you have done so farYou have created a project to hold the Web Services componentsand imported the LAB3POT program and its components to thisproject.Now you are ready to start the Web services wizards that willgenerate the necessary components to create the CICS WebServices.

    Figure 17. The imported code

    11. Note that you have imported the COBOL program LAB3POT and twocopybooks. This is the program that is invoked by the client COBOL, andthat retrieves the data from the VSAM file. Double-click the LAB3POT

    program and take a few minutes reviewing it to understand this program,as shown in Figure 18.

    Figure 18. Reviewing the program

    12. Close the editor (Ctrl+F4).

    developerWorks ibm.com/developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System zPage 16 of 40 Copyright IBM Corporation 1994, 2008. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    17/40

    Section 5. Generate the required elements

    Now you need to generate the converter driver, input and output converters, XMLschemas, WSDL, and the required CICS file (WSBind).

    1. Right-click the LAB3POT.cbl program under the Lab3_CICS_Servicesproject and select Generate Web Services for CICS resources, asshown in Figure 19.

    This will launch the Web Service Runtime and Scenario Selection dialog, where youcan specify the necessary options to start the Web service wizard.

    Because you are starting from the COBOL program to create the Web services, thisis called a bottom-up operation.

    Figure 19. Selecting Generate Web Services for CICS resources

    2. Also, because you want to select just one field as the input message(customer number), you will need to specify a Conversion type ofCompiled XML Conversion.

    ibm.com/developerWorks developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System z Copyright IBM Corporation 1994, 2008. All rights reserved. Page 17 of 40

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    18/40

    3. Accept all of the defaults and click Start to begin the Web service wizard,as shown in Figure 20.

    Figure 20.Beginning the Web service wizard

    Pros and cons of conversion typesThere are two conversion types available for this scenario andruntime combination. You may select either Compiled XMLConversion or Interpretive XML Conversion from the Web ServiceRuntime and Scenario Selection dialog. The choice of conversiontype involves considering the benefits and cost of either technology.

    Compiled XML Conversion. A driver program interacts with theruntime and invokes bundled programs to provide conversion ofXML to and from language structures. The compiled XMLconversion type provides more extensive support for languagestructure data types and constructs than the interpretive XMLconversion type; however, you have to compile XML Converters,and there are more artifacts to manage.

    Interpretive XML Conversion: XML conversion is accomplishedusing generated metadata and an XML conversion component builtinto the runtime. Although the Interpretive XML Conversion type haslimited support for language structure data types and constructs, itrequires fewer artifacts and does not require you to compile XMLconverters.

    4. On the Web Services for CICS Create New Service Interface wizard,make sure that the Inbound Language Structure tab is selected.

    developerWorks ibm.com/developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System zPage 18 of 40 Copyright IBM Corporation 1994, 2008. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    19/40

    5. Expand DFHCOMMAREA by clicking the + (plus) sign next to it, and thenselect CustNo as the only element that will form the data structure for theinbound XML converter, as shown in Figure 21.

    Figure 21. Expanding DFHCOMMAREA

    ibm.com/developerWorks developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System z Copyright IBM Corporation 1994, 2008. All rights reserved. Page 19 of 40

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    20/40

    developerWorks ibm.com/developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System zPage 20 of 40 Copyright IBM Corporation 1994, 2008. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    21/40

    6. Select the Outbound Language Structure tab. Click the checkbox nextto DFHCOMMAREA to select all the data items as the data structure forthe outbound XML converter, as shown in Figure 22. Click Next.

    Figure 22. Selecting all the data items as the data structure

    ibm.com/developerWorks developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System z Copyright IBM Corporation 1994, 2008. All rights reserved. Page 21 of 40

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    22/40

    developerWorks ibm.com/developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System zPage 22 of 40 Copyright IBM Corporation 1994, 2008. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    23/40

    7. On the Generation Options page, make sure that the XML Converter tabis selected.

    8. Type LAB324 as the Converter program name prefix (instead ofLAB3POT), as shown in Figure 23.

    Figure 23. Specify the identification attributes

    9. Select the WSDL and XSD tab and specify the following as the endpointURI, as shown in Figure 24:http://zserveros.dfw.ibm.com:3091/wdz/LAB3POT

    You can copy this from the file located atC:\RDz_POT_V7\LAB3\Lab3_CICS_Services_URI.txt . This will be theTCP/IP address that is used to reach the target CICS system where theconversion program (LAB324D) is deployed. The transport used is HTTP.The local URI portion (/wdz/LAB3POT) will be used to create the URIMAP

    on CICS for matching URI requests. The port number used for CICS WebServices is 3091.

    Figure 24. Specifying the WSDL properties

    ibm.com/developerWorks developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System z Copyright IBM Corporation 1994, 2008. All rights reserved. Page 23 of 40

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    24/40

    10. Click the Advanced Options tab.

    11. Expand Specify XML Schema generation options, clear Generatequalified elements in XML Schemas, and then click Next, as shown inFigure 25. (Normally you dont need to worry about this choice, but you

    developerWorks ibm.com/developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System zPage 24 of 40 Copyright IBM Corporation 1994, 2008. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    25/40

    will invoke a CICS Web service deployed with Rational Developer forSystem z V7.0, a previous version that did not have this capability.)

    Figure 25. Specify XML Schema generation options

    12. On the Web Services for CICS page, select the Basic Options tab.

    ibm.com/developerWorks developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System z Copyright IBM Corporation 1994, 2008. All rights reserved. Page 25 of 40

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    26/40

    13. Accept the default WSBind file name of LAB3POT, and the Programinterface of COMMAREA, and then click Next, as shown in Figure 26.Figure 26. Selecting Basic Options

    Can I use CHANNEL instead of COMMAREA toavoid the 32K limit?Yes. CICS v3 and later allows the use of a channel (container) thatsolves the infamous 32K limit. The program interface can use either

    the COMMAREA or the new CHANNEL support in CICS. If theCICS application program communicates through a channel, youmust specify the container name.

    14. On the File, data set, or member selection page, under the XML

    developerWorks ibm.com/developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System zPage 26 of 40 Copyright IBM Corporation 1994, 2008. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    27/40

    Converters tab, make sure that LAB324D is specified as the Converterdriver file name.

    15. Also make sure that the checkbox to Generate all to driver is selected,as shown in Figure 27. This generates all of the components to the samefile.

    Figure 27. Selecting the Generate all to driver option

    16. Select the WSDL and XSD tab. No changes are required here. Note the

    ibm.com/developerWorks developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System z Copyright IBM Corporation 1994, 2008. All rights reserved. Page 27 of 40

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    28/40

    WSDL and XSD (schemas) names that will be generated, as shown inFigure 28.

    Figure 28. The generated WSDL and XSD schemas

    17. Click Finish to complete the generation of the conversion program(converter driver and input and output converters), WSBind, XSD, andWSDL files.

    18. After the Web Services Enablement wizard completes its generation, you

    developerWorks ibm.com/developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System zPage 28 of 40 Copyright IBM Corporation 1994, 2008. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    29/40

    should see several additional artifacts in the LAB3_CICS_ServicesProject under the Generation folder, as shown in Figure 29:

    The *.xml files are properties that will be used in the next wizard

    generation run.

    LAB324.wsdl. This is the WSDL file that describes this CICS basedWeb service.

    LAB324D.cbl. This is the conversion program, which is made up ofthe converter driver and input and output converters.

    LAB324I.xsd and LAB324O.xsd. These are the XML SchemaDefinition files that describe the input and output XML documents,respectively.

    The *.log file that is the generation log.

    LAB3POT.wsbind. This is the WSBind file that tells CICS howconversion is to be performed, and what the URI map looks like.

    Figure 29. Targets artifacts

    19. Double-click LAB324D.cbl and use the z/OS LPEX Editor to explore thecode, as shown in Figure 30. This will help you understand theproductivity that you gained from not having to develop the messageconverter manually. Note that LAB324D.cbl file is in fact made of multiple

    ibm.com/developerWorks developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System z Copyright IBM Corporation 1994, 2008. All rights reserved. Page 29 of 40

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    30/40

    programs. The main program calls the various subroutines. All will bedeployed as a simple load module named LAB324D.

    Figure 30. Explore the generated code

    20. Remember that since you want to pass just the customer number asinput, you need to select the compiled XML conversion type instead of theinterpreted XML conversion type. When you specify the compiledconversion type, the XML parsing will be done by the COBOL converterprogram instead of by CICS.

    21. Use Ctrl+F and find the XML Parse command. This is an example of theparsing being done by the converter, as shown in Figure 31.

    Note also that the converter driver for CICS Web Services is different from the driverfor SOAP for CICS Version 2.2, specifically regarding its interaction with the originalexisting application program. The SOAP for CICS driver contains an EXEC CICSLINK to the original existing application program.

    The CICS Web Services driver has no call at all to that program. This is becauseCICS Web Services is responsible for calling that application program. If you do asearch for EXEC CICS LINK you will not find any instances.

    What you have done so farYou have created a project to hold the Web Services components,imported the LAB3POT program, and generated the necessarycomponents that will create the CICS Web Services. You are nowready to deploy the CICS Web Services. Note that in this case, thedeployment has already been done for you: you will just test it using

    developerWorks ibm.com/developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System zPage 30 of 40 Copyright IBM Corporation 1994, 2008. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    31/40

    the WSDL generated.

    Figure 31. An example of the parsing

    22. Press Esc and Close the editor (Ctrl+F4).

    23. Verify the WSDL that was generated: double-click LAB324D.wsdl anduse the WSDL Editor to visualize the input and output messages, asshown in Figure 32.

    Figure 32. Using the WSDL Editor

    24. When you finish, Close this editor (Ctrl+F4).

    25. Double click LAB3POT.wsbind. Rational Developer for System z(Version 7.1 and later) has added the capability to visualize the binary

    ibm.com/developerWorks developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System z Copyright IBM Corporation 1994, 2008. All rights reserved. Page 31 of 40

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    32/40

    contents of the WSBind file. Note the Service Interface and Pipelineproperties, as well as the Target Server program to be invoked(LAB3POT) using COMMAREA., as shown in Figure 33.

    Figure 33. Web Service binding file viewer

    26. Close the file being edited (Ctrl+F4)

    Section 6. Use the Web Services Explorer to test theCICS-based Web service

    You are now ready to invoke the Web Service created on CICS. You will use thegenerated WSDL, and invoke the CICS Services using Rational Developer forSystem z.

    1. Using the EST Project Explorer view, right-click LAB324.wsdl under theproject LAB3_CICS-Services , and select Web Services > Test withWeb Services Explorer, as shown in Figure 34.

    Figure 34. Using the EST Project Explorer

    developerWorks ibm.com/developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System zPage 32 of 40 Copyright IBM Corporation 1994, 2008. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    33/40

    2. Be patient (you are under VMWARE). After a while, the Web ServicesExplorer will launch in a Web Browser view, as shown in Figure 35.

    3. You may need to resize the view to see all areas of the Web ServicesExplorer, or you can double-click the Web Services Explorer title todisplay the full screen.

    Figure 35. The Web Services Explorer

    4. Click the link for the LAB324Operation operation within the Actionssection, (alternatively, you can click the + sign next to LAB324Bindingandexpand the view to display the LAB324Operation, as shown in Figure 36.

    Figure 36. The LAB324 Operation

    ibm.com/developerWorks developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System z Copyright IBM Corporation 1994, 2008. All rights reserved. Page 33 of 40

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    34/40

    5. Notice that the Actions section is now replaced with information about theLAB324Operation operation and the parameters that it takes. It also liststhe endpoint associated with this request.

    6. Click LAB324Operation, enter a value of 4 for CustNo, and click Go toinvoke the operation, as shown in Figure 37.

    Figure 37. Invoking the LAB324 Operation

    developerWorks ibm.com/developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System zPage 34 of 40 Copyright IBM Corporation 1994, 2008. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    35/40

    7. Note that the message "successfully opened" displays in the Statussection.

    8. Resize the Status section and you should see the results shown in Figure38. Click Source to see the SOAP Envelopes.

    Figure 38. Invoking the WSDL Operation

    ibm.com/developerWorks developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System z Copyright IBM Corporation 1994, 2008. All rights reserved. Page 35 of 40

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    36/40

    What you have done so farYou have generated the COBOL converter and the necessary CICSresources to invoke LAB3POT as CICS Web Services. You havetested the created Web Service.

    9. You will see the XML SOAP envelopes with the input and outputmessages, as shown in Figure 39 (you may need to resize it again).

    Figure 39. The XML SOAP envelopes

    10. You can test with customer numbers from 1 to 10. After you are donetesting, close the Web browser using Ctrl+Shift+F4.

    11. Reset the Enterprise Service Perspective by selecting Window > Reset

    perspective

    12. If you are done, close Rational Developer for System z.

    You have completed the tutorial.

    developerWorks ibm.com/developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System zPage 36 of 40 Copyright IBM Corporation 1994, 2008. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    37/40

    Section 7. Solution locationIf you could not complete the tutorial, do not get frustrated. If you missed one step ortyped a wrong name, you would have problems.

    In that case, you can load the solution to your workspace by selecting File > Import> Project Interchange and using the solution located atC:\RDz_POT_V7\LAB3\solution\lab3_solution.zip .

    Also, if you prefer, you can use the solution workspace. This workspace is located atC:\Workspaces\RDZv7SOLUTION .

    1. To start the workspace with the solution, open the folder

    and double-click the icon .

    2. Alternatively, specify this workspace when Rational Developer for Systemz starts, as shown in Figure 40.

    Figure 40. Specifying the workspace

    ibm.com/developerWorks developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System z Copyright IBM Corporation 1994, 2008. All rights reserved. Page 37 of 40

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    38/40

    developerWorks ibm.com/developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System zPage 38 of 40 Copyright IBM Corporation 1994, 2008. All rights reserved.

    http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtml
  • 8/3/2019 IBM Enterprise Modernization for System

    39/40

    Resources

    Learn

    Get a more in-depth look at Rational Developer for System z by reading UsingRational Developer for System z version 7.1 to work with COBOL programs.

    Find out more about IBM Enterprise Modernization Solutions.

    Learn more about IBM Rational Developer for System z.

    Subscribe to the Rational Edge newsletter for articles on the concepts behindeffective software development.

    Watch a demo of Rational Developer for System z.

    Read the whitepaper Unleash the power of mainframe assets into SOA

    Get products and technologies

    Access an evaluation version of Rational Developer for System z .

    Download trial versions of IBM Rational software.

    Download these IBM product evaluation versions and get your hands onapplication development tools and middleware products from DB2, Lotus,Tivoli, and WebSphere.

    Discuss

    Participate in the discussion forum for this content.

    About the author

    Reginaldo BarosaReginaldo W. Barosa is an IBM Executive IT Specialist. He provides sales support,helping customers with enterprise modernization solutions and development tools,such as Rational Developer for System z. Before joining IBM U.S. more than eightyears ago, Reginaldo worked for 27 years for IBM Brazil. He has co-authored IBMRedbooks and has written two books, as well as other articles and tutorials for IBM

    developerWorks. He holds a degree in electrical engineering from Instituto Maua deTecnologia, Sao Paulo, Brazil

    ibm.com/developerWorks developerWorks

    Wrap existing COBOL programs as Web Services with IBM Rational Developer for System z Copyright IBM Corporation 1994, 2008. All rights reserved. Page 39 of 40

    http://www.ibm.com/developerworks/websphere/library/tutorials/0802_barosa/0802_barosa.htmlhttp://www.ibm.com/developerworks/websphere/library/tutorials/0802_barosa/0802_barosa.htmlhttp://www-306.ibm.com/software/info/developer/solutions/em/index.jsphttp://www-306.ibm.com/software/awdtools/rdz/http://www.ibm.com/developerworks/rational/rationaledge/http://rational.dfw.ibm.com/atdemo/atdemo_rdz.htmlhttps://www14.software.ibm.com/webapp/iwm/web/pick.do?lang=en_US&source=swg-systemzsoa11&S_TACT=&S_PKG=SOAE11NOV07GEN1http://www.ibm.com/developerworks/downloads/r/rdz/http://www.ibm.com/developerworks/downloads/?S_TACT=105AGX15&S_CMP=EMDOChttp://www.ibm.com/developerworks/downloads/?S_TACT=105AGX15&S_CMP=EMDOChttp://www.ibm.com/developerworks/forums/dw_forum.jsp?forum=375&cat=5http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/developerworks/forums/dw_forum.jsp?forum=375&cat=5http://www.ibm.com/developerworks/downloads/?S_TACT=105AGX15&S_CMP=EMDOChttp://www.ibm.com/developerworks/downloads/?S_TACT=105AGX15&S_CMP=EMDOChttp://www.ibm.com/developerworks/downloads/r/rdz/https://www14.software.ibm.com/webapp/iwm/web/pick.do?lang=en_US&source=swg-systemzsoa11&S_TACT=&S_PKG=SOAE11NOV07GEN1http://rational.dfw.ibm.com/atdemo/atdemo_rdz.htmlhttp://www.ibm.com/developerworks/rational/rationaledge/http://www-306.ibm.com/software/awdtools/rdz/http://www-306.ibm.com/software/info/developer/solutions/em/index.jsphttp://www.ibm.com/developerworks/websphere/library/tutorials/0802_barosa/0802_barosa.htmlhttp://www.ibm.com/developerworks/websphere/library/tutorials/0802_barosa/0802_barosa.html
  • 8/3/2019 IBM Enterprise Modernization for System

    40/40

    Trademarks

    This is the first trademark attribution statement.This is the second trademark attribution statement.

    developerWorks ibm.com/developerWorks