Pinned topic Cobol sample CICS WEB services
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
I try to develop a CICS WEB Services in Cobol which will return a TXT or PDF document. To start with this I’m looking for a sample Cobol CICS program. The system is a z/10 with z/OS 1.11 and CICS TS 4.1.
Updated on 2012-12-11T01:29:31Z at 2012-12-11T01:29:31Z by cipresso
William_Yates 27000096YE2 Posts
Re: Cobol sample CICS WEB services2012-02-16T10:27:50ZThis is the accepted answer. This is the accepted answer.You could do what you require using MTOM/XOP web services. However it might be easier to use the CICS WEB (not web services) function. I'm not sure if I have any programs that could help but I will have a look and see what I can find
JamesOGrady 06000200WX1 Post
Re: Cobol sample CICS WEB services2012-02-16T10:36:05ZThis is the accepted answer. This is the accepted answer.
- William_Yates 27000096YE
Or you could use Doctemplates to do the same thing (still no need for a program).
Is the data being sent back dynamically created?
BertH 0100002AMU2 Posts
Re: Cobol sample CICS WEB services2012-02-16T12:27:09ZThis is the accepted answer. This is the accepted answer.
- JamesOGrady 06000200WX
SystemAdmin 110000D4XK124 Posts
Re: Cobol sample CICS WEB services2012-12-09T22:11:14ZThis is the accepted answer. This is the accepted answer.
- BertH 0100002AMU
I am struggling with the similar question for PL/1. For a project, I have a requirement in which we need to write a PL/1 SOAP requester in CICS that sends a binary attachment. We are on CICS TS 4.2. Anyone that knows where we can find a PIPELINE configuration example or a PL/1 example that sends a tekst file from a zFS using the MTOM/XOP mechanism? Anyone that ever has seen this for COBOL?
William, what do you mean that it could be simpler by using the CICS WEB functions?
For the moment, I have the feeling that Java has much better support for this?
cipresso 100000QUKJ2 Posts
Re: Cobol sample CICS WEB services2012-12-11T01:26:33ZThis is the accepted answer. This is the accepted answer.Hi Bert.
Using the MTOM/XOP support in CICS, it is possible to receive/transmit binary objects as part of a SOAP message.
The way to do this is to create a WSDL where each binary object you return is of type xs:base64Binary.
When you supply this WSDL as input to DFHWS2LS, it will generate a COBOL/PL/I structure that expects containers for the binary objects.
I've created working examples (coded in both COBOL and PL/I) that demonstrate returning a canned PDF to the client as part of the response.
To run the examples you will need to define a CICS pipeline with MTOM-XOP enabled.
The zip file I've attached contains 2 Enterprise Service Tools projects one for COBOL and one for PL/I.
+---DocumentProvider_cbl // COBOL service provider project
¦ ¦ +---Targets
¦ ¦ DOCPRI01.cpy // generated COBOL request structure
¦ ¦ DOCPRO01.cpy // generated COBOL response structure
¦ ¦ DOCPROVB.cbl // generated COBOL service provider template
¦ ¦ DocumentProvider_cbl.log
¦ ¦ DocumentProvider_cbl.wsbind // generated wsbind file
¦ DOCPROVB.cbl // COBOL service provider implementation
¦ DocumentProvider.wsdl // the WSDL defining the service
¦ RFC3548.cpy // the bytes of the PDF file rfc3548.pdf
¦ rfc3548.pdf // the file that RFC3548.cpy was created from
+---DocumentProvider_pli // PL/I service provider project
¦ DOCPRI01.inc // generated PL/I request structure
¦ DOCPRO01.inc // generated PL/I response structure
¦ DOCPROVP.pli // generated PL/I service provider template
¦ DocumentProvider_pli.wsbind // generated wsbind file
DOCPROVP.pli // PL/I service provider implementation
DocumentProvider.wsdl // the WSDL defining the service
RFC3548.inc // the bytes of the PDF file rfc3548.pdf
rfc3548.pdf // the file that RFC3548.inc was created from
cipresso 100000QUKJ2 Posts
Re: Cobol sample CICS WEB services2012-12-11T01:29:31ZThis is the accepted answer. This is the accepted answer.Unfortunately I can only attach one file per post, so here's the pipeline configuration you will need to run the examples.
<?xml version="1.0" encoding="EBCDIC-CP-US"?>
xsi:schemaLocation="http://www.ibm.com/software/htp/cics/pipeline provider.xsd ">
<mtom_options send_mtom="yes" send_when_no_xop="yes" />
<xop_options apphandler_supports_xop="yes" />
<mime_options content_id_domain="example.org" />