1.264 Lecture 24 Service Oriented Architecture Electronic Data Interchange (EDI) Next class: Anderson chapter 1, 2. Exercise due before class 1 Solution- case study Customer Manufacturer, distributor Web svc request B-to-B DB svr Web svr Web svc response HTTP/XML request Web svr HTTP/XML, response B-to-C XSLT if needed Client/ browser WSDL, XSD/DTD HTTP request HTTP/XHTML, response Industry svr DB conn, SQL query DB svr DB conn, SQL resultset XSLT if needed WSDL, XSD/DTD • XSLT used by customer or manufacturer/distributor to alter XML being sent or received • XSD and/or DTD used by customer or manufacturer/ distributor to validate XML being sent or rec’d • Web services package the HTTP, XML, XSD, request/response and URL used in “raw” XML transfers • Web services described in WSDL documents in registry. E.g., – Manufacturer/distributor registers Web service in UDDI registry – Customer discovers Web service and invokes it on mfr/distrib Web server • Visual tool: CSS for XHTML, XSLT for XML 2 Challenges of system integration • Companies use multiple systems that must increasingly cooperate – – – – – Systems often are in different business groups Or in different companies (vendors, channel partners…) Run on different platforms (operating system, hardware) Written in different languages Use different communication protocols • File transfer, EDI, XML, RPC, MQ, CORBA, COM, sockets… – Have different databases, data definitions – Have different objectives, run at different times/periods • Solution is desired that allows integration in spite of different languages, protocols, hardware… 3 Service oriented architecture (SOA) • Web services are basis for integration in SOA • A core of standard open technologies are used – XML, XML Schema (XSD), XSLT, SOAP, WSDL – Operating system-, hardware-, software-, database-neutral • A registry (database) is used to store WSDL for service discovery • Security, reliability, performance, transactions must be added to ‘primitive’ Web services to have SOA • SOA supports composition (assembling) of services, reusability of services, extensibility • SOA is based on a service-focused business model – UML business process models can be implemented in SOA 4 Service oriented architecture 2 • SOA is based on loose coupling between systems • Asynchronous, or message-oriented (MOM) integration – Document is sent from system A to system B – Response generally not guaranteed in any given time • A process may not complete for a long time • Example: Shipment tracking service (success) • Example: Async telecom service orders system (failed) 5 Example of current SOA implementation An Early Incarnation of SOA Service registry Discover and retrieve WSDL Service requestor Publish WSDL Exchange SOAP messages Service provider Image by MIT OpenCourseWare. Service is Web service 6 SOA architecture (between Web servers) Company 1 Service provider Order fulfillment service Company 2 Request message Response message Purchase order service Service requester Accounts payable service Service provider Request message Service requester Invoice submission service Response message Company 1 and 2 swap roles via exchanges of messages. Image by MIT OpenCourseWare. 7 SOA use of WSDL Company 1 Invoice submission service Message is compliant with Ensures message will be successfully interpreted by Accounts payable service Accounts payable service WSDL Order fulfillment service Order fulfillment service WSDL Ensures message will be successfully interpreted by Company 2 Purchase order service Message is compliant with Image by MIT OpenCourseWare. 8 SOA service composition Accounts payable composition Accounts payable service Vendor profile service Ledger service Company 2 Image by MIT OpenCourseWare. 9 Web services and existing systems Integrated system built using Web services/SOA to existing systems Service Interface Layer Service interface representation Application Layer Application (.NET) (A) Application (J2EE) Application (Legacy) (B) (C) Physical service encapsulation Image by MIT OpenCourseWare. 10 Exercise • Draw an SOA diagram for your homework system • Decide how you would structure your catalog browsing and ordering systems • Draw your Web services • Draw the Web services your customers would use to communicate with you • Use Figure 5.4 and/or Figure 5.15 on the previous slides as a template 11 Web 2.0 • First generation Web services: SOAP, WSDL, UDDI (WSDL registry) – Met functional requirements for businesses, but not the supporting requirements: security, reliability, availability, quality of service, choreography • Web 2.0: WS-* specifications: – – – – – – – – – WS-Addressing: references to Web service endpoint WS-Atomic Transaction WS-Business Process Execution Language WS-Choreography Language WS-Coordination and WS-Eventing WS-Metadata Exchange Language WS-Notification WS-Reliable Messaging WS-Security: end to end, not just point to point 12 Business Process Execution Language A Typical Strategy Using Electronic Data Interchange (EDI) for Business Process Definition Implementation Inventory Service Process start Inventory service Check availability X Inventory Servicing Case1 Case2 Inventory Service Assign 1 Inventory Service Response Assign 2 X InventoryServiceResponse Process end Image by MIT OpenCourseWare. 13 EDI (Electronic Data Interchange) • EDI is a mainframe-based standard for electronic exchange of information. Developed in 1980s. – EDI is expensive, complex and has limited usage, but enough that new technologies must interoperate with it – Typically, large companies use EDI and require it of their smaller partners/vendors, who are not always eager to use it – Two EDI standards: ANSI X12 and EDIFACT (UN) • XML documents follow EDI standards in many cases – EDI documents are called Transaction Sets (TS) – EDI to XML mapping established using DTDs • New users of Internet ecommerce may skip EDI and use XML – Less than 80,000 of 6-10 million US businesses use EDI – 125,000 businesses world-wide use EDI – EDI cost and complexity are large obstacle for medium size businesses 14 EDI • EDI communications: – Binary, not text (difficult to change or troubleshoot) • EDI transaction sets are static • EDI designed for expensive and scarce communications – Much optimization of message size, etc. – Intended to replace letters, phone calls, faxes – Not self-describing, cannot be validated, can’t be extended… – Done through third party value-added networks (VANs) – Companies generally use file transfer to send file to VAN • VAN handles EDI exchange with trading partners • Geared to once-a-day, batch exchanges of data – Example (over a period of days): A purchaser: • • • • • • Sends EDI 840 document (Request for Quote) Receives EDI 843 (Quote) Sends EDI 850 (Purchase Order) Receives EDI 856 (Shipment Notice) Receives EDI 810 (Invoice) Sends EDI 820 (Payment) 15 EDI and XML Buyer AES Internet or Value Added Network EDI 850 Purchase Order ERP System EDI System EDI 855 Purchase Order Acknowledgement Supplier GCS WebLogic EDI Integration CRM System Image by MIT OpenCourseWare. EDI/XML translation 16 ISA -- Interchange ISA Interchange Control Control Header Header EDI Purpose: To Purpose: To start start and and identify identify an an interchange interchange of of one one or or more more functional functional groups, interchange groups, interchange related related control control segments. segments. Field Field Element Element ISA01 ISA01 101 101 ISA02 ISA02 102 102 Field Name Field Name Authorization Authorization Information Information Qualifier Qualifier Authorization Authorization Information Information Req Type Req Type Size Size Seagate Usage Seagate Usage M M ID ID 22 00 00 M M AN AN 10 10 Not used Not used by by Seagate Seagate M M ID ID 22 00 00 ISA03 ISA03 103 103 Security Security Authorization Authorization Information Information ISA04 ISA04 104 104 Security Security Information Information M M AN AN 10 10 Not used Not used by by Seagate Seagate ISA05 ISA05 105 105 Interchange Interchange ID Qualifier ID Qualifier M M ID ID 22 Trading partner Trading partner qualifier qualifier ISA06 ISA06 106 106 Interchange Interchange Sender ID Sender ID ISA07 ISA07 105 105 ISA08 ISA08 M M ID ID 15 15 098533326 == 098533326 Seagate production Seagate production ID ID 98533326TST == 98533326TST Seagate test Seagate test ID ID M M ID ID 22 Trading partner Trading partner qualifier qualifier 107 107 Interchange Interchange ID Qualifier ID Qualifier Interchange Interchange Receiver ID Receiver ID M M ID ID 15 15 Trading partner Trading partner receiver ID receiver ID ISA09 ISA09 108 108 Date Date M M DT DT 66 Current data: Current data: YYMMDD YYMMDD ISA10 ISA10 109 109 Time Time M M TM TM 44 Current time: Current time: HHMM HHMM ISA11 ISA11 110 110 M M ID ID 11 12 U == ANSI U ANSI XX12 ISA12 ISA12 111 111 M M ID ID 55 00306 00306 ISA13 ISA13 112 112 Interchange Interchange Control Number Control Number M M NO NO 99 ISA14 ISA14 113 113 Acknowledgement Acknowledgement M M ID ID 11 ISA15 ISA15 114 114 Test Indicator Test Indicator M M AN AN 11 Trading partner Trading partner specified specified 00 == no no acknowledgment acknowledgment 11 == interchange interchange acknowledgment acknowledgment requested requested (always use (always use 0) 0) PP == production production data data T == test T test data data ISA16 ISA16 115 115 Sub-Element Sub-Element Separator Separator M M AN AN 11 Defined by Defined by sender sender Interchange Interchange Standards Standards Identifier Identifier Interchange Interchange Version ID Version ID Image by MIT OpenCourseWare. EDI Example 17 Retail information flows Sales/Marketing Purchase order SUPPLIER Purchasing Receiving information Purchase order acknowledgment Open purchase order information Freight bill Invoice Accounts payable Account balances & Payment remittance information SUPPLIER BANK Payment remittance & Notification to pay Accounts receivable Receiving Bill of lading Order status inquiry response CARRIER BUYER BANK Image by MIT OpenCourseWare. 18 Distributor information flow Purchase order acknowledgment Purchasing requisitions Purchase order SUPPLIER Purchasing Receiving information Purchase order acknowledgment Open purchase order information Accounts payable SUPPLIER BANK Payment remittance & Notification to pay Incoming order information Shipping information Distribution/Receiving Freight bill Invoice Account balances & Payment remittance information Internal order Purchase order Sales/Marketing Bill of lading Order status inquiry response Invoice Accounts receivable Account balances & Payment remittance information Payment remittance & Notification to pay SELLER BANK CARRIER CUSTOMER CUSTOMER BANK BUYER BANK Image by MIT OpenCourseWare. 19 Financial information flow BUYER BANK CUSTOMER Notification to transfer funds & Payment remittance SELLER BANK CUSTOMER Invoice BUYER BANK Transfer funds Pass EDI data Purchasing Accounts payable Transfer funds & Payment remittance information Transfer funds & Payment remittance information CENTRAL BANK Account balances & Payment remittance information SELLER BANK Purchase order Invoice SUPPLIER OF PRODUCT FOR BANK Image by MIT OpenCourseWare. 20 Manufacturing/engineering information flow Request for quote - Quote Request for quote - Quote Request for quote - Quote Engineering Inventory inquiry - Advice Purchase order - acknowledgment Purchasing requisitions Purchase order SUPPLIER Purchasing Purchase order - acknowledgment Freight bills Accounts payable Payment remittance & Notification to pay SUPPLIER BANK Internal order Shipping information BUYER BANK Bill of lading CARRIER Order status inquiry responses Accounts Receivable Account balances & Payment remittance information Warehouse requests - responses CUSTOMER Invoice Distribution Open purchase order information Account balances & Payment remittance information Incoming order information Receiving information Invoice Purchase order Sales/Marketing SELLER BANK Payment remittance & Notification to pay CUSTOMER BANK OUTSIDE WAREHOUSE Image by MIT OpenCourseWare. 21 Manufacturer information flow: detail Request for quote - Quote Request for quote - Quote Evaluate request for quote Request for quote -Quote Develop Manufacturing spec SUPPLIER MANUFACTURING LOCATION order processing invoicing Internal order Manufacturing Requirements Planning Product Requirements Purchasing Purchase order Purchase order information Invoice Authorize payment, Invoice reconciliation Account balances & Payment remittance information CUSTOMER Order entry, Order process Payment remittance & Notification to pay SUPPLIER BANK BUYER BANK transfer funds transfer funds pass account balances pass account balances Receiving information Product requisition Shipment staging, Develop bill of lading, Receive product Bill of lading Freight bills Internal staging order Purchase order Purchase order information Freight bill information invoice reconciliation Invoice Invoicing, Billing, Credit payments, Payment reconciliation Shipment information Warehouse status inquiry messages purchasing Account balances & Payment remittance information Payment remittance & Notification to pay CARRIER develop freight bill WAREHOUSE CUSTOMER BANK SELLER BANK order status shipment staging transfer funds transfer funds pass account balances pass account balances Image by MIT OpenCourseWare. 22 ERP and EDI/XML standards • The previous slides define the core of an ERP system – Many have very substantial additions for human resources, planning, etc. – You can buy a full ERP or mix and match best of breed systems. Web service/SOA integration is common. • Almost every interface on the previous slides has a defined EDI or XML transaction set or message set, typically defined by industry – TDCC (1968), EDX, CDIX, TALC, UCS/VICS, WINS, BVAI and others 23 MIT OpenCourseWare http://ocw.mit.edu 1.264J / ESD.264J Database, Internet, and Systems Integration Technologies Fall 2013 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.