1 / 42

Web Services - Part 1

Web Services - Part 1. Takahiro Ishiwatari ishwtari@jp.ibm.com. Acknowledgements.

odelia
Download Presentation

Web Services - Part 1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Web Services - Part 1 Takahiro Ishiwatari ishwtari@jp.ibm.com

  2. Acknowledgements • The following are trademarks of International Business Machines Corporation in the United States, other countries, or both: IBM, CICS, CICS/ESA, CICS TS, CICS Transaction Server, DB2, MQSeries, 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, Windows NT, 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.

  3. Agenda • Web Services introduction • SOAP for CICS feature • Web Services in CICS TS V3.1 • WSDL • Application development • New utility programs • Web services binding file • DFHLS2WS • DFHWS2LS

  4. Web Services introduction • An architecture for application to application interoperation • base on SOA (Service-Oriented Architecture) • enables open/dynamic B2B integration • Core technologies used in Web Services • SOAP • XML • WSDL • UDDI • SOAP (Simple Object Access Protocol) • Light-weight protocol for distributed environment • XML based • independent of transport protocol • HTTP, JMS, etc. • used for communication between requester/provider • CICS addresses the requester/provider elements in Web Services SOAP <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://・・・/" > <SOAPENV:Body> <symbol>ABC</symbol> <Quote>073</Quote> </SOAP-ENV:Body> </SOAP-ENV:Envelope>

  5. SOAP for CICS feature • Feature for CICS TS V2.2 and V2.3 • Provides the ability to handle SOAP messages in CICS • Two types of transport supported • HTTP • WMQ • CICS can be a service provider or a service requester • User replaceable program for specialized processing • Header handling • Message formatting • XML processing • XML parser of Enterprise COBOL for z/OS and OS/390 can be used to help convert XML messages to language structures (i.e. COMMAREAs) • WSED provided XML enablement tool can be used to create converters

  6. SOAP for CICS inbound • SOAP message will get processed through a pipeline • Pipeline executed as a BTS process • Create message adaptor to convert XML and language structure • Message handlers and application mapper are user replaceable CICS TS V2 Pipeline CICS Web Support or WebSphere MQ service provider transport SOAP message message handler application mapper envelope parser Service Requester Business Logic message adaptor service provider transport message handler envelope builder

  7. SOAP for CICS outbound • Outbound messages will also go through a pipeline • Pipeline executed as a BTS process • Create message adaptor to convert XML and language structure • Message handlers are user replaceable CICS TS V2 Pipeline Outbound HTTP Support or WebSphere MQ service provider transport message handler envelope builder SOAP message Business Logic Service Provider message adaptor outbound router service provider transport message handler envelope parser

  8. Web Services in CICS TS V3.1 • Evolution of SOAP for CICS feature • New infrastructure to act as a first class Web service end-point • Support for SOAP 1.1 & 1.2, WS-AtomicTransaction, WS-Security • Fully integrated into CICS • RDO, system management, problem determination, monitoring & statistics, etc. • New tooling support for easier application development • New features • Resource definitions • URIMAP, PIPELINE, WEBSERVICE • Flexible configuration of the pipeline • Utility programs to • generate language structure from WSDL • generate WSDL from language structures • Data mapping support in runtime • Between SOAP messages and language structures • New EXEC CICS API to support outbound requests • no longer uses BTS

  9. Resources for CICS as a service provider CICS TS V3.1 • HTTP transport TCPIPSERVICE CSOL SOAP message CPIH CWXN Service Requester Pipeline URIMAP matching handlers URIMAP HFS handlers dynamic install pipeline config handlers WSDL PIPELINE data mapping CICS Web services assistant dynamic install Business Logic WSBind WEBSERVICE Language structure

  10. Resources for CICS as a service requester • HTTP transport CICS TS V3.1 User Transaction Business Logic Language structure HFS EXEC CICS INVOKE WEBSERVICE WEBSERVICE WSBind data mapping CICS Web services assistant Pipeline dynamic install PIPELINE WSDL handlers pipeline config handlers handlers Service Provider SOAP message

  11. WebSphere MQ transports CICS TS V3.1 WebSphere MQ CKTI CPIQ CPIL SOAP message Service Requester Pipeline URIMAP matching Business Logic URIMAP PIPELINE WEBSERVICE CICS TS V3.1 WebSphere MQ User Transaction PIPELINE Business Logic WEBSERVICE EXEC CICS INVOKE WEBSERVICE Pipeline Service Provider SOAP message

  12. Web Services - Notes This diagram illustrates the flow when WebSphere MQ transport is used. For a service provider, the arrival of the SOAP message will trigger CPIL transaction which will match the incoming URI with the URIMAP definition. The pipeline will run under a transaction which default is CPIQ. The pipeline processing will be the same as HTTP transports.

  13. WSDL • Web Services Description Language • XML based language to describe an interface of a service • WSDL comprises of • type • message • portType • operation • binding • service • port Web service description type message Service interface definition portType operation Input Output binding Service implementation definition service port

  14. Sample WSDL <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions targetNamespace="http://soapheader.ibm.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:intf="http://soapheader.ibm.com" xmlns:impl="http://soapheader.ibm.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns="http://schemas.xmlsoap.org/wsdl/"> <wsdl:types> <schema targetNamespace="http://soapheader.ibm.com" xmlns="http://www.w3.org/2001/XMLSchema"> <element name="getLastSellPrice"> <complexType> <sequence> <element name="ticker" nillable="true" type="xsd:string" /> </sequence> </complexType> </element> <element name="getLastSellPriceResponse"> <complexType> <sequence> <element name="getLastSellPriceReturn" type="xsd:int" /> </sequence> </complexType> </element> <element name="quote_timestamp" type="xsd:dateTime" /> </schema> </wsdl:types> namespace definitions data type definitions (*)

  15. (*) <wsdl:message name="getLastSellPriceRequest"> <wsdl:part name="parameters" element="intf:getLastSellPrice"/> <wsdl:part name="request_header" element="intf:quote_timestamp"/> </wsdl:message> <wsdl:message name="getLastSellPriceResponse"> <wsdl:part name="parameters" element="intf:getLastSellPriceResponse"/> </wsdl:message> <wsdl:portType name="StockService"> <wsdl:operation name="getLastSellPrice"> <wsdl:input name="getLastSellPriceRequest" message="intf:getLastSellPriceRequest"/> <wsdl:output name="getLastSellPriceResponse" message="intf:getLastSellPriceResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="StockServiceSoapBinding" type="intf:StockService"> <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="getLastSellPrice"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="getLastSellPriceRequest"> <wsdlsoap:header message="intf:getLastSellPriceRequest" part="request_header" use="literal"/> <wsdlsoap:body use="literal" parts="parameters"/> </wsdl:input> <wsdl:output name="getLastSellPriceResponse"> <wsdlsoap:body use="literal" parts="parameters"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="StockServiceService"> <wsdl:port name="StockService" binding="intf:StockServiceSoapBinding"> <wsdlsoap:address location="http://localhost:9080/SOAPHeaderWeb/services/StockService"/> </wsdl:port> </wsdl:service> </wsdl:definitions> definition of the data being communicated definition of operation supported by the service concrete protocol and data format specification URL at which the service will be executed

  16. Usage of Web service description • Requests from Service Requesters will be generated based on the information contained in WSDL documents • IDE tools help generation of WSDL or application IDE tools IDE tools WSDL • location • protocol • operation • message format Input message Service Requester Service Provider Output message

  17. WSDL • location • protocol • operation • message format Service WSDL • location • protocol • operation • message format Service Development approaches • “Top down” approach • create a service from an existing WSDL • create a new Web service application • better interfaces for the requester • development cost • “Bottom up” approach • create a WSDL from an existing application • expose the application as a Web service • quicker implementation of the service • more complex interface for the requester • “Meet in the middle” approach • create a WSDL from an existing application, modify the WSDL and create a wrapper from the modified WSDL • indirectly expose the application as a Web service • more suitable interface for the requester • minimum development WSDL • location • protocol • operation • message format Wrapper Service

  18. Application development : SOAP for CICS • Current tooling provides … • Bottom up approach for a service provider • WSED can help you create an XML-COMMAREA converter • utilizes XML parser of Enterprise COBOL for z/OS and OS/390 • XML schema generated from WSED can be used as part of the WSDL • use WSDL editor to compose a WSDL • No tool support for use as a service requester xsd IDE tools WSDL Web Services wizard XML Enablement tool create import deploy generate Message Adaptor input converter COBOL source Service Requester business logic driver program SOAP for CICS pipeline output converter CICS

  19. SOAP for CICS using WSED: Bottom up approach AD environment (workstation) COMMAREA Program source Import generate XML Enablement Tool XMLConverters (Message Adaptor) Message definition (XSD) reference z/OS environment Web Services Wizard Service definition (WSDL) Compile/LKED generate Service Requester Client Proxy deploy deploy deploy Service Requester Client Proxy XMLConverters (Message Adaptor) COMMAREA program Transport Web Services Client(J2SE/J2EE) Web Services End-point(CICS) Runtime Environment

  20. Application development : CICS TS V3.1 Web service • CICS provides the necessary tools and runtime • WSDL can be generated from a utility • a bottom up approach from an existing application • Utility can generate language structures from WSDL • a top down approach to a new CICS service provider programs • for CICS service requester programs • CICS provides XML-language structure (COMMAREA) conversion top down CICS Web services assistant IDE tools WSDL bottom up • COBOL • PL/I • C/C++ binding file lang. structure CICS Web service Service Requester business logic pipeline conversion CICS

  21. CICS TS V3.1 using WebSphere Studio tooling • Bottom up approach AD environment (workstation) z/OS environment input CICS Web services assistant generate Web Services Wizard Service definition (WSDL) language structure generate Service Requester Client Proxy binding file deploy deploy deploy Service Requester Client Proxy Pipeline target program Transport Web Services Client(J2SE/J2EE) Web Services End-point(CICS) Runtime Environment

  22. CICS TS V3.1 using WebSphere Studio tooling… • Top down approach AD environment (workstation) z/OS environment generate CICS Web services assistant input Web Services Wizard Service definition (WSDL) language structure target program source generate Service Requester Client Proxy binding file Compile/LKED deploy deploy deploy deploy Service Requester Client Proxy Pipeline target program Transport Web Services Client(J2SE/J2EE) Web Services End-point(CICS) Runtime Environment

  23. CICS TS V3.1 using WebSphere Studio tooling… • As a Service Requester AD environment (workstation) z/OS environment generate CICS Web services assistant input Web Services Wizard Service definition (WSDL) language structure requester program source generate Service Provider Stub binding file Compile/LKED deploy deploy deploy deploy Service Provider Stub Pipeline requester program Transport Web Services End-point(J2SE/J2EE) Web Services Client(CICS) Runtime Environment

  24. Scenarios for “Meet in the middle” approach • If you have an existing application and… • an existing WSDL is to be used as interface to the client • e.g. WSDL defined from a requesters perspective • only want to expose fields that are necessary to the requester • existing language structure may be complex, contain unnecessary fields for the requester • use an interface more suitable for the requester • the existing language structure uses data types not supported by the utility • wrapper program converts the data type to a supported data type • the existing application is written in a language not supported by the utility • Assembler or Java programs • etc. • COBOL • PL/I • C/C++ CICS Web services assistant existing lang. structure WSDL • COBOL • PL/I • C/C++ new lang. structure binding file CICS Web service Wrapper program new language structure existing commarea structure existing business logic pipeline conversion

  25. CICS Web services assistant • Helps deploy an application program in a Web services environment • with minimum amount of programming and resource definition • Two utility programs provided • DFHLS2WS • creates WSDL from a language structure • DFHWS2LS • creates language structure from WSDL • Supplied JCL procedures will invoke a Java program on USS • Generates the WSDL or language structure • Generates a Web service binding file (WSBind file) • for use in CICS Web service runtime

  26. Web service binding file • Web service binding file (WSBind file) • holds information about the Web service • contents • header section containing the information on the characteristics of the service • target program name • interface to the target program ( commarea or channel ) • etc. • for each operations • the input / output message layout - used to map data between SOAP messages and commarea/channel • used for WEBSERVICE resource definition • WEBSERVICE resource can be created based on the information in the file • the WSBind and WSDL files associated with the service • associated PIPELINE, URIMAP definition • Bindings and end-point • CICS program name and it’s interface type, if it is a CICS service • Dynamically created by PERFORM PIPELINE SCAN (recommended) • information can be obtained by INQUIRE WEBSERVICE command

  27. CICS usage of the WSBind file • CICS as a service provider • CICS as a service requester CICS Web services Service Requester business logic pipeline HLL data structure SOAP body Data mapping WSBind file WEBSERVICE resource WSDL CICS CICS Web services Service Provider business logic pipeline HLL data structure SOAP body Data mapping WSBind file WEBSERVICE resource WSDL CICS

  28. CICS Web services assistant • DFHLS2WS (Language structure to Web service) • For a bottom up approach development • Input • Programming language data structure • In COBOL or PL/I or C or C++ • Interface to the program can be COMMAREA or CHANNEL • Output • Web services binding file • Web services description (WSDL) generate COBOL PL/I C/C++ input Service definition (WSDL) language structure DFHLS2WS WSBind file

  29. CICS Web services assistant • DFHWS2LS (Web service to language structure) • For a top down approach and service requester development • Input • Web services description (WSDL) • Output • Web services binding file • high level language data structure • In COBOL or PL/I or C or C++ • Interface to the program can be COMMAREA or CHANNEL input generate COBOL PL/I C/C++ Service definition (WSDL) language structure DFHWS2LS WSBind file

  30. Input parameters for DFHLS2WS

  31. Input parameters for DFHWS2LS

  32. DFHLS2WS Sample • Sample JCL for DFHLS2WS //LS2WS JOB (accounting information),CLASS=A,REGION=0M // SET QT='''' //JAVAPROG EXEC DFHLS2WS, // JAVADIR='java142s' //INPUT.SYSUT1 DD * LOGFILE=/some/user/directory/ls2ws.log WSDL=/some/user/directory/wsdl/RegisterPets.wsdl PGMNAME=REGPETS URI=/alocalURI PGMINT=CHANNEL CONTID=PETSCONTAINER LANG=COBOL WSBIND=/some/user/directory/RegPets.wsbind PDSLIB=//USER1.COPYBOOK REQMEM=TESTFILE */ < Input COBOL structure > 03 NAME PIC X(16). 03 AGE PIC 99. 03 PETS OCCURS 3. 05 TYPE PIC X(8). 05 COLOUR PIC X(8).

  33. DFHLS2WS Sample… • output WSDL <?xml version="1.0" ?> <definitions targetNamespace="http://www.REGPETS.com/schemas/REGPETS.com/schemas/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:reqns="http://www.REGPETS.com/schemas/REGPETSRequest" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.REGPETS.com/schemas/REGPETS.com/schemas/"> <types> <xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://www.REGPETS.com/schemas/REGPETSRequest" xmlns:tns="http://www.REGPETS.com/schemas/REGPETSRequest" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:complexType abstract="false" block="#all" final="#all" mixed="false" name="ProgramInterface"> <xsd:annotation> <xsd:documentation source="http://www.ibm.com">This schema was generated for use with CICS.</xsd:documentation> </xsd:annotation> <xsd:sequence> <xsd:element name="NAME" nillable="false"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:length value="16"/> <xsd:whiteSpace value="preserve"/> </xsd:restriction> </xsd:simpleType> </xsd:element> <xsd:element name="AGE" nillable="false"> <xsd:simpleType> <xsd:restriction base="xsd:unsignedShort"> <xsd:maxInclusive value="99"/> <xsd:minInclusive value="0"/> </xsd:restriction> </xsd:simpleType> </xsd:element> Part 1 of 3

  34. DFHLS2WS Sample… <xsd:element maxOccurs="3" minOccurs="3" name="PETS" nillable="false"> <xsd:complexType mixed="false"> <xsd:sequence> <xsd:element name="TYPE" nillable="false"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:length value="8"/> <xsd:whiteSpace value="preserve"/> </xsd:restriction> </xsd:simpleType> </xsd:element> <xsd:element name="COLOUR" nillable="false"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:length value="8"/> <xsd:whiteSpace value="preserve"/> </xsd:restriction> </xsd:simpleType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> <xsd:element name="REGPETS" nillable="false"> <xsd:complexType mixed="false"> <xsd:sequence> <xsd:element name="content" type="tns:ProgramInterface"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> </types> <message name="REGPETSRequest"> <part element="reqns:REGPETSRequest" name="RequestPart"/> </message> <message name="REGPETSResponse"/> Part 2 of 3

  35. DFHLS2WS Sample… <portType name="REGPETSPort"> <operation name="REGPETS"> <input message="tns:REGPETSRequest" name="REGPETSRequest"/> <output message="tns:REGPETSResponse" name="REGPETSResponse"/> </operation> </portType> <binding name="REGPETSWMQSoapBinding" type="tns:REGPETSPort"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="REGPETS"> <soap:operation soapAction="" style="document"/> <input name="REGPETSRequest"> <soap:body parts="RequestPart" use="literal"/> </input> <output name="REGPETSResponse"> <soap:body use="literal"/> </output> </operation> </binding> <binding name="REGPETSHTTPSoapBinding" type="tns:REGPETSPort"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="REGPETS"> <soap:operation soapAction="" style="document"/> <input name="REGPETSRequest"> <soap:body parts="RequestPart" use="literal"/> </input> <output name="REGPETSResponse"> <soap:body use="literal"/> </output> </operation> </binding> <service name="REGPETSService"> <port binding="tns:REGPETSHTTPSoapBinding" name="REGPETSPort"> <soap:address location="http://my-server:my-port/a_local_URI"/> </port> </service> </definitions> Part 3 of 3

  36. Mapping of COBOL data structures and WSDL <xsd:simpleType> <restriction base=“xsd:string”> <xsd:maxLength value="8" /> <whiteSpace value="preserve"/> </restriction> </simpleType> PIC X(8) PIC S9(5) <xsd:simpleType> <restriction base=“xsd:int”> <xsd:minInclusive value=“-999999999”/> <xsd:maxInclusive value=“999999999”/> </restriction> </simpleType>

  37. Web Services - Notes • REDEFINES • LEVEL 66 (RENAMES), 77, 88 • SIGN TRAILING, SIGN LEADING • BINARY, PACKED-DECIMAL, POINTER • COMP 1, 2 • POINTER, FUNCTION-POINTER, PROCEDURE-POINTER • OBJECT REFERENCE • SYNCHRONIZED • OCCURS DEPENDING ON, OCCURS INDEXED BY • DATE FORMAT • Data description items whose values can be affected by compiler options • BLANK WHEN ZERO, JUSTIFIED, VALUE clause are ignored The table above shows how COBOL data type elements are mapped to XML schema elements. Data types not listed are not supported in DFHLS2WS. The following restriction also apply: Support or restrictions for PL/I, C/C++ languages can be found in the CICS Web Services Guide.

  38. Mapping of COBOL data structures and WSDL …

  39. Web Services - Notes • Only SOAP bindings which use literal encodings are supported. • The only transport protocols supported by DFHWS2LS are http, https and WebSphere MQ. • Data type definitions must be encoded using the XML Schema Definition language (XSD). Within the schema: • Data types used in the SOAP message must be explicitly declared. DFHWS2LS does not support data types in the SOAP message that are derived from other data types in the schema and that are not declared. • DFHWS2LS does not support: - the <any>, <list>, and <union> elements - the maxOccurs and minOccurs attributes on the <sequence>, <all> and <choice> elements. - abstract types (except as nonterminal types in an inheritance hierarchy) - the anyType and the anySimpleType types - cyclic references - <attribute> element is ignored. • The length of some keywords within the Web services description is limited. For example, operation, binding and part names are limited to 255 characters in length (in some cases the maximum operation name length may be slightly shorter). • Only one service element is supported for each binding element. The table above shows how XML schema elements are mapped to COBOL data types. Support or restrictions for PL/I, C/C++ languages can be found in the CICS Web Services Guide. DFHWS2LS supports Web services descriptions that conform to WSDL version 1.1, with the following restrictions:

  40. Steps for using CICS as a service provider • For bottom up approach • Prepare copybook of data structure • Run DFHLS2WS • Generate WSDL and WSBind file • For top down approach • Prepare WSDL document • Run DFHWS2LS • Generate language structure and WSBind file • Create application • For meet in the middle approach • Run DFHLS2WS/DFHWS2LS and generate WSDL/language structure • Create a wrapper program • Create & install PIPELINE definition • create XML file for processing nodes • Create & install WEBSERVICE and URIMAP definition • PERFORM PIPELINE SCAN command • Create service requester program

  41. Steps for using CICS as a service requester • Prepare WSDL file • Run DFHWS2LS • data structure • Web service binding file • Create & install PIPELINE definition • create XML file for processing nodes • Create & install WEBSERVICE definition • PERFORM PIPELINE SCAN command • Create application • EXEC CICS INVOKE WEBSERVICE

  42. Summary • CICS Web service allows CICS applications be integrated with a Service Oriented Architecture (SOA) • CICS applications in new scenarios • CICS as a Service Provider to an existing program • Existing application not changed • a wrapper to an existing application • CICS as a Service Provider to a new program • CICS as a Service Requester from a new program • Web services assistant • Enables rapid deployment of CICS applications for use in service providers and service requesters

More Related