Sei sulla pagina 1di 40

IBM Enterprise Modernization for System z: Wrap existing COBOL programs as Web Services with IBM Rational Developer

for System z
Extend value of existing enterprise software assets
Skill Level: Intermediate Reginaldo Barosa (rbarosa@us.ibm.com) Executive IT Specialist IBM

25 Feb 2008 This tutorial shows how IBM Rational Developer for System z can help speed efficiency of traditional mainframe, Web development and composite applications. The new capabilities help customers reduce cost and risks of rewrites by reusing and integrating core application assets with Web services and modern user interfaces. Service-based integration is the most-common approach to exposing the business functions buried in existing systems. You can tap into the business value in your current systems by using IBM Rational Developer for System z to craft modular components from existing code written in COBOL, PL/I or Java, and by assembling and deploying services as part of an SOA. This can also position your IT for rapid future changes to the business model. In xx minutes this scenario will show you the steps of how to wrap existing CICS/IMS programs and transactions into business components and Web services. You will then deploy and test this as CICS Web Service 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

developerWorks

ibm.com/developerWorks

About this series


Walk through this scenario and others online as part of the Enterprise Modernization Sandbox 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) to transform an existing IBM CICS COBOL program. Thereafter, you can access it as a Web service through the CICS Web Services facilities of CICS Transaction Server 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 CICS service 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 COBOLand PL/I-based business programs and applications, thereby exposing them as Web services.

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

ibm.com/developerWorks

developerWorks

