Invoking a Web Service from an IMS Application - IMS UG October 2012 Boston
Upcoming SlideShare
Loading in...5
×
 

Invoking a Web Service from an IMS Application - IMS UG October 2012 Boston

on

  • 381 views

 

Statistics

Views

Total Views
381
Views on SlideShare
381
Embed Views
0

Actions

Likes
0
Downloads
5
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Invoking a Web Service from an IMS Application - IMS UG October 2012 Boston Invoking a Web Service from an IMS Application - IMS UG October 2012 Boston Presentation Transcript

  • Invoking a Web Service from an IMS Application IMS User GroupSteve Nathansnathan@us.ibm.com ©2012 IBM Corporation
  • IMS Regional User GroupDisclaimer © Copyright IBM Corporation [current year]. All rights reserved. U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. WHILE EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION CONTAINED IN THIS PRESENTATION, IT IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. IN ADDITION, THIS INFORMATION IS BASED ON IBM’S CURRENT PRODUCT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM WITHOUT NOTICE. IBM SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION. NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO, NOR SHALL HAVE THE EFFECT OF, CREATING ANY WARRANTIES OR REPRESENTATIONS FROM IBM (OR ITS SUPPLIERS OR LICENSORS), OR ALTERING THE TERMS AND CONDITIONS OF ANY AGREEMENT OR LICENSE GOVERNING THE USE OF IBM PRODUCTS AND/OR SOFTWARE.IBM, the IBM logo, ibm.com, and IMS are trademarks or registered trademarks of International BusinessMachines Corporation in the United States, other countries, or both. If these and other IBM trademarked termsare marked on their first occurrence in this information with a trademark symbol (® or ™), these symbolsindicate U.S. registered or common law trademarks owned by IBM at the time this information was published.Such trademarks may also be registered or common law trademarks in other countries. A current list of IBMtrademarks is available on the Web at “Copyright and trademark information” atwww.ibm.com/legal/copytrade.shtml Invoking a Web Service from an IMS Application 2
  • IMS Regional User GroupAcknowledgement This presentation was originally prepared by Ken Blackman – IBM Advanced Technical Solutions (ATS) – kblackm@us.ibm.com Invoking a Web Service from an IMS Application 3
  • IMS Regional User GroupAgenda Introduction Asynchronous Callout – IMS ALTPCB – WebSphere MQ Using ESAF – APPC/IMS Synchronous Callout – IMS ICAL – DB2 Stored Procedures – DB2 Attach Facility – WebSphere MQ Using ESAF – CPI-C/APPC – RYO Using TCP/IP Invoking a Web Service from an IMS Application 4
  • IMS Regional User GroupIntroduction – Web ServiceDefinition UDDI – Standards based Registry Service type of service Broker – Software component publish find WSDL (callable piece of WSDL code) that is capable IMS of being access Service bind, invoke Service (described, Provider Requester published, and Web Service SOAP Client Application located) via standard network protocols such as SOAP over The entire industry is agreeing HTTP on one set of standards !! • Independent of 3 basic components: platforms or - Service Provider programming - Service Broker language - Service Requestor Invoking a Web Service from an IMS Application 5
  • IMS Regional User GroupIntroduction – Callout Techniques IMS applications can code communication API calls – DL/I ISRT ALTPCB – DL/I ICAL – SQL calls to DB2 stored procedures – WebSphere MQ calls – CPI-C/APPC calls – TCP/IP sockets calls Invoking a Web Service from an IMS Application 6
  • IMS Regional User Group Introduction – Asynchronous ModelCLIENT IMS Application MSG-Q CLIENT MSG-Q IMS/non-IMS GU IOPCB READ_DATA READ_DATA SEND_DATA Message+Token Message+appl-token Message+Token Message+Token UOW1 PROCESS_DATA PROCESS_DATA IMS Application MSG-Q GU IOPCB MSG-Q SEND_DATA Reply+Token SEND_DATA Reply+Token Reply+Token Message+appl-token ISRT ALTPCB to CLIENT TWO IMS Units of Work (UOW) UOW2 Invoking a Web Service from an IMS Application 7
  • IMS Regional User GroupIntroduction – Synchronous ModelCLIENT CLIENT MSG-Q IMS Application IMS/non-IMS GU IOPCB Message READ_DATA Message SEND_DATA Message PROCESS_DATA READ_with_WAIT Reply SEND_DATA Reply MSG-Q RECEIVE REPLY ISRT IOPCB to CLIENT UOW1 ONE IMS Unit of Work (UOW) Invoking a Web Service from an IMS Application 8
  • IMS Regional User GroupIntroduction – Service Flow Concept CLIENT Program A Program n Invoking a Web Service from an IMS Application 9
  • IMS Regional User GroupIntroduction – Stored Procedure ConceptCLIENT Stored Procedure Get Data 1 Get Data 2 Invoking a Web Service from an IMS Application 10
  • IMS Regional User GroupIntroduction – Callout Destinations IMS TM Resource Adapter via IMS Connect z/OS1 IMS XCF Windows / AIX / Solaris / IMS Linux Connect and z/OS WebSphere IMS Application IMS Connect Server IMS Resource z/OS2 Adapter WebSphere Application IMS IMS Server Connect IMS Resource Adapter Linux for System z TCP/IP WebSphere Application Server XCF IMS Resource Adapter Local Invoking a Web Service from an IMS Application 11
  • IMS Regional User GroupIntroduction – Callout Destinations IMS SOAP Gateway via IMS Connect Windows, AIX,zLinux z/os IMS Web Service Clients, SOAP IMS e.g. Microsoft .Net, SAP, Java, etc.. SOAP IMS Gateway Connect IMS OTMA XML XML App Adapter OTMA XML DB Web Service Clients, SOAP e.g. Microsoft .Net, IMS SAP, Java, etc.. SOAP Gateway Invoking a Web Service from an IMS Application 12
  • IMS Regional User GroupIntroduction – Callout Destinations IMS SOAP Gateway via IMS Connect (Call In) SOAP XML Byte array <?xml version="1.0"?> <soap:Envelope> <INPUTMSG> <soap:Body> <in_ll>32</in_ll><in_zz>0</in_zz> <INPUTMSG> <in_trcd>IVTNO</in_trcd> <in_ll>32</in_ll><in_zz>0</in_zz> <in_cmd>DISPLAY</in_cmd> <in_trcd>IVTNO</in_trcd> <in_name1>LAST1</in_name1> Connect IMS <in_cmd>DISPLAY</in_cmd> </INPUTMSG> <in_name1>LAST1</in_name1> 32 0IVTNO DISPLAY LAST1 </INPUTMSG> </soap:Body> Adapter </soap:Envelope> IMS SOAP Task Gateway Manager IMS Microsoft HTTP/SOAP TCP/IP App .NET Client IMS Web Service XML Adapter<?xml version="1.0"?> 93 0<soap:Envelope> ENTRY WAS DISPLAYED <soap:Body> <cbl:OUTPUTMSG> DISPLAY <cbl:OUTPUTMSG> <out_ll>93</out_ll><out_zz>0</out_zz> LAST1 FIRST1 <out_ll>93</out_ll><out_zz>0</out_zz> <out_msg>ENTRY WAS DISPLAYED</out_msg> 8-111-11111 <out_msg>ENTRY WAS DISPLAYED</out_msg> <out_cmd>DISPLAY</out_cmd> D01/R01 0001 <out_cmd>DISPLAY</out_cmd> <out_name1>LAST1</out_name1> <out_name2>FIRST1</out_name2> XML <out_name1>LAST1</out_name1> <out_name2>FIRST1</out_name2> <out_extn>8-111-1111</out_extn> Converters <out_extn>8-111-1111</out_extn> <out_zip>D01/R01</out_zip> <out_zip>D01/R01</out_zip> <out_segno>0001</out_segno> <out_segno>0001</out_segno> </cbl:OUTPUTMSG> </cbl:OUTPUTMSG> </soap:Body></soap:Envelope> Invoking a Web Service from an IMS Application 13
  • IMS Regional User GroupAsynchronous Callout –IMS ALTPCB IMS DL/I API call – CHNG, ISRT, PURG to ALTPCB Provides for program-to-program communication – Workflow model Destination can be – Another IMS transaction – An OTMA Client • IMS Connect – RYO including IMS Connect API – IMS TM Resource Adapter in a JEE environment – IMS SOAP Gateway • WebSphere MQ • OTMA C/I – APPC/IMS Applications manage the response correlation There is no coordinated commit Invoking a Web Service from an IMS Application 14
  • IMS Regional User GroupAsynchronous Callout –IMS ALTPCB to IMS ApplicationCLIENT IMS Application 1 MSG-Q IMS Application Service MSG-Q GU IOPCB ISRT ALTPCB to Message+Token IMS Application 2 IMS Application 2 Message+Token GU IOPCB Message+Token UOW1 ISRT ALTPCB to IMS Application 3 IMS Application 3 Reply+Token MSG-Q GU IOPCB MSG-Q Reply+Token Reply+Token ISRT ALTPCB to UOW2 CLIENT UOW3 THREE IMS Units of Work (UOW) Invoking a Web Service from an IMS Application 15
  • IMS Regional User GroupAsynchronous Callout –IMS ALTPCB to OTMA Destination and attributes can be determined by OTMA Exit – DFSYPRX0 – OTMA Destination Resolution Exit – DRU – OTMA User Data Formatting Exit Destination and attributes can be determined by OTMA Descriptors in DFSYDTx for IMS Connect DFSYDTx member of IMS.PROCLIB – TYPE: Destination type (IMSCON) – TMEMBER: OTMA Target Client – TPIPE: Destination Name – SMEM: Supermember name – ADAPTER: Type of IMS Connect Adapter – CONVERTR: Routine called by Adapter Invoking a Web Service from an IMS Application 16
  • IMS Regional User GroupAsynchronous Callout –IMS ALTPCB to IMS Connect RYO ApplicationCLIENT IMS Application 1 MSG-Q IMS Connect IMS Connect Client GU IOPCB MSG-Q Connect ISRT ALTPCB to Write IMS Connect Resume TPIPE Message+Token Read UOW1 Message+Token IMS Application 2 Write MSG-Q MSG-Q ACK GU IOPCB Send-Only Reply+Token Reply+Token ISRT ALTPCB to UOW2 CLIENT TWO IMS Units of Work (UOW) + UOW3 ICON Client UOW Invoking a Web Service from an IMS Application 17
  • IMS Regional User GroupAsynchronous Callout –IMS ALTPCB to IMS TM Resource Adapter Initiating Client IMS WebSphere Application Server 0. Start IMS App1 IMS App1 RESUME TPIPE 1.ResumeTPIPE(TP1) 1. ReceiveAsync(TP1) 2. ISRT Single Wait ALTPCB Alt ClientID= TP1 3.Send “Single wait ” (IC4JEJB) IMS Connect EJB 4.receive MSG1 MSG1 TP1 6. MSG1 5.sendACK Web MSG1 Service OR MSG2 7. send New Msg IMS App2 MDB IMS TM Resource Adapter DFSYDTx (new definition) WIN, AIX, SOLARIS, LINUX, etc. IC4JEJB TYPE = IMSCON Commit then Send (CM0) TMEMBER=SM01 TPIPE=TP1 Sync-Level=CONFIRM SMEM=Y Execution timeout Invoking a Web Service from an IMS Application 18
  • IMS Regional User GroupAsynchronous Callout –IMS ALTPCB to IMS SOAP Gateway DFSYDTx IMSSOAP1 TYPE = IMSCON TMEMBER=SM01 Initiating TPIPE=TP3 SMEM=Y Client Win, AIX, , Linux, z/OS. ADAPTER = HWSXMLA0 IMS CONVERTR=SOAPIT 2 IMS SOAP Gateway Server Connect 1 IMS App1 RESUME TPIPE TP3 TP3 5 “Single wait ” 3 : 4 XML Msg1 ISRT ALTPCB RECEIVE InXMLMsg1 Adapter Msg2 IMSSOAP1 Web Service 5.sendACK SYNCPT Starts.. IMS 6 SOAPIT 7 IMS App2 SEND OutXMLMsg XML Converter Connection Bundle(CBA) TPIPE = TP1,TP3 Invoking a Web Service from an IMS Application 19
  • IMS Regional User GroupRational Developer for System z (RDz)Language Meet-in-Middle Compiled Generation WizardStructures(e.g. COBOL IMS Callout Compiled Converters generatedCopybooks)From IMS Compiled from manually specified mappings between the Rational Developer for request and response XML Schemas andCallout app Converters System z (RDz) 7.1.1 existing or newly hand-coded language structures. In addition, a WSID and Web Service operation name will be added by the WSDL converter to the request message. The WSID is From web used to map to a particular IMS Callout service correlator at runtime. Mapping IMS Callout IMS Callout runtime deployment metadata for Metadata Correlator mapping a particular web service as well as properties for invoking the web service. Invoking a Web Service from an IMS Application 20
  • IMS Regional User Group Asynchronous Callout – IMS ALTPCP to WebSphere MQ IMS BridgeCLIENT IMS Application 1 MSG-Q WebSphere MQ MQ Appl GU IOPCB MSG-Q Queue MQCONN Manager ISRT ALTPCB to IMS Bridge MQOPEN MQ MQ IMS Bridge XCF Read MSG-Q (YPRX0 + MQDRU) MQGET Message+Token Message+Token MQPUT UOW1 MQPUT1 IMS Application 2 MQGET Reply+Token MSG-Q MSG-Q GU IOPCB MQCOMMIT XCF Write Reply+Token MQDISC ISRT ALTPCB to UOW2 & UOW4 UOW3 CLIENT TWO IMS Units of Work (UOW) + UOW5 2MQ QM UOWs + MQ Application UOW Invoking a Web Service from an IMS Application 21
  • IMS Regional User Group Asynchronous Callout – IMS ALTPCB to OTMA C/I ApplicationCLIENT IMS Application 1 MSG-Q OTMA C/I MSG-Q GU IOPCB Application ISRT ALTPCB to Message+Token otma_create IMS Application 2 Message+Token otma_open UOW1 otma_receive_async Message+Token IMS Application 3 otma_send_async MSG-Q GU IOPCB MSG-Q Reply+Token Reply+Token Reply+Token otma_close ISRT ALTPCB to UOW2 CLIENT TWO IMS Units of Work (UOW) + UOW3 OTMA C/I Application UOW Invoking a Web Service from an IMS Application 22
  • IMS Regional User GroupAsynchronous Callout –WebSphere MQ Using ESAF EASF = External Subsystem Interface Provides for program-to-program communication – Workflow model IMS application issues MQ API IMS provides syncpoint coordination within a transaction Applications manage the response correlation There is no coordinated commit Invoking a Web Service from an IMS Application 23
  • IMS Regional User Group Asynchronous Callout – WebSphere MQ Using ESAFCLIENT IMS MPP1/BMP1 MSG-Q Message+Token MQ Appl GU IOPCB MQCONN MQ MQCONN MQOPEN MSG-Q MQPUT1 MQDISC MQGET Message+Token UOW1 MQPUT1 Reply+Token IMS BMP2 MQCOMMIT MSG-Q MQCONN MQOPEN MQDISC MQGET w/WAIT Reply+Token ISRT ALTPCB UOW2 IMS SYNC TWO IMS Units of Work (UOW) + UOW3 MQ Application UOW Invoking a Web Service from an IMS Application 24
  • IMS Regional User GroupAsynchronous Callout –APPC/IMS IMS DL/I API call – CHNG, ISRT, PURG to ALTPCB Provides for program-to-program communication – Workflow model IMS provides syncpoint coordination within a transaction Applications manage the response correlation There is no coordinated commit DFS62DTx member of IMS.PROCLIB – LUNAME: Destination – TPNAME: Application Program – MODE: VTAM Mode Table – SYNCLEVEL: Conversation State Change Protocol – OUTBND: Local LU – SIDE: Side Information Entry – CONVTYPE: Basic or Mapped Invoking a Web Service from an IMS Application 25
  • IMS Regional User Group Asynchronous Callout – APPC/IMSCLIENT IMS Application 1 MSG-Q APPC/IMS IMS/non-IMS GU IOPCB MSG-Q CMALLOC LU 6.2 TP-B ISRT ALTPCB Alloc TP-B Session (LU 6.2 Descriptor) Type=NONE/ Conv A CMRCV Message+Token CONFIRM Process Data CMSEND CMDEAL UOW1 CMDEALL IMS Application 2 Session MSG-Q CMRCV CMALLOC Conv B CMSEND MSG-Q GU IOPCB Send data to IMS CMDEAL Reply+Token CMDEAL ISRT ALTPCB to UOW2 & UOW4 UOW3 CLIENT TWO IMS Units of Work (UOW) + UOW5 2 APPC/MVS UOWs + APPC Appl UOW Invoking a Web Service from an IMS Application 26
  • IMS Regional User GroupSynchronous Callout ICAL – IMS TM Resource Adapter – SOAP Gateway – RYO DB2 Stored Procedures DB2 Attach WebSphere MQ Using ESAF WebSphere MQ Using CSQBSTUB WebSphere MQ Using CSQBRSTB + RRS CPI-C/APPC RYO Using TCP/IP Invoking a Web Service from an IMS Application 27
  • IMS Regional User GroupSynchronous Callout –IMS ICAL Synchronous Callout – IMS supports synchronous callout from an IMS application using OTMA – Invoked with a new IMS call – ICAL – Application will issue the call and wait for a reply – First support is for IMS Connect – Also supported for IMS Java programs Invoking a Web Service from an IMS Application 28
  • IMS Regional User GroupSynchronous Callout –IMS ICAL Synchronous Callout – The OTMA Client will do a Resume TPIPE specifying that it wants synchronous callout messages – OTMA sends the synchronous callout request to the OTMA Client when it is available – The OTMA Client must send an ACK (or NAK) for the request message – The OTMA Client will send the reply via a special Send-Only message – The OTMA Client is responsible for maintaining the Correlation Token Invoking a Web Service from an IMS Application 29
  • IMS Regional User GroupSynchronous Callout –IMS ICAL Synchronous Callout – IMS Connect supports OTMA synchronous callout • Supported by IMS TM Resource Adapter • Supported by IMS SOAP Gateway • Supported by IMS Connect API for Java and C/C++ • Supported for RYO IMS Connect Clients • Supported by IMS Connect Extensions – The IMS Connect Client will do a Resume TPIPE specifying that it wants synchronous callout messages – The IMS Connect Client will send the reply via a Send-Only message – The IMS Connect Client maintains the Correlation Token Invoking a Web Service from an IMS Application 30
  • IMS Regional User GroupSynchronous Callout –IMS ICAL Synchronous Callout – The synchronous callout design is provided for IMS TM users • It does not provide support for BMP or JBP applications running in a DBCTL environment – OTMA Descriptors are required to define the target destination • Supermember is supported for availability and failover – Only the AIBTDLI call interface is supported • Supports messages larger than 32K without segmentation Invoking a Web Service from an IMS Application 31
  • IMS Regional User GroupSynchronous Callout –IMS ICAL Synchronous Callout – The following will not be supported in the first phase of the synchronous callout support • Shared Queues with FE and BE are different systems • Two phase commit (distributed sync point) • IMS application will not be able to specify a password for authenticating the external server on a per request basis Invoking a Web Service from an IMS Application 32
  • IMS Regional User GroupSynchronous Callout –IMS ICAL WebSphere IMS Application Server EJB / IMS TM MDB Resource Adapter IMS Application 1 OTMA Descriptor 1 IMS Connect IMS Roll-your-own Connect IMS Application 2 Application OTMA Descriptor 2 OTMA IMS Application 3 Descriptor 3 IMS SOAPWeb Service Provider Gateway Send flow Receive flow Invoking a Web Service from an IMS Application 33
  • IMS Regional User GroupSynchronous Callout –IMS ICAL Synchronous Callout – The first thing to do is define and setup OTMA Descriptors for each synchronous callout destination – Use different TPIPEs for asynchronous output messages and synchronous callout messages – Use different TPIPEs for synchronous callout request messages for each client • IMS TM Resource Adapter clients • IMS SOAP Gateway clients • RYO application clients • IMS Connect API clients Invoking a Web Service from an IMS Application 34
  • IMS Regional User GroupSynchronous Callout –IMS ICAL Synchronous Callout – Use ‘D’ descriptor type in DFSYDTx – D destname keywords • destname is the destination name in the AIB – Keywords are • TYPE=IMSCON (only supported by ICON at this time) • TMEMBER=name • TPIPE=name • SMEM=YES|NO • ADAPTER=adapname • CONVERTR=convname • SYNTIMER=timeout Invoking a Web Service from an IMS Application 35
  • IMS Regional User GroupSynchronous Callout –IMS ICAL Synchronous Callout – The IMS application uses the AIBTDLI call for the synchronous request – CALL AIBTDLI USING ICAL, AIB, REQ-AREA, RESP-AREA. • ICAL is new call • AIB is an AIB control block • REQ-AREA is the Request data area for synchronous callout • RESP-AREA is the Response data area for returned data Invoking a Web Service from an IMS Application 36
  • IMS Regional User GroupSynchronous Callout –IMS ICAL Synchronous Callout AIB – AIBSFUNC = SENDRECV – AIBRSNM1 = 8 byte OTMA Descriptor name – AIBRSFLD = Timeout value – AIBOALEN = Request area length • Input parameter: 4 byte field containing the length of the request area • Output parameter: Actual length of the response message • Updated by IMS only when partial data is returned ‒ AIB return code x100, AIB reason code x00C‘ – AIBOAUSE = Response area length • Input parameter: 4 byte field contains the length of the response area • Output parameter: Length of the response message placed in the response area • When partial data is returned because the response area is not large enough, AIBOAUSE contains the length of data returned in the response area and AIBOALEN contains the actual length of the response message Invoking a Web Service from an IMS Application 37
  • IMS Regional User GroupSynchronous Callout –IMS ICAL IAPMDI27 JOHN DOE . RYO Application IMS Connect IMS Resume TPIPE IMS Application TPIPE 1 TPIPE1 TPIPE1 ICAL SENDRECV OTMDEST1 JOHN DOE Request 4 3 2 JOHN DOE 5 ACK Response 9 6 7 8 12345678 12345678 10 Invoking a Web Service from an IMS Application 38
  • IMS Regional User GroupSynchronous Callout –IMS ICAL Synchronous Callout 1. IMS Connect Client issues Resume TPIPE 2. The IMS application issues the synchronous request using the ICAL call 3. OTMA breaks the message into 32K segments 4. IMS Connect combines the data and sends it to the IMS Connect Client including the Correlation Token 5. The IMS Connect Client must ACK or NAK the synchronous output message Invoking a Web Service from an IMS Application 39
  • IMS Regional User GroupSynchronous Callout –IMS ICAL Synchronous Callout 6. The IMS Connect Client sends the synchronous response message as a “send-only” message (Send-Only with ACK is supported) 7. IMS Connect breaks the message into 32K pieces to send to OTMA via XCF 8. OTMA combines all of the data and returns it to the IMS application in the Response Area 9. The IMS application processes the synchronous response 10. IMS optionally ACKs the response message (IMS 12+) Invoking a Web Service from an IMS Application 40
  • IMS Regional User GroupSynchronous Callout –IMS ICAL Holding IMS locks during ICAL – While the ICAL is in progress IMS is still holding all of the database locks that were obtained before the call – Good programming practice would to be do as few database updates as possible before the ICAL • Zero is the ideal number ‒ For positional database locks held for reads consider the use of the DL/I RLSE call which is described in the notes below Invoking a Web Service from an IMS Application 41
  • IMS Regional User GroupSynchronous Callout –IMS ICAL /DISPLAY ACTIVE REGION – New status for region waiting on synchronous callout response •WAIT-CALLOUT – Continuation line for region waiting on synchronous callout response •TMEMBER name TPIPE: tpipename REGID JOBNAME TYPE TRAN/STEP PROGRAM STATUS CLASS 1 MPP1A TP APOL11 APOL1 WAIT-CALLOUT 1 TMEMBER HWS TPIPE: TPIPE1 JMPRGN JMP NONE JBPRGN JBP NONE BATCHREG BMP NONE FPRGN FP NONE DBTRGN DBT NONE DBRZCSAJ DBRC DLIZCSAJ DLS *08213/165100* Invoking a Web Service from an IMS Application 42
  • IMS Regional User GroupSynchronous Callout –IMS ICAL /DIS TMEMBER TPIPE ALL SYNC new fields – OPT ( for both asynchronous and synchronous calls) • N – Noauto • O – One • A – Auto • W – Auto one • ‘-’ -- no RT – MODE ( for both asynchronous and synchronous calls) • S – Sync messages • B – Both Async and Sync messages • A – Async messages • ‘-’ – no RT – SYNCOT ( only for synchronous calls) • No. of active ICAL syncallout messages – NO_COT (only for synchronous calls) • Number of messages waiting for response and/or WT-S status Invoking a Web Service from an IMS Application 43
  • IMS Regional User GroupSynchronous Callout –IMS ICAL Effect of commands for IMS synchronous callout – /PSTOP • Clear the wait in the region • Dequeues synchronous callout messages from the TPIPE – /STOP TMEMBER TPIPE • Clear state of all messages for the TPIPE – /STOP OTMA • Clear all the ICAL messages for all the TPIPEs. • New ICAL synchronous callout requests rejected – These commands return to ICAL • AIBRETRN = 100 • AIBREASN = 10C Invoking a Web Service from an IMS Application 44
  • IMS Regional User GroupSynchronous Callout –IMS ICAL – IMS TM Resource Adapter The IMS TM Resource Adapter running in a JEE environment supports synchronous callout via ICAL – WebSphere Enterprise Java Bean (EJB) • EJB would be coded to use IMS TM Resource Adapter’s Resume TPIPE and Send-Only function • Correlation Token would be sent back with the response message – WebSphere Message Driven Bean (MDB) • MDB would be deployed to listen to callout requests using IMS TM Resource Adapter JCA 1.5 Inbound support • IMS TM Resource Adapter internally ‒ Implements Resume TPIPE and Send-Only protocols and manages Correlation Token on behalf of the MDB ‒ Implements JCA 1.5 Work management contract to provide concurrent processing • Working with Rational Application Developer and WebSphere Integration Developer tooling to generate MDB and SCA exports Invoking a Web Service from an IMS Application 45
  • IMS Regional User Group Synchronous Callout – IMS ICAL – IMS TM Resource Adapter - EJB z/OS WebSphere Application Server IMS EJB IMS TMSYNC_RECEIVE_A RASYNCOUTPUT TPS Resume TPIPE TPS TM/CTL Application IMS Program Services TPS DEST1 CORTKN Data Connect TPS ICAL OTMA HWS1 DEST1CORTKN Data ACK HWS1 Request Send_ONLYSYNC_SEND Response Data CORTKN DataCORTKN Invoking a Web Service from an IMS Application 46
  • IMS Regional User Group Synchronous Callout – IMS ICAL – IMS TM Resource Adapter - MDB z/OS WebSphere Application Server IMS MDB IMS ACTIVATE TM RA Resume TPIPE TPS TM/CTL Application IMS Program Services EJB TPS DEST1 CORTKN Data Connect TPS ICALService OTMA HWS1 DEST1 ACK HWS1 Data Request Send_ONLY Response Data CORTKN Data Invoking a Web Service from an IMS Application 47
  • IMS Regional User GroupSynchronous Callout –IMS ICAL – IMS SOAP Gateway The IMS SOAP Gateway supports synchronous callout via ICAL – IMS SOAP Gateway provides built-in function to listen to callout request and invoke Web service providers • Implements Resume TPIPE and Send-Only protocols and manages Correlation Token • Correlates callout requests to Web service providers – Support for concurrent processing provided by built-in threading mechanism – Rational Developer for System z generates callout artifacts and XML converters for IMS SOAP Gateway and IMS Connect Invoking a Web Service from an IMS Application 48
  • IMS Regional User GroupSynchronous Callout –IMS ICAL – IMS SOAP Gateway z/OS IMS Web IMSService SOAP Gateway Resume TPIPE TM/CTL Application TPS DEST1 Services Program IMS TPS TPS CORTKN XML HWS1 ICAL OTMA ACK Connect HWSXMLA0 DEST1XML XMLCNV1D HWS1 Request Send_ONLY data HWSXMLA0 ResponseXML CORTKN XML XML Converter data XMLCNV1D Connection Bundle TPS Invoking a Web Service from an IMS Application 49
  • IMS Regional User GroupSynchronous Callout –IMS ICAL – IMS SOAP Gateway Initiating ClientError Scenarios z/OS IMS SOAP IMS IMS Gateway Connect HWS1 Resume TPIPE 0 IMS Application RESUME TPIPE Web Service Request Provider X1 1 ICAL SENDRECV OTMDEST1 HELLO FROM IMS HELLO FROM IMS X2 X3 ACK HELLO 2 FROM IMS 3 XML Converter X4 Response 4 HELLO FROM WEB SERVICE HELLO FROM X5 X6 WEB SERVICE HELLO FROM XML WEB SERVICE Adapter Correlator X1: ICAL cannot be sent out X2: ICAL time out X5: external server already commit before time out X3: late ACK received after time out X6: external server already commit, but IMS fails to X4: XML converter in error process the response Invoking a Web Service from an IMS Application 50
  • IMS Regional User GroupSynchronous Callout –IMS ICAL – RYO IMS Synchronous Callout ICAL destinations can be user written IMS Connect TCP/IP Clients – WRITE Resume TPIPE specifying Synchronous Callout messages are requested – READ to get the Correlation Token + the request message – WRITE ACK for the request message – WRITE to send Correlation Token + reply message • This is a Send-Only message marked as a synchronous reply • Send-Only with ACK is also supported – READ to get ACK (optional) – The IMS Connect API for Java and C/C++ can also be used for RYO IMS Connect synchronous callout clients Invoking a Web Service from an IMS Application 51
  • IMS Regional User GroupSynchronous Callout –IMS ICAL – RYO z/OS IMS TCP/IP RYO Resume IMS TM/CTL Application TPIPE TPS TPS Services Program Connect DEST1 ICAL TPSCToken Data OTMA HWS1 HWS1 DEST1 ACKSend_ONLY Request ResponseCToken Data Invoking a Web Service from an IMS Application 52
  • IMS Regional User GroupSynchronous Callout –IMS ICAL – IMS 13 Enhancements IMS Synchronous Callout with ICAL to another IMS transaction – Both run under a single Unit of Work Retrieval of truncated synchronous response – If Response buffer is too small OTMA returns truncated response and the real length of the response message – IMS application can now ask for the rest of the response message Invoking a Web Service from an IMS Application 53
  • IMS Regional User GroupSynchronous Callout –DB2 Stored Procedures Open Standards API calls Provides for program-to-program communication – supports synchronous communication Provides distributed coordinated commit – IMS is the coordinator via ESAF Requires DB2 SSM IMSID= member of IMS.PROCLIB • SST: Subsystem Type • SSN: Subsystem Name • LIT: Language Interface Token • ESMT: External Subsystem Module Table • RTT: Resource Translation Table • REO: Region Error Option - “R”, “Q”, or “A” • CRC: Subsystem Recognition Character Invoking a Web Service from an IMS Application 54
  • IMS Regional User Group Synchronous Callout – DB2 Stored ProceduresCLIENT IMSA Program1 GU IOPCB EXEC SQL: DB2 CALL PROC ( :aaa : bbb … Stored Procedure data User Defined Function (UDF) ISRT IOPCB IMS Managed UOW1 Invoking a Web Service from an IMS Application 55
  • IMS Regional User GroupSynchronous Callout –DB2 Attach Facility Open Standards API calls Provides for program-to-program communication – Supports synchronous communication Provides distributed coordinated commit – IMS is coordinator via RRS Requires DB2 and RRS Invoking a Web Service from an IMS Application 56
  • IMS Regional User GroupSynchronous Callout –DB2 Attach Facility IMS Control RRS=Y SSM IMSID=. member of IMS.PROCLIB SST=DB2,SSN=DB2E,COORD=RRS DFSJVMMS member of IMS.PROCLIB -Djava.class.path= > /usr/lpp/db2/db2710/classes: > /usr/lpp/db2/db2710/classes/db2j2classes.zip DFSJVMEV member of IMS.PROCLIB LIBPATH=/usr/lpp/db2/db2710/lib DFSJMP or DFSJBP members of IMS.PROCLIB //DFSDB2AF DD DISP=SHR,DSN=IMS.SDFSRESL // DD DISP=SHR,DSN=DSNxxx.DSNLOAD (must all be APF authorized libraries) Invoking a Web Service from an IMS Application 57
  • IMS Regional User Group Synchronous Callout – DB2 Attach FacilityCLIENT IMSA Program1 IMS-Java JMP/JBP JDBC: DB2 : Stored Procedure CALL PROC ( :aaa : bbb … Web Service data User Defined Function (UDF) ISRT IOPCB RRS Managed UOW1 Invoking a Web Service from an IMS Application 58
  • IMS Regional User GroupSynchronous Callout –WebSphere MQ Considerations Open Standards API calls Provides for program-to-program communication Possible distributed coordinated commit Requires Queue partner SSM IMSID= member of IMS.PROCLIB – SST: Subsystem Type – SSN: Subsystem Name – LIT: Language Interface Token – ESMT: External Subsystem Module Table (CSQQESMT) – RTT: Resource Translation Table -Not Used by MQ – REO: Region Error Option - “R”, “Q”, or “A” – CRC: Subsystem Recognition Character - Not Used by MQ Invoking a Web Service from an IMS Application 59
  • IMS Regional User Group Synchronous Callout – WebSphere MQ Using ESAF (CSQQSTUB)CLIENT IMS MPP1/BMP1 MSG-Q Message+Correlid MQ Appl GU IOPCB MQCONN MQCONN MQ MQOPEN MSG-Q MQPUT1 Not in syncpoint MQGET Message+Correlid MQOPEN Reply+Correlid MQPUT1 Reply+ Correlid MQGET w/WAIT Correlid set Index on Correlid MQCOMMIT MQCLOSE MQDISC MSG-Q MQDISC UOW2 ISRT IOPCB ONE IMS Unit of Work (UOW) + UOW1 MQ Application UOW Invoking a Web Service from an IMS Application 60
  • IMS Regional User GroupSynchronous Callout –WebSphere MQ Using ESAF (CSQBSTUB)CLIENT IMS MPP1/BMP1 MSG-Q Message+Correlid MQ Appl GU IOPCB MQCONN MQCONN (once) MQ MQOPEN MSG-Q MQOPENs (once) MQGET MQPUT Message+Correlid Not in syncpoint Reply+Correlid MQPUT1 MQGET w/WAIT Reply+ Correlid Correlid set Index on Correlid MQCOMMIT MQCMIT MQDISC MSG-Q ISRT IOPCB UOW2 ONE IMS Unit of Work (UOW) + UOW1 MQ Application UOW Invoking a Web Service from an IMS Application 61
  • IMS Regional User Group Synchronous Callout – WebSphere MQ Using ESAF (CSQBRSTB)CLIENT IMS MPP1/BMP1 MSG-Q Message+Correlid MQ Appl GU IOPCB MQCONN MQCONN (once) MQ MQOPEN MSG-Q MQOPEN (once) MQGET MQPUT1 Message+Correlid Not in syncpoint Reply+Correlid MQPUT1 MQGET w/WAIT Reply+ Correlid Correlid set Index on Correlid MQCOMMIT MQCMIT MQDISC MSG-Q ISRT IOPCB ONE RRS UOW – NOT TESTED RRS UOW1 Invoking a Web Service from an IMS Application 62
  • IMS Regional User GroupSynchronous Callout –CPI-C/APPC Considerations Open Standards API calls Protocol for program-to-program communication IMS supports synchronous communication – Can be single UOW or multiple UOWs Protocol supports distributed coordinated commit IMS participates in coordinated commit – Coordinator or participant via RRS Requires APPC partner Invoking a Web Service from an IMS Application 63
  • IMS Regional User Group Synchronous Callout – CPI-C/APPCCLIENT MSG-Q IMSA-PGMA GU IOPCB IMSA/IMSB/non-IMS LU6.2 CMALLC Allocate TP-B TP-B Type=NONE/CONFIRM/SYNCPT CMSEND SEND_DATA Conversation CMRCV RECEIVE CMRCV RECEIVE_and_WAIT CMDEAL DeAllocate CMSEND SEND_DATA Session MSG-Q CMDEAL DeAllocate ISRT IOPCB UOW1 Invoking a Web Service from an IMS Application 64
  • IMS Regional User GroupSynchronous Callout –RYO TCP/IP Considerations Open Standards API calls RYO protocol for program-to-program communication Protocol does not support coordinated commit – IMS does not participate in coordinated commit Requires TCP/IP partner Invoking a Web Service from an IMS Application 65
  • IMS Regional User Group Synchronous Callout – RYO Using TCP/IPCLIENT IMSA-PGMA TCP/IP-B GU IOPCB Socket Socket datagrams Connect – TCP/IP-C Connect - TCP/IP-B WRITE_DATA READ_DATA WAIT Connection WRITE_DATA READ_DATA CLOSE CLOSE ISRT IOPCB UOW1 UOW2 Invoking a Web Service from an IMS Application 66
  • IMS Regional User GroupSummary – IMS Callout Techniques Asynchronous Callout – IMS ALTPCB – WebSphere MQ Using ESAF – APPC/IMS Synchronous Callout – IMS ICAL – DB2 Stored Procedures – DB2 Attach Facility – WebSphere MQ Using ESAF – CPI-C/APPC – RYO Using TCP/IP Invoking a Web Service from an IMS Application 67