ims nordic rug ims callout - ims ug may 2013 stockholm

Click here to load reader

Post on 18-Nov-2014




0 download

Embed Size (px)




  • 1. 2013 IBM CorporationIntegrating IMS Applicationsin the EnterpriseBetty Patterson May 2013IMS Chief ArchitectIBM Silicon Valley Laboratory
  • 2. 2013 IBM Corporation2Availability. References in this presentation to IBM products, programs, or services do not imply that they will be available in allcountries in which IBM operates.Acknowledgements and Disclaimers Copyright IBM Corporation 2013. All rights reserved. U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contractwith IBM Corp.IBM, the IBM logo,, IMS, DB2, CICS and WebSphere MQ are trademarks or registered trademarks of International BusinessMachines Corporation in the United States, other countries, or both. If these and other IBM trademarked terms are marked on their firstoccurrence in this information with a trademark symbol ( or ), these symbols indicate U.S. registered or common law trademarksowned by IBM at the time this information was published. Such trademarks may also be registered or common law trademarks in othercountries. A current list of IBM trademarks is available on the Web at Copyright and trademark information company, product, or service names may be trademarks or service marks of others.The workshops, sessions and materials have been prepared by IBM or the session speakers and reflect their own views. They areprovided for informational purposes only, and are neither intended to, nor shall have the effect of being, legal or other guidance or adviceto any participant. While efforts were made to verify the completeness and accuracy of the information contained in this presentation, it isprovided AS-IS without warranty of any kind, express or implied. IBM shall not be responsible for any damages arising out of the use of,or otherwise related to, this presentation or any other materials. Nothing contained in this presentation is intended to, nor shall have theeffect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of theapplicable license agreement governing the use of IBM software.All customer examples described are presented as illustrations of how those customers have used IBM products and the results they mayhave achieved. Actual environmental costs and performance characteristics may vary by customer. Nothing contained in thesematerials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by you will result in any specificsales, revenue growth or other results.
  • 3. 2013 IBM Corporation3IMS SOA Integration Suite, reuse andexpand IMS transactionOpen and directaccess to IMS DataIMSTMIMSDBCJavaMFSDL/I DataIMS ConnectAPIIMS Enterprise SuiteSOAPGatewayIMS TMResourceAdapterIMS MFSWeb SolutionsIMS Web 2.0SolutionsXML DataPL/ICOBOLFull Java EE, webservice and SOA accessto and from IMStransactionsLight-weight webservice provider andconsumer solution forIMSSimplify use of writingIMS Connect User-written applicationsModernize, web andSOA enabled MFS-based IMS transactionsCreate feeds andintegrate IMStransactions withWeb 2.0 appWebSphere Write and run IMSapplication in Javato leverage newskillsIMS Web 2.0SolutionsIMS Open DBand UniversalJDBC driversIMS Explorerfor DevIMS UniversalDB ResourceAdapterWebSphereCreate feeds andintegrate IMS datawith Web 2.0 appAccess IMS Data usingSQL directly fromSystem z anddistributed platforms viaIMS ConnectStore and RetrieveXML data from IMSDBProvide visual view of IMSdata and generatemetadata classes for newapplication developmentAccess IMS Data fromJava EE appIMS DBWeb ServicesExpose an IMSdatabase query asWeb ServicesNo additional cost for IMS license usersLeverage open standards
  • 4. 2013 IBM Corporation4or Print utilityIMS Performance Analyzer IMS Problem InvestigatorInbound Connectivity to IMS TMIMSConnectOTMAIMS DB &XML DBIMSWebSphere ServersWAS, WESB, WTX,WMB, BPMIMS SOAPGatewayWebSphereDataPowerConnect API(Java, C)WMQMQ ClientRYO ClientMobileWebServiceConsumerIMS TMResourceAdapterWAS WebSphere Application ServerWOLA - WebSphere z/OS Optimized Local AdaptersWESB WebSphere Enterprise Service BusWTX WebSphere Transformation ExtenderWMB WebSphere Message BrokerBPM - IBM Business Process Manager (BPM) AdvancedIBM MashupCenter /WebSpheresMashWeb 2.0ClientDB2WOLAJCAJMS or MQ APISOAPover IPWMB &DataPowerMQ IMSBridgeMQ TriggerMonitorIMSIMSCONNECTCONNECTExtensionsExtensionsArchivejournalXCFTCP/IPCloudIMSAPPIMSCatalog
  • 5. 2013 IBM Corporation5IMSConnectOTMAIMS DB &XML DBIMSDB2WOLAOutbound Connectivity from IMS TM Asynchronous and synchronous capabilitiesIMS TMResourceAdapterWASIMS SOAPGatewayWMQMQ ServerRYO ServerWebServiceProviderEventProcessingWBE, WBMWAS WebSphere Application ServerWOLA - WebSphere z/OS Optimized Local AdaptersWBE WebSphere Business EventsWBM WebSphere Business MonitorWMB WebSphere Message BrokerRYO Server - .Net, BizTalk, Oracle SP, SAP, PayPalservices, and any application server, etc.WMBIMSAPPIMSCatalogDB2 for z/OSGatewayAny DB2PlatformWebSphereDataPower
  • 6. 2013 IBM Corporation6IMS Callout Techniques Asynchronous callout using insert to ALTPCB via OTMA Synchronous Callout using ICAL Asynchronous program switch Synchronous program switch (IMS 13) Callout via External Subystem Attach Facility DB2 Stored Procedure WebSphere MQ Websphere Optimized Local Adapter User Written TCP/IP Synchronous Advanced Program-to-Program Communication (APPC)
  • 7. 2013 IBM Corporation7IMS Callout Enable IMS applications as Service Requesters IMS Application can be an integration focal point in the enterprise Interoperate with business logic outside the IMS environment Callout to Java EE apps (EJB and MDB) and Web Services usingWebSphere Application Server and IMS TM Resource Adapter Callout to Web services providers (e.g. Microsoft .NET) using SOAPGateway Callout to other applications Two Flavors Asynchronous Synchronous
  • 8. 2013 IBM Corporation8Asynchronous Callout Asynchronous Callout IMS application invokes external applications without waiting forresponse. DL/I ISRT ALTPCB Destination can be Another IMS application (program switch) An OTMA destination> Sent to any OTMA clients, such as IMS Connect or WMQ> Tpipe name specified via DRU exits or OTMA descriptor. Any response sent back is a new transaction
  • 9. 2013 IBM Corporation9Synchronous Callout Synchronous Callout IMS application invokes external application and waits for theresponse. DL/I ICAL Supports timeout capability and large messages Secondary application is not in the same two-phase commitscope IMS application waits until the response is returned or therequest receives a timeout Callout response is sent back to the same transaction thatinitiated it
  • 10. 2013 IBM Corporation10IMS Asynchronous and Synchronous CalloutSync CalloutResponseCallout RequestAsync CalloutResponseIMS Application 1IMS Application 2Async: ISRT ALTPCBSync: ICAL
  • 11. 2013 IBM Corporation11IMS Synchronous Callout
  • 12. 2013 IBM Corporation12IMS Synchronous Callout Overview IMS 10 added DLI ICAL call for synchronous callout request Timeout support to optionally terminate callout request and free the dependentregion Enhanced IMS commands to view synchronous callout status and stop thecallout processing Support messages larger than 32K without segmentation Provide management of the correlation of a synchronous callout request andresponse Enhanced OTMA Resume TPIPE/Send Only protocol and Routing Descriptorfunction for retrieving synchronous callout requests and sending responses
  • 13. 2013 IBM Corporation13IMS application - DL/I ICALCALL AIBTDLI USING ICAL, AIB, REQ-AREA, RESP-AREA.where: ICAL is the call verb (available on AIBTDLI only) and SENDRECV is thesub-function code REQ-AREA is the Request data area for sync callout RESP-AREA is the Response data area for returned dataNote: REQ-AREA and RESP-AREA do not specify LLZZ, data can be > 32KFor example:ICALIOAreas
  • 14. 2013 IBM Corporation14IMS application - DL/I ICAL AIB AIBSFUNC = SENDRECV AIBRSNM1 = 8 byte OTMA Descriptor name AIBRSFLD = Timeout value 4 byte field for time value in 100th seconds. System default is 10 sec. AIBOALEN = Request area length As an input parameter: 4 byte field contains the length of the request area As an output parameter: Actual length of the response message updatedby IMS only when partial data is returned (AIB return code x100, AIBreason code x00C). AIBOAUSE = Response area length As an input parameter: 4 byte field contains the length of the responsearea As an output parameter: Length of the response message placed in theresponse area. When partial data is returned because the response area isnot large enough, AIBOAUSE contains the length of data returned in theresponse area and AIBOALEN contains the actual length of the responsemessage.
  • 15. 2013 IBM Corporation15IMS application - DL/I ICALDescriptornameTimeoutRequest Area LengthResponse Area LengthOutput returncodesAIBFor example:
  • 16. 2013 IBM Corporation16D destname keywordsWhere:destname is destination names and can be masked by ending in an *keywords are: TYPE=IMSCONTMEMBER=nameTPIPE-nameSMEM=YES|NOADAPTER=adapnameCONVERTR=convnameSYNTIMER=timeout (If both ICAL & Descriptor specify timeout, the lower value is used)D OTMDEST1 TYPE=IMSCON TMEMBER=HWS1 TPIPE=TPIPE1 SYNTIMER=5000OTMA Destination Routing Descriptor IMS OTMA Destination Routing Descriptors externalize the routing definitions andspecifications for callout messages without IMS user exits. It is read and initialized atIMS startup. Use D descriptor type in DFSYDTx member of IMS.PROCLIB. IMS 11 provides Type-2 UPDATE commands to dynamically create, update,or query the descriptorsUPDATE OTMADESC NAME(OTMASYN) SET(SYNTIMER(5000))For example:For example:D SOAPGW1 TYPE=IMSCON TMEMBER=HWS1 TPIPE=HWS2SOAPD SOAPGW1 ADAPTER=XMLADPTR CONVERTR=XMLCNVTR SYNTIMER=2000
  • 17. 2013 IBM Corporation17Callout with IMS TM Resource Adapter
  • 18. 2013 IBM Corporation18WebSphere and IMS TM Resource AdapterWAS/WPS/WTX/WMB/WESBIMS TMIMS TMresourceresourceadapteradapterWebServiceTCP/IPWebComponentEnterpriseBeanIMSConnectIMS DB *IMSIMS App Enable IMS transaction as Web Service with full SOA support Integrate with a variety of Java EE or WebSphere-based servers with built-in QoSsupport (2PC, connection pooling, security management) Java EE Connector Architecture (JCA/J2C) compliant Recommended when Java EE server (e.g. WAS) is already in-use Supports rapid application development with Rational toolingRational ApplicationDeveloper (RAD) orWebSphere IntegrationDeveloper (WID)IMS appSource(COBOL, PLI,C, MFS)Generates* Binary, text or XML data
  • 19. 2013 IBM Corporation19Callout to WebSphere Java EE applicationusing IMS TM Resource Adapter A Java Message-driven bean (MDB) can be written to listen forcallout requests from IMS via IMS TM Resource Adapter IMS TM Resource Adapter implements the JCA Inboundspecification and deliver callout messages to MDB using standardinterfaces Hides the low-level IMS Connect and OTMA protocols Use Resume Tpipe Auto (with alternate client ID) with Wait-forever Handles the correlation token internally User specifies the callout properties using the ActivationSpec Can process responses from MDBs concurrently Auto reconnect to IMS Connect
  • 20. 2013 IBM Corporation20Callout with IMS TM Resource Adapter Callout to WAS MDB using IMS TM Resource Adapter Support JCA Inbound Retrieve Asynchronous callout, Synchronous callout messages as wellas Asynchronous output messages from IMS and deliver to WAS MDBWebSphere Application ServerIMSConnectz/OSIMSIMS Application2 ICAL SENDRECV ICODEST1HELLO FROM IMSHELLO FROMWEBSPHERE MDBTPIPEICOPIPE1Message DrivenBean (MDB)Response13ActivateHELLO FROM IMSonMessageHELLO FROMWEBSPHEREMDBIMSTMResourceAdapter Initiating ClientICODEST1ICOTPIPE1HWS1OTMA DescriptorWebService,EJB orMDBHWS1
  • 21. 2013 IBM Corporation21Callout with IMS SOAP Gateway
  • 22. 2013 IBM Corporation22IMS Enterprise Suite SOAP Gateway Overview A Light-weight Web Service solution for IMS without the need ofa Java EE server Integrates IMS assets into the Service-Oriented Architecture(SOA) Provides end-to-end interactions between IMS transactions andweb services clients in an On Demand environment Enables IMS as Provider and Consumer of Web Services Secure Tooling support Utilizes Rational Developer for System z tooling to create convertersfor transforming XML messages to IMS messages and vice versa No need to change existing IMS application code
  • 23. 2013 IBM Corporation23IMS application development and modernization:Rational Developer for System z (RDz) Eclipse-based application development tool for modernizing and developing System zapplications COBOL, PL/I, C, C++, HL Assembler, Java Supports IMS, CICS, Batch, USS, etc.. Interactive access to z/OS system Access PDS and run JCL from your workstation Premier IBM Integrated Development Environment for development and test of IMS applications Drag-and-drop code snippet function for IMS DLI calls Also supports IMS SOA enablement Enables CICS and IMS applications for Web Servicesand SOA Built-in wizard for SOAP Gateway and Web 2.0 Generate XML COBOL/PLI converters for XMLtransformation Generate WSDL, correlator files for Web Servicesaccess
  • 24. 2013 IBM Corporation24ExecutionExecutionGenerationGenerationSOAP clientsXMLAdapterAdapterTaskManagerXMLConvertersIMS ConnectIMSIMSAppz/OSLLZZTRCDDATALLZZDATATCP/IPDATA>SOAP GatewayHTTPSOAPendpointGatewayconnectorSOAPprocessorUDDIRegistryJavaClient.NETClientHTTP/SOAPRD/z Bottom-Up WizardWSDLCorrelatorFilePublishRD/zGenerateExisting COBOLCopybookXMLDocumentLog/server/logs/imssoap.logDevelopmentEnvironmentDevelopmentenvironmentRuntime environmentIMS SOAP Gateway Development & Runtime (Provider)
  • 25. 2013 IBM Corporation25Synchronous Callout FlowIMSIMS App1z/OSz/OS, zLinux, Win, AIX etc..DL/I ICALDescriptor nameTimeoutIMS Enterprise SuiteSOAP Gateway ServerIMSConnectReceive Callout Request in XMLSend Callout Response in XMLWebServiceAXMLAdapterMsg1Msg2TPIPESend ACKXMLConverter123567Development & Runtime Environment4ExecutionExecutionGenerationGenerationRD/z Meet-In-The-MiddleWizardExisting WSDLCorrelatorFileRD/zGenerateTaskExisting COBOLCopybookDevelopmentenvironmentError Handling: If Web Services returns a Web Service Fault error, SOAP Gateway sends an error response with the Fault message to the DLI call
  • 26. 2013 IBM Corporation26Callout with SOAP Gateway Generate artifacts Use Rational Developer for System z (RDz) to generate callout artifacts Meet-in-the-middle Maps WSDL with COBOL data structures Generates XML Converters Runs in IMS Connect Converts callout request from bytes to XML and vice versa Generates Correlator file Used by SOAP Gateway to identify which Web Service to invoke atruntime and specify callout properties Deploy WSDL Contains URL address for the outbound web service
  • 27. 2013 IBM Corporation27COBOL Application with ICALDescriptornameTimeoutRequest Area LengthResponse Area LengthOutput returncodesICALAIBIOAreas
  • 28. 2013 IBM Corporation28Asynchronous Callout with ResponseIMSIMS App1z/OSz/OS, zLinux, Win, AIX etc..:ISRT ALTPCBIMSSOAP1SYNCPT Starts..IMS Enterprise SuiteSOAP Gateway ServerIMSConnectIMS App2WebServiceAInitiatingClientXMLAdapterMsg1Msg2TPIPEDFSYDTxIMSSOAP1TYPE = IMSCONTMEMBER=SM01TPIPE=TP3SMEM=YADAPTER = HWSXMLA0CONVERTR=SOAPITSend ACKSOAPXMLConverterConnectionBundle(CBA)TPIPE = TP1,TP31234678Runtime Environment5Receive Callout Request in XMLSend Callout Response in XML
  • 29. 2013 IBM Corporation29IMS ApplicationExistingBusiness LogicBusiness Event support with SOAP Gateway IMS application sends out a business event data using ISRT ALTPCBcall RDz generates artifacts to convert IMS business events data toWBE/WBM formats SOAP Gateway emits business events data asynchronously to WBMand WBECapturePointDEST1EV1HWS1DescriptorIMS ConnectIMSOTMATPIPEEV1Send EventWebSphereBusinessEventsBytesEvent ActionWebSphereBusinessMonitorSOAPGatewayXMLPayload SOAPXMLAdapterXMLConverterRESTWebSphereApplication ServerWSDLISRTALTPCBIBM Confidential
  • 30. 2013 IBM Corporation30Managing Callout
  • 31. 2013 IBM Corporation31Enhanced IMS commands /DISPLAY ACTIVE REGION New status for region waiting onsynchronous callout response WAIT-CALLOUT Continuation line for regionwaiting on synchronous calloutresponse TMEMBER name TPIPE:tpipename /DIS TMEMBER TPIPE WAIT-S (WT-S) The transaction pipe is waiting foran ACK or NAK for a synchronouscallout message /DIS TMEMBER TPIPE SYNC Display the detailed sync calloutmessage count and status /PSTOP Clear the wait in the region Dequeues synchronous calloutmessages from the TPIPE /STOP REG ABDUMP Clear the wait in the region andterminate the application program /STOP TMEMBER TPIPE Clear state of all messages for theTPIPE /STOP OTMA Clear all the ICAL messages for all theTPIPEs. New ICAL synchronous calloutrequests rejectedNote: The stop commands return AIBRETRN= 100 and AIBREASN = 10C to ICAL
  • 32. 2013 IBM Corporation32Sample Commands outputAfter ICAL request is sent RegionStatusTPIPEStatus
  • 33. 2013 IBM Corporation33Some Callout Considerations Monitor synchronous callout processing Minimize resource contention Try to issue ICAL requests before obtaining locks Define appropriate number of dependent regions You may want additional transaction classes to segregate workloads Define timeout values for ICAL and/or OTMA descriptors Manage commit, backout and timeout -- UOWs are independent Multiple response messages from synchronous program switch
  • 34. 2013 IBM Corporation34IMS 13 Callout Enhancements
  • 35. 2013 IBM Corporation35Synchronous Program Switch Extend IMS Synchronous Callout to invoke another IMS Application Synchronous flows use DL/I ICAL Asynchronous flows still use DL/I ISRT OTMA Descriptor defines the destinationBenefits Provides a single DL/I call to request a synchronous service regardless of where thatservice resides Simplifies integration and improves usabilityICAL DEST1ICAL TRANBTRANAIMS CTL RegionIMSConnectWebSphereIMS TMRAIMS SOAPGatewayTCP/IPRYO pgmOTMAMSG-QDestinationDescriptorTYPE(IMSCON)TRANBGU IOPCBISRT IOPCBDestinationDescriptorTYPE(IMSTRAN)1234567GU, IOPCBApplications can issue multiple ICALs to differentdestination TYPEsSynchronous calloutSynchronous program switchWebSphereDataPower
  • 36. 2013 IBM Corporation36Retrieve Truncated Messages New ICAL RECEIVE subfunction code With an expanded response area Retrieves the response message after an ICAL SENDRECV isissued with an inadequate response area specification and getspartial data (AIB RC X100, AIB RS X00C) IMS keeps a copy of the entire response message in the controlregion private storage Until a subsequent ICAL SENDRECV, syncpoint, or applicationtermination Benefit Provides the ability to complete the retrieval of a reply messagethat had been truncated due to a too small output area Without having to re-issue a complete ICAL SENDRECV andassociated network transmission costs
  • 37. 2013 IBM Corporation37Async Callout to WebSphere MQ via MQ Bridge OTMA Descriptor enhancements New TYPE=MQSERIES to define WebSphere MQ destination Provides asynchronous callout and messaging support (DL/I ISRT ALTPCB) New option to allow exits to be called to override descriptor Applies to all destination descriptorsBenefits Eliminates need to write an OTMA user exit to recognize an MQ destination Simplifies integration and improves usabilityIMSApplicationWebSphereMQIMSOTMA
  • 38. 2013 IBM Corporation38Thank You!
  • 39. 2013 IBM Corporation39Additional Reference Material
  • 40. 2013 IBM Corporation40Diagnostics for Synchronous Callout The following diagnostics information is logged in the IMS log records: Synch Callout requests and responses Logged with OTMA 6701 ID=YOUT (for request) and ID=YRSP (for response) Matched by Sync Callout CORTKN, also includes LCRE token Note: no 01 or 03 log records since ICAL does not use IMS message queues ICAL timeout Logged with 67D0 (includes LCRE token) Sync Callout late reply Logged with 6701 ID=YNAK Resume TPIPE Logged with 6701 Client ACK / NAK response to Sync Callout request Logged with OTMA 6701 ID=YACK/YNAK (includes CORTKN) IMS Connect generated NAK (when external app or server went away ortimed out) Logged with OTMA 6701 ID=YNAK (includes LCRE token)
  • 41. 2013 IBM Corporation41Callout Techniques
  • 42. 2013 IBM Corporation42
  • 43. 2013 IBM Corporation43
  • 44. 2013 IBM Corporation44
  • 45. 2013 IBM Corporation45
  • 46. 2013 IBM Corporation46
  • 47. 2013 IBM Corporation47
  • 48. 2013 IBM Corporation48
  • 49. 2013 IBM Corporation49Callout with IMS TM Resource Adapter
  • 50. 2013 IBM Corporation50IMS TMResource AdapterRapid IMS SOA enablement with IBM tooling - RationalApplication Developer (RAD) Easy-to-use applicationdevelopment tool Graphical and source editors Modernize your IMSapplication Provider Parse existing IMSapplication source andgenerates Web app, EJBand Web Service No need to change IMSapplication Consumer Generate MDB/EJB toconsume IMS calloutrequestsIMS App Source(COBOL, PLI, MFS, C)*Also available in WID, RDz, RSA
  • 51. 2013 IBM Corporation51Callout with IMS TM RA Sample MDB codepublic class IMSCalloutIVPMDBBean implements javax.ejb.MessageDrivenBean, {::public javax.resource.cci.Record onMessage(javax.resource.cci.Record arg0, javax.resource.cci.InteractionSpec arg1)throws javax.resource.ResourceException {SYNCCALLOUTREQUEST request = new SYNCCALLOUTREQUEST();SYNCCALLOUTRESPONSE response = new SYNCCALLOUTRESPONSE();// Requestrequest.setBytes(((IMSInputStreamRecord)event).getBytes());System.out.println("Synchronous callout request from IMS: " +request.getSync__callout__request__str());// Responseresponse.setSync__callout__response__str("HELLO FROM WEBSPHERE MDB");System.out.println("Synchronous callout response from WAS MDB: " +response.getSync__callout__response__str());return response;}}
  • 52. 2013 IBM Corporation52TPIPENameIMS Connectconnection infoand DatastorenameCallout with IMS TM RA Deploy theRAR/Configure ActivationSpec
  • 53. 2013 IBM Corporation53Callout with IMS TM RA Deploy the MDB
  • 54. 2013 IBM Corporation54Callout with IMS SOAP Gateway
  • 55. 2013 IBM Corporation55Descriptor, SOAP configurationOTMA DescriptorDescriptor name XML ConverterXML AdapterTPIPESOAP DeploymentExternal WSDLConnectionBundle
  • 56. 2013 IBM Corporation56SOAP Configuration Connection BundleSOAP PropertiesTPIPEThread Policy
  • 57. 2013 IBM Corporation57Callout with Roll Your Own Application
  • 58. 2013 IBM Corporation58Callout with RYO - Programming1. Issue Resume TPIPE request CM0, Synclevel Confirm, RT Auto/Single, timeout Resume TPIPE on client ID or alternate client ID2. Receive the callout request and correlation token3. Send an ACK to acknowledge the callout request Alternately, you may send a NAK to stop the callout request4. Send an response back to IMS with correlation token Commit Mode 0, Send-Only Alternately, an error response maybe sent in case of errorsituation
  • 60. 2013 IBM Corporation60Callout with RYO Sample codepublic byte[] retrieveCalloutRequest() {int irmLen = 96;int totalLength = 4 + 4 + irmLen;ByteArrayOutputStream bout = new ByteArrayOutputStream();DataOutputStream out = new DataOutputStream(bout);out.writeInt(totalLength); // Total message lengthout.writeShort(irmLen); // IRM LLout.writeByte(3); // Architecture level 3out.writeByte(0x80); // F0 - Retrieve Sync callout only messageout.writeBytes("*SAMPL1*"); // Exit IDout.writeInt(0); // Reservedout.writeByte(0x10); // F5 - Resume Tpipe Singleout.writeByte(0x64); // Timeout - 2 minutesout.writeByte(0x10); // Persistent socketout.writeByte(0); // Reservedout.writeBytes(clientID); // Client IDout.writeByte(0); // F1out.writeByte(0x40); // F2 - Commit mode 0out.writeByte(0x01); // F3 - SyncLevel 1out.writeByte(R); // F4 - Resume Tpipeout.writeBytes(" "); // blank tran codeout.writeBytes(datastore); // datastore idout.writeBytes(" "); // blank lterm nameout.writeBytes(userID); // user idout.writeBytes(group); // groupout.writeBytes(password); // passwordout.writeBytes(" "); // blank APPL IDout.writeBytes(" "); // blank Alt Client IDout.writeShort((short)4); // End of message LLout.writeShort((short)0); // End of message ZZreturn bout.toByteArray();}
  • 61. 2013 IBM Corporation61Callout with RYO Sample code public String processCalloutRequest(byte[] messageBytes) {ByteArrayInputStream bain = new ByteArrayInputStream(messageBytes);DataInputStream in = new DataInputStream(bain);int msg_llll = in.readInt();short ll = in.readShort();short zz = in.readShort();byte[] irmIDBytes = new byte[8];in.readFully(irmIDBytes);String irmID = new String(irmIDBytes,"ascii");if (irmID.equals("*REQSTS*")) { // error// read return code and reason codethis.requestReturnCode = in.readInt();this.requestReasonCode = in.readInt();return null;} else if (irmID.equals("*CORTHN*")) {byte[] corrBytes = new byte[ll-12];in.readFully(corrBytes);this.correlationToken = corrBytes;}int data_llll = in.readInt();if (data_llll 0)) { totalLength += data.length() + 4; }ByteArrayOutputStream bout = new ByteArrayOutputStream();DataOutputStream out = new DataOutputStream(bout);out.writeInt(totalLength); // Total message lengthout.writeShort(irmLen); // IRM LLout.writeByte(3); // Architecture level 3out.writeByte(0); // F0out.writeBytes("*SAMPL1*"); // Exit IDout.writeInt(0); // Reservedout.writeByte(0); // F5out.writeByte(Z); // Timeout - No Waitout.writeByte(0x10); // Persistent socketout.writeByte(0); // Reservedout.writeBytes(clientID); // Client IDout.writeByte(0); // F1out.writeByte(0x40); // F2 - Commit mode 0out.writeByte(0x01); // F3 - SyncLevel 1out.writeByte(M); // F4 - Sync callout responseout.writeBytes(" "); // blank tran codeout.writeBytes(datastore); // datastore idout.writeBytes(" "); // blank lterm nameout.writeBytes(userID); // user idout.writeBytes(group); // groupout.writeBytes(password); // passwordout.writeBytes(" "); // blank APPL IDout.writeBytes(" "); // blank Alt Client IDout.writeBytes(" "); // blank Adapter nameout.writeBytes(" "); // blank Converter nameout.writeBytes(" "); // blank MOD nameout.write(corrToken); // corrleation tokenout.writeInt(data.length()+4);out.writeBytes(data); // Dataout.writeShort((short)4); // End of message LLout.writeShort((short)0); // End of message ZZreturn bout.toByteArray();}
  • 63. 2013 IBM Corporation63IMS Connect API Provides simplified API to build User-written IMS Connect clientapplication to invoke IMS transactions from Java and Cenvironments Shields users from IMS Connect protocol (IRM, CSM, RSM, etc.)and low-level socket communications Recommend to use in RYO client application that does not run inan application server Value Extends the value of IMS resources by allowing easy access fromnew Java or C-based applications Simplifies migration of existing applications from SNA to TCP/IP Simplifies development of new applications to access IMStransactions