The Enterprise Service Tools perspective provides views and editors that allow you to develop service flow projects and EST single-service projects (including Web services 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 Service Tools, along with other tools, such as the Service Flow features The XSE capability of Rational Developer provides tools that let you easily adapt COBOL-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 existing COBOL 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 Web service request and the parameters that are passed to the existing application. XSE supports the creation of driver programs that work with existing CICS or IMS applications. XSE consists of the following wizards: The Create New Service Interface (bottom-up) wizard that generates a new Web service interface for an existing running program. Typically, this is called a bottom-up approach, because the existing COBOL application is at the "bottom" of the new Web service creation process. This tutorial covers this capability. The Create New Service Implementation (top-down) wizard that generates a new Web service implementation template for a CICS Web Service runtime. Typically, this is called a top-down approach, because the COBOL application is created "top-down," starting from the existing Web service definition (typically, a WSDL file). The XML to COBOL mapping wizard and tools that help map existing Web service interfaces (or an XML data definition) to the existing COBOL program. The Batch processor that allows you to generate the Web service interface in unattended (batch) mode. The Batch processor currently supports the bottom-up Web services creation with compiled XML message conversion technology at runtime. The functionality provided by the Batch processor is equivalent to that of the Create new service

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

developerWorks

ibm.com/developerWorks

interface (Bottom up) wizard for compiled XML conversion. This tutorial focuses on the bottom-up approach. In this scenario, you generate a Web service description and runtime-specific XML message processing artifacts from a high-level language data structure, as shown in Figure 1. This enables you to expose 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 Transaction Server for z/OS to perform the mapping between application data structures and XML based SOAP messages. This is generated when the Web Services for CICS converter type is specified. Web Services Description Language (WSDL) file. This is an XML-based language for describing a Web service and how to access it. These are generated only if you choose the Compiled XML Conversion option instead of Interpretive XML Conversion alternative:

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

ibm.com/developerWorks

developerWorks

Web Services for CICS Driver Program. This is the COBOL program that determines how the input and output converters that interact with the existing COBOL application. CICS SOAP Inbound XML converter. This is a COBOL program that takes an incoming XML document and maps it into the corresponding COBOL data structure that the existing COBOL application expects. Outbound XML converter. This is a COBOL program that takes the COBOL data results returned from the existing COBOL application and maps them to an outbound XML document. Inbound XML schema definition (XSD). This is the XML schema that describes the incoming XML document for processing by the input converter. Outbound XML schema definition (XSD). XML schema that describes the outgoing XML document produced by the output converter. CICS Web Services Previous support for Web services in CICS Transaction Server for z/OS was provided through the SOAP for CICS feature. This support has now been fully integrated into CICS Transaction Server for z/OS, as shown in Figure 2. With this new release of CICS, applications can now act in the role of both service provider and service requester, where the services are defined using WSDL. The infrastructure provided as part of CICS Transaction Server includes a distributed transaction coordination capability compatible with the WS-Atomic Transaction specification. 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 external provider The assistant can create a WSDL document from a simple language structure, or a language structure from an existing WSDL document. It supports COBOL, C/C++, and PL/I. It also generates information used to enable automatic runtime conversion of the SOAP messages to containers and COMMAREA, and vice versa.

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

developerWorks

ibm.com/developerWorks

The XML Services for the Enterprise capability of Rational Developer for zSeries extends and complements this by providing conversion for COBOL types and constructs which are not covered natively by CICS. For example, OCCURS DEPENDING ON and REDEFINES used in data description entries are not supported by 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

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

ibm.com/developerWorks

developerWorks

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 named LAB3POT using EXEC CICS LINK via CICS COMMAREA. LAB3POT receives the customer number, reads a KSDS VSAM dataset, and sends back to the COMMAREA the data retrieved (Name, last name and address). When LAB3CLI receives 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 quite simple, using VSAM instead of IBM DB2 to simplify the deployment of the generated 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 the existing server program, as shown in Figure 4. Figure 4. Invoke the server

These are the main tasks that you will perform:

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

developerWorks

ibm.com/developerWorks

1. 2. 3. 4.

Create a Project to hold the assets. Import the COBOL program into a Web Services for CICS Project . Generate the converter driver, input and output. converters, XML schemas, WSDL, and CICS required file (WSBind). 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

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

ibm.com/developerWorks

developerWorks

3.

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

4. 5.

Close the Welcome window (Ctrl+F4). To create a CICS Web services Project, select File > New > CICS Web Services Project, as shown in Figure 8. Figure 8. Creating a CICS Web services Project

What you have done so far


You have created a Web Services for CICS project. Next, you will import the program LAB3POT into your workspace, because this program is the one that you will invoke via CICS Web Services.

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

developerWorks

ibm.com/developerWorks

6.

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

7.

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

Section 4. Import the COBOL program into a Web service for CICS Project
You will now create a Web service for your CICS project, and import the COBOL program LAB3POT and its required copybooks to this project. Note that you could do this directly from the z/OS system if you were connected to the z/OS. LAB3POT is the CICS COBOL program, which you have previously tested. This program 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 Web services dialog.

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

ibm.com/developerWorks

developerWorks

1. 2.

Click the EST Project Explorer tab to switch to the Project Explorer view. Using the Enterprise Service Tools perspective and the EST Project Explorer 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 Project Explorer view

3.

Click File System (because your file is on your workstation) and make sure that *.cbl is specified in the Files of type field, as shown in Figure 11.

Figure 11. Step 2: Using the Enterprise Service Tools Perspective and the EST Project 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

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

developerWorks

ibm.com/developerWorks

5.

Verify that the program to be imported is correct, and then click Finish, as shown in Figure 13.

Figure 13. Verify the program

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

ibm.com/developerWorks

developerWorks

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. In the Files of type field, click the drop-down list and select *.cpy, as shown in Figure 14. Copybook FAQs
Q: How do I find the required COPYBOOKS used in the COBOL code?' A: If you import your code from the z/OS (remote), you can determine the required copybooks in Rational Developer for System z by using the Check Dependencies capability. Q: Can I use just the DFHCOMMAREA copybook instead of the

7.

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

developerWorks

ibm.com/developerWorks

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 01 level (or 77 levels). You do not need to have the whole program, and the wizard can accept only the data structure that has the DFHCOMMAREA (or container). However, if you do decide to use a program, then it must be complete (with all copybooks). This tutorial uses the complete program so that you can understand it. In this case you will need all of the required copybooks, otherwise the wizard will flag the compile errors. You can also change More COBOL Options by selecting Windows > Preferences > Importer > COBOL if you need extensions other than *.cpy for the data structure.

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

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

ibm.com/developerWorks

developerWorks

9.

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

Figure 16. Verifying the copybooks

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

developerWorks

ibm.com/developerWorks

10. The imported code should appear as shown in Figure 17. What you have done so far
You have created a project to hold the Web Services components and imported the LAB3POT program and its components to this project. Now you are ready to start the Web services wizards that will generate the necessary components to create the CICS Web Services.

Figure 17. The imported code

11. Note that you have imported the COBOL program LAB3POT and two copybooks. This is the program that is invoked by the client COBOL, and that 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).

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

