Professional Documents
Culture Documents
IBM CICS Transaction Server for z/OS V3.2 Web Services for the Systems Programmer
Steve Zemblowski CICS Advanced Technical Support zem@us.ibm.com
IBM Corporation
Notes
When your application programmer comes up to you and says We want to do Web Services in CICS do you know what questions to ask? Do you know what resource definitions and configuration options you need to support this application request? This presentation will help you understand the questions you need to ask to determine the qualities of services for this CICS Web Services implementation. Knowing the required qualities of service required will enable you to define the appropriate CICS resources and set the correct configuration options.
Acknowledgements
The following are trademarks of International Business Machines Corporation in the United States, other countries, or both: IBM, CICS, CICS TS, CICS Transaction Server, DB2, MQ, OS/390, S/390, WebSphere, z/OS, zSeries, Parallel Sysplex. Java, and all Java-based trademarks and logos, are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both. Microsoft, Windows, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both. Other company, product, and service names and logos may be trademarks or service marks of others.
Notes
This page intentionally left blank.
Agenda
How to determine the required Qualities of Service
Questions to ask
Documentation Summary
Notes
This presentation will cover the discussion a systems programmer needs to have with the application programmers to define and configure CICS Web Services support for this specific application. There are a series of questions that must be answered to supply the information needed by the systems programmer. There are some base configuration options needed to allow CICS to support Web Services. In addition to these base options, there are unique resource definitions required for the specific CICS application. There are definitions needed for the transport (http, https or MQ), a definition to specify the quality of service for this set of web services (PIPELINE definition), a definition needed to locate the web service in CICS (URIMAP) and a definition to identify the copybook/XML transformation requirements. There is a CICS Web Services Guide included with the CICS Transaction Server 3.2 Information Center as well as two Red Books on CISC Web Services.
Implementing CICS Web Services SG24-7206 Application Development for CICS Web Services SG24-7126
CICS as provider
CICS
CICS as requester
Notes
You need to determine if this is an inbound flow to CICS or an outbound flow from CICS. There will be different resource definitions based on whether this application is a requester or provider.
If this is an existing application you will have knowledge of the performance characteristics of this application and should be able to determine whether this will fit within your existing CICS configuration. There is a CICS White paper that discusses how to size the processing requirements of a CICS Web Service application. Please refer to: ftp://ftp.software.ibm.com/software/htp/cics/txppacs/Web_Services_Performance.zip
If this application will have high availability requirements then you may have to design a CICSplex environment in which to run the application. You may have to have redundant transports to support the application.
Notes
CICS supports either HTTP/HTTPS or MQ as a base transport. To configure the transport resource definition, TCPIPSERVICE or QLOCAL, you need to understand the port numbers or Queue Names associated with the web service requests
CICS support either the 1.1 or 1.2 level of SOAP for web service processing. As part of the definition process you do need to define the level of SOAP that the application will require.
CICS can support web service requests using the Web Services Description Language 1.1 or 2.0 level. The newer level, WSDL 2.0, supports Message Exchange Patterns. Message Exchange Patterns enforce the specified flows between requester and providers. In some cases, the provider will respond to the requester ONLY if an error occurs. As part of the definition process you will need to know how long to wait for an error to occur before proceeding.
10
11
Notes
You need to understand the recovery/restart requirements of the CICS web service application. Is this a simple inquiry requests or are resources updated by both the requester and the provider? These requirements will determine how you configure the CICS web service support.
Applications today are sending/receiving large objects such as identification photos, fingerprints, engineering diagrams using web services. Prior to CICS TS 32 these objects were included in the message and encoded in base64. In CICS TS 32, there is support for Message Transmission Optimization Mechanism and XML Optimized Packaging to make the transport and processing of these large objects more efficient. These objects can be a passed directly to the application in binary form or encoded as a base64 variable length field in the message.
The payload of the request is in XML format. A new application could be written to handle the XML message directly. When reusing an existing application CICS facilities can parse the XML message and place the information into a copybook for use by the application.
12
13
Notes
How will the user identify be established for authentication and authorization?
One of the more important topics of discussion is security. That is how is the user identification established, authenticated and then how does authorization take place in CICS. There are a number of options available to CICS Web Services from no security to using a security token service, such as TFIM to validate and issue security tokens for use by CICS.
There are a number of places where the XML message can be viewed, changed or rejected prior to the application program getting control. In some installations all inbound and outbound requests are logged. This can be accomplished in a message handler.
Some web service applications place control information in the SOAP header. These SOAP headers can be processed by prior to the application getting control or after the application has constructed an outgoing message. In the past some clients placed user identification (e.g. USERID) information in the SOAP header. Application processing information should not be placed in the SOAP header.
14
15
Notes
PL/I support is also required if you use the Web services support in CICS; in particular, it is required if you use the CICS-supplied SOAP 1.1 and SOAP 1.2 message handler programs.
You must enable the z/OS conversion services and install a conversion image that specifies the data conversions that you want CICS to perform between SOAP messages and an application program. For more information, see z/OS Support for Unicode: Using Conversion Services.
The CICS transactions and programs to support web services are in group DFHPIPE. Make sure this is installed as part of your startup list.
16
CICS TS V3
CPIH
Pipeline
CSOL
Service Requester
CWXN
HTTP transport
handlers
HFS
pipeline config WSDL
CICS Web services assistant
handlers dynamic install handlers PIPELINE data mapping dynamic install Business Logic
17
Notes
This diagram shows the CICS components and resource definitions involved in a web service request when CICS is the service provider. The highlighted areas are the responsibility of the CICS systems programmer. There are new and existing resource definitions used to process a web service request
There is a new pipeline configuration file used to control the activities as CICS process the SOAP request. There are new message handler and SOAP header handler programs to augment the standard processing options.
18
TCPIPSERVICE CSOL
CICS TS V3
Service Requester
MQ
SOAP message
QLOCAL CKTI
CICS TS V3
Service Requester
19
Notes
This chart shows the components involved in listening for a web service request to enter CICS over HTTP or MQ.
20
21
Notes
A TCPIPSERVICE definition is required when CICS is the service provider and the chosen transport is HTTP. That is, the TCPIPSERVICE definition is only required for inbound requests. When a TCPIPSERVICE definition is used with protocol HTTP, the URIMAP definitions will be matched against the URI. If a match is found (it better be for Web Services) then some parameters will be taken from the URIMAP definition instead of the TCPIPSERVICE definition.
22
23
Notes
1.
A local WebSphere MQ queue definition is required when CICS is the service provider and the chosen transport is WMQ.
Define an initiation queue. Use the following command: DEFINE QLOCAL('initiation_queue') DESCR('description') where initiation_queue is the same as the value specified in IQ= in DFHMQPRM in the INITPARM system initialization parameter. For each local request queue, define a QLOCAL object. Use the following command: DEFINE QLOCAL('queuename') DESCR('description') PROCESS(processname) INITQ('initiation_queue') TRIGGER TRIGTYPE(FIRST) TRIGDATA('default_target_service') BOTHRESH(nnn) BOQNAME('requeuename')
2.
where: queuename is the local queue name. processname is the name of the process instance that identifies the application started by the queue manager when a trigger event occurs. Specify the same name on each QLOCAL object. initiation_queue is the name of the initiation queue to be used (e.g. as specified in IQ= in the DFHMQPRM INITPARM system initialization parameters for Websphere MQ). default_target_service is the default target service to be used if a service is not specified on the request . The target service is of the form '/string' and is used to match the path of a URIMAP definition. for example '/SOAP/test/test1'. Note that the first character must be '/' . nnn is the number of retries that will be attempted. requeuename is the name of the queue to which failed messages will be sent. 3. Define a PROCESS object that specifies the trigger process. Use the following command: DEFINE PROCESS(processname) APPLTYPE(CICS) APPLICID(CPIL) where: processname is the name of the process, and must be the same as the name that is used when defining the request queues. 24
CICS TS V3
CSOL
Service Requester
CWXN
QLOCAL
SOAP message
CICS TS V3
CKTI CPIL
Service Requester
25
Notes
This chart shows the URIMAP matching process.
26
CICS
HFS
config
dynamic install PIPELINE CONFIGFILE SHELF WSDIR dynamic install WEBSERVICE PIPELINE WSBIND WSDLFILE
WSDL
27
Notes
This chart shows the interrelationships between the CICS resource definitions necessary to support Web Services. The CICS WSDL utility will produce a WSDL file from a language structure (copybook) or a language structure from WSDL. As part of the generation process a Web Services Binding file (WSBIND) will be produced. The WSBIND file contains information about the CICS program to be invoked, the name of the WSDL file, the local URI and information necessary to populate a COMMAREA from XML and vice versa. Both the WSBIND and the WSDL file will be used by the executing CICS region. The URIMAP definition will name both the PIPELINE definition and the WEBSERVICE definition. Optionally, the URIMAP can specify an installed TCPIPSERVICE name to restrict the matching to information for the specific port named in that resource definition. The PIPELINE resource definition will copy installed WEBSERVICE definitions to its SHELF. The WEBSERVICE definitions can be dynamically created through the use of the pick-up directory (WSDIR). The WEBSERVICE definition will name the PIPELINE definition that contains the configuration information (CONFIGFILE) on which message handlers are invoked when processing this Web Service.
28
29
Notes
The URIMAP definition is used to match a URI to a WEBSERVICE definition and a PIPELINE definition. You should have a unique URI for each Web Service that you want to use in CICS. The parameters that apply to a Web Service form of the URIMAP are: USAGE (PIPELINE): This indicates that the URIMAP definition is applicable to a web service and that the PIPELINE and WEBSERVICE parameters must be specified. The SCHEME, HOST and PATH values must be specified to allow matching of the URI. A URI, such as,http://www.mycics.co.uk/webservice would be decomposed to SCHEME (http), HOST (www.mycics.co.uk) and PATH (webservice) TCPIPSERVICE is optional on the URIMAP definition for USAGE (PIPELINE). If a named TCPIPSERVICE is specified then only requests from that specific port will be matched against this URIMAP definition. The PIPELINE parameter names an installed PIPELINE resource which will be used to determine the processing nodes or message handlers that will be invoked for this Web Service request. The WEBSERVICE parameter names an installed WEBSERVICE requests that defines the execution environment that lets a CICS application program operate as a Web service provider or requester. The TRANSACTION parameter specifies the 1-4 character name of an alias transaction that is to be used to run the user application that composes a response to the web service request.
30
HFS
handlers pipeline config WSDL PIPELINE WSBind WEBSERVICE handlers
Application Handler Target Program
URIMAP handlers
31
Notes
The chart shows an example of the pipeline flow.
32
HFS file that contains information about the processing nodes that will act on a service request and on the response
SHELF
33
Notes
A PIPELINE resource definition is used when a CICS application is in the role of a Web service provider or requester. It provides information about the processing nodes which will act on a service request and on the response. Typically, a single PIPELINE definition defines an infrastructure that can be used by many applications. There will be separate configuration files for CICS applications acting as a service provider and service requester. The information about the processing nodes is supplied indirectly: the PIPELINE specifies the name of an HFS configuration file (CONFIGFILE) which contains an XML description of the nodes and their configuration. The SHELF is an HFS directory where CICS will copy information about installed Web Services. CICS regions into which the PIPELINE definition is installed must have full permissions to the shelf directory--read, write, and the ability to create subdirectories. A single shelf directory may be shared by multiple CICS regions and by multiple PIPELINE definitions. Within a shelf directory, each CICS region uses a separate subdirectory to keep its files separate from those of other CICS regions. Within each region's directory, each PIPELINE uses a separate subdirectory. After a CICS region performs a cold or initial start, it deletes its subdirectories from the shelf before trying to use the shelf. You should not attempt to modify the contents of a shelf that is referred to by an installed PIPELINE definition. If you do, the effects are unpredictable The Web service binding directory (WSDIR) contains Web service binding files that are associated with a PIPELINE, and that are to be installed automatically by the CICS scanning mechanism. When the PIPELINE definition is installed, CICS scans the directory and automatically installs any Web service binding files it finds there. Note that this happens regardless of whether the PIPELINE is installed in enabled or disabled state. A CEMT PERFORM PIPELINE SCAN command can be used to force CICS to scan the Web Service binding directory. An inbound Web service request (that is, a request by which a client invokes a Web service in CICS) is associated with a PIPELINE resource by the URIMAP resource. The URIMAP identifies the PIPELINE resource that applies to the URI associated with the request; the PIPELINE specifies the processing that is to be performed on the message.
34
Notes
The Pipeline configuration file, named in a PIPELINE resource definition, is used to describe the series of message handlers (i.e. the pipeline) to process the request. The configuration file is an XML document, stored in HFS and can be edited with any XML editor. The configuration file will contain mandatory <service> and optional <transport> elements along with application handler <apphandler> and a service parameter list <service_parameter_list>. Different applications will require different configuration files. There are different pipeline configurations necessary for a service provider and service requester as well as different configurations for processing SOAP 1.1 and 1.2 messages. CICS provides the configuration files necessary for CICS to function as both a service requester and a service provider handling both SOAP 1.1 and 1.2 messages. The configuration file can also be used to add your own user message handlers. An example would be a user message handler to extract user identification from the message to determine which USERID and transaction id should be used to process the message.
36
Pipeline Controller
C H A N N E L
handler apphandler
Notes
This chart shows an example of a pipeline configuration file along with the flow thru a set of message handlers.
38
PIPELINE
Name of the pipeline where this WEBSERVICE is to be installed
WSBIND
HFS name of the WS Binding file
WSDLFILE
HFS name of the WSDL file
VALIDATION
Run time SOAP message validation against WSDL schema
39
Notes
A WEBSERVICE resource defines the execution environment that lets a CICS application program operate as a Web service provider or requester. The Web service interaction in which the CICS application participates uses SOAP messaging, and is formally described with Web service description language (WSDL). The execution environment contains three components that are specified in the WEBSERVICE attributes: A pipeline A Web service binding file A Web service description Although CICS provides the usual resource definition mechanisms for creating WEBSERVICE resources, and installing them in your CICS region, there is an alternative strategy which you can use. You can use the scanning mechanism to install WEBSERVICE resources in your running CICS region. Validation: Specifies whether full validation of SOAP messages against the corresponding schema in the Web service description should be performed at run-time. Validating a SOAP message against its schema incurs considerable processing overhead, and you should normally specify VALIDATION(NO). Full validation ensures that all SOAP messages which are sent and received are valid XML with respect to the XML schema. If VALIDATION(NO) is specified, sufficient validation is performed to ensure that the message contains well-formed XML.
40
41
Notes
Setting up the CICS resources is not as difficult as it might seem. It is only necessary to define the TCPIPSERVICE (or WMQ) and the PIPELINE. Place the WSBind file generated from the batch tooling into the HFS directory specified in the PIPELINE definition. Then either issue a CEMT PERFORM PIPELINE SCAN command or definition the WEBSERVICE and URIMAP definitions individually. The PIPELINE definition contains the directory name where the WSBind file can be found. From the WSBind file, CICS will dynamically create the Web Service resource definition. This provides CICS with enough information to be able dynamically to create a URIMAP definition as well. So, as long as you create a valid PIPELINE definition and put the WSBind file in the correct location, CICS will do the rest.
42
Request Streams are used to communicate between the two tasks Used by WS-AT support to persist the application task
43
Notes
When the terminal handler of a service provider pipeline is one of the CICS-supplied SOAP message handlers, the target application handler program specified in container DFHWS-APPHANDLER is, in some cases, eligible for dynamic routing. All pipeline processing prior to the application handler program is always performed locally in the CICS region that received the SOAP message. The second task runs under the transaction specified in the DFHWS-TRANID container. This task switch provides an opportunity for dynamic routing to take place, but only if MRO is used to connect the CICS regions together. In addition, the CICS region that you are routing to must support channels and containers.
44
Context Switching
When the terminal handler is a CICS SOAP Handler it is possible to context switch the Application Handler If DFHWS-TRANID or DFHWS-USERID have been changed from the default then the new values will be used for a new task to run the business logic If the values are unchanged the logic would run in the pipeline task as normal
handler
Pipeline Controller
handler
handler
C H A N N E L
handler
handler
handler
handler
Pipeline-specified Context
45
Notes
The transaction that runs the target application handler program is eligible for routing when one of the following is true: - The transaction under which the pipeline is processing the message is defined as DYNAMIC or REMOTE. This transaction is defined in the URIMAP that is used to map the URI from the inbound SOAP message. - A program in the pipeline has changed the contents of container DFHWS-USERID from its initial value. - A program in the pipeline has changed the contents of container DFHWS-TRANID from its initial value. - A WS-AT SOAP header exists in the inbound SOAP message. - An eWLM ARM correllator SOAP header exists in the inbound SOAP message.
46
User Transaction
Business Logic
EXEC CICS INVOKE WEBSERVICE
HFS
WEBSERVICE dynamic install PIPELINE handlers pipeline config handlers WSDL WSBind
CICS Web services assistant
47
Notes
This diagram shows the CICS components and resource definitions involved in a web service request when CICS is the service requester. The highlighted areas are the responsibility of the CICS systems programmer. There are new and existing resource definitions used to process a web service request
PIPELINE WEBSERVICE
There is a new pipeline configuration file used to control the activities as CICS process the SOAP request. There are new message handler and SOAP header handler programs to augment the standard processing options.
48
HFS
config PIPELINE CONFIGFILE SHELF WSDIR dynamic install WEBSERVICE PIPELINE WSBIND WSDLFILE
WSDL
49
Notes
This chart shows the interrelationships between the CICS resource definitions necessary to support Web Services. The CICS WSDL utility will produce a WSDL file from a language structure (copybook) or a language structure from WSDL. As part of the generation process a Web Services Binding file (WSBIND) will be produced. The WSBIND file contains information about the CICS program to be invoked, the name of the WSDL file, the local URI and information necessary to populate a COMMAREA from XML and vice versa. Both the WSBIND and the WSDL file will be used by the executing CICS region. The PIPELINE resource definition will copy installed WEBSERVICE definitions to its SHELF. The WEBSERVICE definitions can be dynamically created through the use of the pick-up directory (WSDIR). The WEBSERVICE definition will name the PIPELINE definition that contains the configuration information (CONFIGFILE) on which message handlers are invoked when processing this Web Service.
50
HFS file that contains information about the processing nodes that will act on a service request and on the response
SHELF
51
Notes
A PIPELINE resource definition is used when a CICS application is in the role of a Web service provider or requester. It provides information about the processing nodes which will act on a service request and on the response. Typically, a single PIPELINE definition defines an infrastructure that can be used by many applications. There will be separate configuration files for CICS applications acting as a service provider and service requester. The information about the processing nodes is supplied indirectly: the PIPELINE specifies the name of an HFS configuration file (CONFIGFILE) which contains an XML description of the nodes and their configuration. The SHELF is an HFS directory where CICS will copy information about installed Web Services. CICS regions into which the PIPELINE definition is installed must have full permissions to the shelf directory--read, write, and the ability to create subdirectories. A single shelf directory may be shared by multiple CICS regions and by multiple PIPELINE definitions. Within a shelf directory, each CICS region uses a separate subdirectory to keep its files separate from those of other CICS regions. Within each region's directory, each PIPELINE uses a separate subdirectory. After a CICS region performs a cold or initial start, it deletes its subdirectories from the shelf before trying to use the shelf. You should not attempt to modify the contents of a shelf that is referred to by an installed PIPELINE definition. If you do, the effects are unpredictable The Web service binding directory (WSDIR) contains Web service binding files that are associated with a PIPELINE, and that are to be installed automatically by the CICS scanning mechanism. When the PIPELINE definition is installed, CICS scans the directory and automatically installs any Web service binding files it finds there. Note that this happens regardless of whether the PIPELINE is installed in enabled or disabled state. A CEMT PERFORM PIPELINE SCAN command can be used to force CICS to scan the Web Service binding directory. An inbound Web service request (that is, a request by which a client invokes a Web service in CICS) is associated with a PIPELINE resource by the URIMAP resource. The URIMAP identifies the PIPELINE resource that applies to the URI associated with the request; the PIPELINE specifies the processing that is to be performed on the message.
52
<service> <service_handler_list> : <cics_soap_1.1_handler/> : </service_handler_list> </service> <transport> : </transport> <service_parameter_list /> </requester_pipeline>
Pipeline Controller
handler
handler handler
C H A N N E L Transport
handler
handler handler
53
Notes
This chart illustrates the flow of the message handler invocations when CICS is a service requester.
54
MQ
Define the reply-to queue
55
Notes
When using http or http as the outbound transport no definition is required in CICS. When using MQ as the outbound transport the reply-to queue must be known to the local queue manager.
56
PIPELINE
Name of the pipeline where this WEBSERVICE is to be installed
WSBIND
HFS name of the WS Binding file
WSDLFILE
HFS name of the WSDL file
VALIDATION
Run time SOAP message validation against WSDL schema
57
Notes
A WEBSERVICE resource defines the execution environment that lets a CICS application program operate as a Web service provider or requester. The Web service interaction in which the CICS application participates uses SOAP messaging, and is formally described with Web service description language (WSDL). The execution environment contains three components that are specified in the WEBSERVICE attributes: A pipeline A Web service binding file A Web service description Although CICS provides the usual resource definition mechanisms for creating WEBSERVICE resources, and installing them in your CICS region, there is an alternative strategy which you can use. You can use the scanning mechanism to install WEBSERVICE resources in your running CICS region. Validation: Specifies whether full validation of SOAP messages against the corresponding schema in the Web service description should be performed at run-time. Validating a SOAP message against its schema incurs considerable processing overhead, and you should normally specify VALIDATION(NO). Full validation ensures that all SOAP messages which are sent and received are valid XML with respect to the XML schema. If VALIDATION(NO) is specified, sufficient validation is performed to ensure that the message contains well-formed XML.
58
Configuration file . . . . . . : /usr/lpp/cicsts/pipeline/configs/registrationserviceREQ.xml Shelf directory. . . . . . . . : WSDIR pickup directory . . . . : PIPELINE use count . . . . . . : 0 /var/cicsts/
59
Notes
This is a sample statistics report showing the new Pipeline section.
60
61
Notes
This is a sample statistics report showing the new Web Services section.
62
63
Notes
340 (TYPE-A, 'WBIWBSCT', 4 BYTES) The number of CICS Invoke web service requests issued by the user task
64
Documentation
CICS Web Services Guide SC34-6838 WebSphere MQ Transport for SOAP SC34-6651 CICS TS Web Services Performance
ftp://ftp.software.ibm.com/software/htp/cics/txppacs/Web_Services_Performance.zip
Red Books
SG24-7206 SG24-7126
65
Notes
References to additional documentation.
66
Summary
CICS Support of Web Services
Allows for re-use of existing business assets
No change to application code
67
Notes
References to additional documentation.
68