Topic
6 replies Latest Post - ‏2012-12-11T01:29:31Z by cipresso
BertH
BertH
2 Posts
ACCEPTED ANSWER

Pinned topic Cobol sample CICS WEB services

‏2012-02-16T10:13:52Z |
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
    William_Yates
    2 Posts
    ACCEPTED ANSWER

    Re: Cobol sample CICS WEB services

    ‏2012-02-16T10:27:50Z  in response to BertH
    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
      JamesOGrady
      1 Post
      ACCEPTED ANSWER

      Re: Cobol sample CICS WEB services

      ‏2012-02-16T10:36:05Z  in response to William_Yates
      If you wanted CICS to store Text, Adobe Acrobat PDF Files, GIFs, MP3s, you could do this my storing the files onto zFS, create URIMAPs that pointed directly at them with the correct Media-Type. No need for a program.

      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
        BertH
        2 Posts
        ACCEPTED ANSWER

        Re: Cobol sample CICS WEB services

        ‏2012-02-16T12:27:09Z  in response to JamesOGrady
        Yes the documents are dynamically created and the number of the possibility documents is too large to generate in advance to store in a zFS.
        • SystemAdmin
          SystemAdmin
          124 Posts
          ACCEPTED ANSWER

          Re: Cobol sample CICS WEB services

          ‏2012-12-09T22:11:14Z  in response to BertH
          Hi,
          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
    cipresso
    2 Posts
    ACCEPTED ANSWER

    Re: Cobol sample CICS WEB services

    ‏2012-12-11T01:26:33Z  in response to BertH
    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.

    c:\Temp\DocumentProvider>tree /F
    C:.
    +---DocumentProvider_cbl // COBOL service provider project
    ¦ +---Generation
    ¦ ¦ +---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
    ¦ +---Source
    ¦ DOCPROVB.cbl // COBOL service provider implementation
    ¦ DOCPROVB.jcl
    ¦ 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
    ¦ +---Targets
    ¦ DOCPRI01.inc // generated PL/I request structure
    ¦ DOCPRO01.inc // generated PL/I response structure
    ¦ DOCPROVP.pli // generated PL/I service provider template
    ¦ DocumentProvider_pli.log
    ¦ DocumentProvider_pli.wsbind // generated wsbind file
    ¦
    +---Mapping
    +---Source
    DOCPROVP.pli // PL/I service provider implementation
    DOCPROVP.jcl
    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
    cipresso
    2 Posts
    ACCEPTED ANSWER

    Re: Cobol sample CICS WEB services

    ‏2012-12-11T01:29:31Z  in response to BertH
    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"?>
    <provider_pipeline xmlns="http://www.ibm.com/software/htp/cics/pipeline"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.ibm.com/software/htp/cics/pipeline provider.xsd ">
    <cics_mtom_handler>
    <dfhmtom_configuration version="1">
    <mtom_options send_mtom="yes" send_when_no_xop="yes" />
    <xop_options apphandler_supports_xop="yes" />
    <mime_options content_id_domain="example.org" />
    </dfhmtom_configuration>
    </cics_mtom_handler>
    <service>
    <terminal_handler>
    <cics_soap_1.1_handler />
    </terminal_handler>
    </service>
    <apphandler>DFHPITP</apphandler>
    </provider_pipeline>