ibm.com/developerWorks

developerWorks

Section 5. Generate the required elements


Now you need to generate the converter driver, input and output converters, XML schemas, WSDL, and the required CICS file (WSBind). 1. Right-click the LAB3POT.cbl program under the Lab3_CICS_Services project and select Generate Web Services for CICS resources, as shown in Figure 19.

This will launch the Web Service Runtime and Scenario Selection dialog, where you can specify the necessary options to start the Web service wizard. Because you are starting from the COBOL program to create the Web services, this is 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 of Compiled XML Conversion.

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

developerWorks

ibm.com/developerWorks

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 types


There are two conversion types available for this scenario and runtime combination. You may select either Compiled XML Conversion or Interpretive XML Conversion from the Web Service Runtime and Scenario Selection dialog. The choice of conversion type involves considering the benefits and cost of either technology. Compiled XML Conversion. A driver program interacts with the runtime and invokes bundled programs to provide conversion of XML to and from language structures. The compiled XML conversion type provides more extensive support for language structure data types and constructs than the interpretive XML conversion type; however, you have to compile XML Converters, and there are more artifacts to manage. Interpretive XML Conversion: XML conversion is accomplished using generated metadata and an XML conversion component built into the runtime. Although the Interpretive XML Conversion type has limited support for language structure data types and constructs, it requires fewer artifacts and does not require you to compile XML converters.

4.

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

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

ibm.com/developerWorks

developerWorks

5.

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

Figure 21. Expanding DFHCOMMAREA

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

developerWorks

ibm.com/developerWorks

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

ibm.com/developerWorks

developerWorks

6.

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

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

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

developerWorks

ibm.com/developerWorks

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

ibm.com/developerWorks

developerWorks

7. 8.

On the Generation Options page, make sure that the XML Converter tab is selected. Type LAB324 as the Converter program name prefix (instead of LAB3POT), as shown in Figure 23.

Figure 23. Specify the identification attributes

9.

Select the WSDL and XSD tab and specify the following as the endpoint URI, as shown in Figure 24: http://zserveros.dfw.ibm.com:3091/wdz/LAB3POT You can copy this from the file located at C:\RDz_POT_V7\LAB3\Lab3_CICS_Services_URI.txt . This will be the TCP/IP address that is used to reach the target CICS system where the conversion 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 Web Services is 3091.

Figure 24. Specifying the WSDL properties

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

developerWorks

ibm.com/developerWorks

10. Click the Advanced Options tab. 11. Expand Specify XML Schema generation options, clear Generate qualified elements in XML Schemas, and then click Next, as shown in Figure 25. (Normally you dont need to worry about this choice, but you

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

ibm.com/developerWorks

developerWorks

will invoke a CICS Web service deployed with Rational Developer for System 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.

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

developerWorks

ibm.com/developerWorks

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

Can I use CHANNEL instead of COMMAREA to avoid the 32K limit?


Yes. CICS v3 and later allows the use of a channel (container) that solves the infamous 32K limit. The program interface can use either the COMMAREA or the new CHANNEL support in CICS. If the CICS application program communicates through a channel, you must specify the container name.

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

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

ibm.com/developerWorks

developerWorks

Converters tab, make sure that LAB324D is specified as the Converter driver 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 same file. Figure 27. Selecting the Generate all to driver option

16. Select the WSDL and XSD tab. No changes are required here. Note the
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

developerWorks

ibm.com/developerWorks

WSDL and XSD (schemas) names that will be generated, as shown in Figure 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, and WSDL files. 18. After the Web Services Enablement wizard completes its generation, you
Wrap existing COBOL programs as Web Services with IBM Rational Developer for System z Page 28 of 40 Copyright IBM Corporation 1994, 2008. All rights reserved.

ibm.com/developerWorks

developerWorks

should see several additional artifacts in the LAB3_CICS_Services Project 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 based Web service. LAB324D.cbl. This is the conversion program, which is made up of the converter driver and input and output converters. LAB324I.xsd and LAB324O.xsd. These are the XML Schema Definition 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 how conversion 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 the code, as shown in Figure 30. This will help you understand the productivity that you gained from not having to develop the message converter manually. Note that LAB324D.cbl file is in fact made of multiple
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

developerWorks

ibm.com/developerWorks

programs. The main program calls the various subroutines. All will be deployed 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 as input, you need to select the compiled XML conversion type instead of the interpreted XML conversion type. When you specify the compiled conversion type, the XML parsing will be done by the COBOL converter program instead of by CICS. 21. Use Ctrl+F and find the XML Parse command. This is an example of the parsing being done by the converter, as shown in Figure 31. Note also that the converter driver for CICS Web Services is different from the driver for SOAP for CICS Version 2.2, specifically regarding its interaction with the original existing application program. The SOAP for CICS driver contains an EXEC CICS LINK to the original existing application program. The CICS Web Services driver has no call at all to that program. This is because CICS Web Services is responsible for calling that application program. If you do a search for EXEC CICS LINK you will not find any instances. What you have done so far
You have created a project to hold the Web Services components, imported the LAB3POT program, and generated the necessary components that will create the CICS Web Services. You are now ready to deploy the CICS Web Services. Note that in this case, the deployment has already been done for you: you will just test it using

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

ibm.com/developerWorks

developerWorks

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 and use the WSDL Editor to visualize the input and output messages, as shown 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

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

developerWorks

ibm.com/developerWorks

contents of the WSBind file. Note the Service Interface and Pipeline properties, 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 the CICS-based Web service
You are now ready to invoke the Web Service created on CICS. You will use the generated WSDL, and invoke the CICS Services using Rational Developer for System z. 1. Using the EST Project Explorer view, right-click LAB324.wsdl under the project LAB3_CICS-Services, and select Web Services > Test with Web Services Explorer, as shown in Figure 34.

Figure 34. Using the EST Project Explorer

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

ibm.com/developerWorks

developerWorks

2. 3.

Be patient (you are under VMWARE). After a while, the Web Services Explorer will launch in a Web Browser view, as shown in Figure 35. You may need to resize the view to see all areas of the Web Services Explorer, or you can double-click the Web Services Explorer title to display the full screen.

Figure 35. The Web Services Explorer

4.

Click the link for the LAB324Operation operation within the Actions section, (alternatively, you can click the + sign next to LAB324Binding and expand the view to display the LAB324Operation, as shown in Figure 36.

Figure 36. The LAB324 Operation

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

developerWorks

ibm.com/developerWorks

5.

Notice that the Actions section is now replaced with information about the LAB324Operation operation and the parameters that it takes. It also lists the endpoint associated with this request. Click LAB324Operation, enter a value of 4 for CustNo, and click Go to invoke the operation, as shown in Figure 37.

6.

Figure 37. Invoking the LAB324 Operation

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

ibm.com/developerWorks

developerWorks

7. 8.

Note that the message "successfully opened" displays in the Status section. Resize the Status section and you should see the results shown in Figure 38. Click Source to see the SOAP Envelopes.

Figure 38. Invoking the WSDL Operation

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

developerWorks

ibm.com/developerWorks

What you have done so far


You have generated the COBOL converter and the necessary CICS resources to invoke LAB3POT as CICS Web Services. You have tested the created Web Service.

9.

You will see the XML SOAP envelopes with the input and output messages, 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 done testing, 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.

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

ibm.com/developerWorks

developerWorks

Section 7. Solution location


If you could not complete the tutorial, do not get frustrated. If you missed one step or typed 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 at C:\RDz_POT_V7\LAB3\solution\lab3_solution.zip. Also, if you prefer, you can use the solution workspace. This workspace is located at C:\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 System z starts, as shown in Figure 40.

Figure 40. Specifying the workspace

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

developerWorks

ibm.com/developerWorks

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

ibm.com/developerWorks

developerWorks

Resources
Learn Get a more in-depth look at Rational Developer for System z by reading Using Rational 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 behind effective 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 on application development tools and middleware products from DB2, Lotus, Tivoli, and WebSphere. Discuss Participate in the discussion forum for this content.

About the author


Reginaldo Barosa Reginaldo 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 eight years ago, Reginaldo worked for 27 years for IBM Brazil. He has co-authored IBM Redbooks 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 de Tecnologia, Sao Paulo, Brazil

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

developerWorks

ibm.com/developerWorks

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

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

Potrebbero piacerti anche