e Commerce Technology 20 751 Data Interchange Outline

  • Slides: 34
Download presentation
e. Commerce Technology 20 -751 Data Interchange

e. Commerce Technology 20 -751 Data Interchange

Outline • The need for data interchange – Transactions imply data exchange • XML

Outline • The need for data interchange – Transactions imply data exchange • XML for identifying data – Separation of • content • appearance • document structure • Integrating with legacy applications – Legacy application: one you wish you could replace but can’t • ASN. 1 for self-describing data formats – Solves a different problem than XML does – Not what the data means but how it is encoded 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2002 COPYRIGHT © 2002 MICHAEL I. SHAMOS

e. Commerce Data Exchange Needs RFQs Ship Notices Catalogs Letters of Credit Quotations Purchase

e. Commerce Data Exchange Needs RFQs Ship Notices Catalogs Letters of Credit Quotations Purchase Orders Electronic Payments Bills of Lading Invoices 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2002 COPYRIGHT © 2002 MICHAEL I. SHAMOS

Invoice Example <Unit. Price>6. 05</Unit. Price> SOURCE: PROF. JEROME YEN 20 -751 ECOMMERCE TECHNOLOGY

Invoice Example <Unit. Price>6. 05</Unit. Price> SOURCE: PROF. JEROME YEN 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2002 COPYRIGHT © 2002 MICHAEL I. SHAMOS

Data Exchange Problem Different systems and applications use different names and formats for the

Data Exchange Problem Different systems and applications use different names and formats for the same information: SOURCE: FTISOFT

How to Make Data Portable • Tell what the data means • Tell how

How to Make Data Portable • Tell what the data means • Tell how the data is structured • Tell how it should look SO COMPUTERS CAN UNDERSTAND IT • BUT DO THESE SEPARATELY. MIXING IS BAD • • The meaning -- XML The structure -- DTD (document type definition) The formatting -- XSL (Extensible style sheet) Example: XML catalog structure – DTD, XSL

XML at a glance Well Formed Document: <Book> <Author>George Soros</Author> <Title>The Crisis of Global

XML at a glance Well Formed Document: <Book> <Author>George Soros</Author> <Title>The Crisis of Global Capitalism</Title> <Year>1998</Year> <Publ>Public Affairs</Publ> <Price>26. 00</Price> <ISBN>1 -891620 -27 -4</ISBN> </Book> DTD: Document Type Definition <? xml version="1. 0"> <!DOCTYPE Book [ <!ELEMENT Book (Author, Title, Year, Publ, Price, ISBN)> ]> SOURCE: PROF. JEROME YEN 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2002 COPYRIGHT © 2002 MICHAEL I. SHAMOS

XML Recipe Example <? xml version="1. 0"? > <Recipe> <Name>Apple Pie</Name> <Ingredients> <Ingredient> <Qty

XML Recipe Example <? xml version="1. 0"? > <Recipe> <Name>Apple Pie</Name> <Ingredients> <Ingredient> <Qty unit=pint>1</Qty> <Item>milk</Item> </Ingredient> <Qty unit=each>10</Qty> <Item>apples</Item> </Ingredients> <Instructions> <Step>Peel the apples</Step> <Step>Pour the milk into a 10 -inch saucepan</Step> <!-- And so on. . . --> </Instructions> </Recipe>

Document Is Now Block-Structured <? xml version="1. 0"? > <Recipe> <Name>Apple Pie</Name> <Ingredients> <Ingredient>

Document Is Now Block-Structured <? xml version="1. 0"? > <Recipe> <Name>Apple Pie</Name> <Ingredients> <Ingredient> <Qty unit=pint>1</Qty> <Item>milk</Item> </Ingredient> <Qty unit=each>10</Qty> <Item>apples</Item> </Ingredients> <Instructions> <Step>Peel the apples</Step> <Step>Pour the milk into a 10 -inch saucepan</Step> <!-- And so on. . . --> </Instructions> </Recipe>

DTD (Document Type Definition) XML is extensible because it allows user-defined tags DEFINES TAG

DTD (Document Type Definition) XML is extensible because it allows user-defined tags DEFINES TAG Recipe HAVING A Name AND 3 OPTIONALTAGS XML COMMENT <!-- Sample DTD --> <!ELEMENT Recipe (Name, Description? , Ingredients? , TAGS Name, Description Instructions? )> CONTAIN ONLY <!ELEMENT Name (#PCDATA)> CHARACTER DATA <!ELEMENT Description (#PCDATA)> TAG Ingredients CONTAINS ZERO OR <!ELEMENT Ingredients (Ingredient)*> MORE Ingredient TAGS <!ELEMENT Ingredient (Qty, Item)> Ingredient TAG HAS A <!ELEMENT Qty (#PCDATA)> Qty TAG FOLLOWED <!ATTLIST Qty unit CDATA #REQUIRED> BY AN Item TAG <!ELEMENT Item (#PCDATA)> TAG Qty HAS TWO <!ATTLIST Item optional CDATA "0" POSSIBLE ATTRIBUTES: optional (DEFAULT VALUE 0) is. Vegetarian CDATA "true"> is. Vegetarian (DEFAULT true) <!ELEMENT Instructions (Step)+> SOURCE: JAVAWORLD TAG Instructions HAS ONE OR MORE Step TAGS

Document Object Model (DOM) in XML • An XML structured document can be treated

Document Object Model (DOM) in XML • An XML structured document can be treated and manipulated as an object • DOM parser transforms the document into a parse tree • Program can walk the tree, performing arbitrary transformations • DOM API then converts the new tree to another XML file • New file can be printed, sent over the net or used as input to another program • Applications can now exchange data without knowing formats — DTD contains everything necessary SOURCE: JAVAWORLD

XSL Extensible Style Language REWRITING RULES TELLING HOW TO MAP THE CONTENTS OF XML

XSL Extensible Style Language REWRITING RULES TELLING HOW TO MAP THE CONTENTS OF XML TAGS TO HTML LOOK FOR ALL “TITLE” TAGS <xsl> <rule> <target-element type="title"/> <H 1 color="red" font-family="Arial"> <children/> PUT THE CONTENTS OF “TITLE” TAGS INTO RED HEADER FONT ARIAL </H 1> </rule> DO THE SAME FOR THE CHILDREN OF </xsl> “TITLE” TAGS SOURCE: WDVL. COM 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2002 COPYRIGHT © 2002 MICHAEL I. SHAMOS

XML Financial Implementations • OFX - Open Financial Exchange – Fields • FIXML -

XML Financial Implementations • OFX - Open Financial Exchange – Fields • FIXML - XML grammar for FIX (Financial Information Exchange). MSDW is a principal. More information • FINXML - Capital markets. Info. • SWIFT • X 12 - data exchange standard for business transactions SOURCE: PROF. JEROME YEN 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2002 COPYRIGHT © 2002 MICHAEL I. SHAMOS

XML Implementations • HL 7 - health information (Health Level 7) • EDIFACT/Simpl. EDI

XML Implementations • HL 7 - health information (Health Level 7) • EDIFACT/Simpl. EDI - syntax - repository • IFX - Interactive Financial Exchange - personal banking. • – catalogues, supply chain automation • IOTP – Internet Open Trading Protocol buying, payments • XBRL – Extensible Business Reporting Language • XML-enabled product vendor list SOURCE: PROF. JEROME YEN 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2002 COPYRIGHT © 2002 MICHAEL I. SHAMOS

Ubiquitous XML Architecture SOURCE: PROF. JEROME YEN 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2002 COPYRIGHT

Ubiquitous XML Architecture SOURCE: PROF. JEROME YEN 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2002 COPYRIGHT © 2002 MICHAEL I. SHAMOS

The Discovery Problem Broader B 2 B A mid-sized manufacturer needs to create 400

The Discovery Problem Broader B 2 B A mid-sized manufacturer needs to create 400 online relationships with customers, each with their own set of standard and protocols Smarter Search A flower shop in Australia wants to be “plugged in” to every marketplace in the world, but doesn’t know how Easier Aggregation A B 2 B marketplace cannot get catalog data for relevant suppliers in its industry, along with connections to shippers, insurers, etc. Describe Services Discover Services Integrate Them Together SOURCE: UDDI. ORG 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2002 COPYRIGHT © 2002 MICHAEL I. SHAMOS

UDDI (Universal Description, Discovery and Integration) • Microsoft, IBM, Ariba formed uddi. org •

UDDI (Universal Description, Discovery and Integration) • Microsoft, IBM, Ariba formed uddi. org • Announced August 31, 2000; endorsed by over 30 companies • Global directory of companies; searchable by computer • Companies publish machine-readable information about themselves AND how to conduct ebusiness with them • Platform-neutral open standard based on XML

UDDI Registry Entries u Entities register information about themselves u Standards Bodies, Programmers, Publishers

UDDI Registry Entries u Entities register information about themselves u Standards Bodies, Programmers, Publishers register information about their Service Types (specs) SOURCE: MICROSOFT 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2002 COPYRIGHT © 2002 MICHAEL I. SHAMOS

UDDI Registry Contents • • • Business name, general business description (in any number

UDDI Registry Contents • • • Business name, general business description (in any number of languages) Contact info: names, phone numbers, fax numbers, web sites, etc. Known identifiers: D-U-N-S, Thomas, domain name, stock ticker symbol, other • • • Business categories: name-value pairs 3 standard taxonomies in V 1: Industry: NAICS (Industry codes - US Govt. ) Product/Services: UN/SPSC (ECMA) Location: Geographical taxonomy (ISO 3166) …more in upcoming releases • • • How to do e. Commerce” with us (machine-readable) Business process (functional) Service specifications (technical) Binding information (implementation) Language/platform/implementation-agnostic SOURCE: MICROSOFT 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2002 COPYRIGHT © 2002 MICHAEL I. SHAMOS

UDDI Operation 1. Sydney. Net. com UDDI Registry Harbour Metals creates online website with

UDDI Operation 1. Sydney. Net. com UDDI Registry Harbour Metals creates online website with local ASP 4. Consumers and businesses discover Harbour Metals and do business with it 2. ASP registers Harbour Metals with UBR 3. Marketplaces and search engines query UBR, cache Harbour Metals data, and bind to its services SOURCE: UDDI. ORG 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2002 COPYRIGHT © 2002 MICHAEL I. SHAMOS

Impact of XML • • • Interchange mechanism between applications Rapidly becoming the database

Impact of XML • • • Interchange mechanism between applications Rapidly becoming the database language of the Web XML client/server transactions over http: Permits web data repositories XML properties: – Scalable – Maintainable – Easy to use (spreadsheet style skills) – Interoperable (exchange business components) 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2002 COPYRIGHT © 2002 MICHAEL I. SHAMOS

Standard Encodings • Business systems must exchange data in different formats: – Invoices, payment

Standard Encodings • Business systems must exchange data in different formats: – Invoices, payment orders, checks, bills of lading, delivery instructions, authentication information • Need standard notation to describe transmitted data in communication protocols • BUT: what format is the data in? – What does 437573746 F 6 D 6572 (hex) mean? – Where do fields begin and end? – How about complex data structures (arrays, etc, )?

Need for Standard Encodings • Interoperability – How can my program read your program’s

Need for Standard Encodings • Interoperability – How can my program read your program’s data? • Parties cannot always agree in advance on standards • Encodings need to be changed – YYMMDD became YYYYMMDD (the Y 2 K problem) • Minimize programmer and development time

Abstract Syntax Notation (ASN) • ASN. 1 is a method of encoding data so

Abstract Syntax Notation (ASN) • ASN. 1 is a method of encoding data so that the format can be decoded from the data itself • ASN. 1 is not a programming language • It describes only data structures. No code, no logic.

Abstract Syntax Notation • ASN. 1 has primitive types: BOOLEAN, INTEGER, REAL, ENUMERATED, BIT

Abstract Syntax Notation • ASN. 1 has primitive types: BOOLEAN, INTEGER, REAL, ENUMERATED, BIT STRING, IA 5 STRING, . . . • ASN. 1 has – SET (unordered) SEQUENCE (fixed order) of primitive types – CHOICE for selecting alternative types (integer or real) • Can define new types: Month : : = INTEGER (1. . 12) Day : : = INTEGER (1. . 31) Daily-stock-volume : : = SEQUENCE SIZE (31) OF INTEGER

Basic Encoding Rules (BER) • Define how fields described in ASN. 1 should be

Basic Encoding Rules (BER) • Define how fields described in ASN. 1 should be encoded • Units of BER are data elements • A data element is a triple: { identifier-type, length, value } • Some type codes: BOOLEAN IA 5 STRING INTEGER SEQUENCE SET 01 16 02 10 31 (8 -BIT ASCII) • The string “Customer” would be encoded as 16 08 43 75 73 74 6 F 6 D 65 72 IA 5 STRING LENGTH 8 20 -751 ECOMMERCE TECHNOLOGY HEX “C” HEX “r” HEX “u” SUMMER 2002 COPYRIGHT © 2002 MICHAEL I. SHAMOS

Basic Encoding Rules • Content field may be primitive (value) or structured (content has

Basic Encoding Rules • Content field may be primitive (value) or structured (content has subcomponents) 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2002 COPYRIGHT © 2002 MICHAEL I. SHAMOS

Basic Encoding Rules BBCard : : = SEQUENCE { name IA 5 String (SIZE

Basic Encoding Rules BBCard : : = SEQUENCE { name IA 5 String (SIZE (1. . 60)), team IA 5 String (SIZE (1. . 60)), age INTEGER (1. . 100), position IA 5 String (SIZE (1. . 60)), handedness ENUMERATED {left-handed(0), right-handed(1), ambidextrous(2)}, batting-average REAL } “Casey”, “Mudville Nine”, 32, “left field”, ambidextrous, 0. 250 (47 bytes of text) C a s e y M 302 D 1605 43617365 79160 D 4 D 4 E 696 E 65 02012016 0 A 6 C 6566 01020903 80 FE 01 (47 20 -751 ECOMMERCE TECHNOLOGY u d v i 75647669 74206669 bytes in SUMMER 2002 l l e 6 C 6 C 6520 656 C 640 A BER) COPYRIGHT © 2002 MICHAEL I. SHAMOS

Using ASN. 1/BER ASN. 1 DEFINITIONS ASN. 1 COMPILER SOURCE LANGUAGE (JAVA, C) DATA

Using ASN. 1/BER ASN. 1 DEFINITIONS ASN. 1 COMPILER SOURCE LANGUAGE (JAVA, C) DATA STRUCTURES ENCODER/ DECODER APPLICATION CODE APPLICATION PROGRAM (JAVA, C) COMPILER APPLICATION PROGRAM NOW READS AND WRITES DATA ACCORDING TO BER 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2002 APPLICATION PROGRAM COPYRIGHT © 2002 MICHAEL I. SHAMOS

ASN. 1 Encoding Rules • BER (Basic) from 1980 s – Internet messaging, telephone

ASN. 1 Encoding Rules • BER (Basic) from 1980 s – Internet messaging, telephone billing – BER and Java • DER (Distinguished) – Security applications requiring a unique method of encoding • CER (Canonical) – For long messages. Encoding can begin before the whole message has been read • PER (Packed) – Efficient encodings to reduce bandwidth requirements 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2002 COPYRIGHT © 2002 MICHAEL I. SHAMOS

Digital Certificates • Digital certificates are encoded in DER • ASN. 1 Primer from

Digital Certificates • Digital certificates are encoded in DER • ASN. 1 Primer from RSA Certificate : : = SEQUENCE { tbs. Certificate TBSCertificate, signature. Algorithm. Identifier, signature. Value BIT STRING } • Full ASN. 1 definition 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2002 COPYRIGHT © 2002 MICHAEL I. SHAMOS

ASN. 1 Applications • Telephone billing information – Transferred Account Procedure (TAP 3) –

ASN. 1 Applications • Telephone billing information – Transferred Account Procedure (TAP 3) – UMTS (3 G phones) • • • X 9 financial services (checks, electronic funds transfer) Air-to-ground aircraft information Electric and gas utilities Automobile diagnostic monitoring systems Radio Frequency Identification (RFID) Biometric IDs (Proposed ANSI Standard X 9. 84) – Common Biometric Exchange File Format CBEFF • Smart cards (ISO 7816 -4) • MORE 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2002 COPYRIGHT © 2002 MICHAEL I. SHAMOS

XML and ASN. 1 • Both XML and ASN. 1 represent hierarchical (treestructured) data

XML and ASN. 1 • Both XML and ASN. 1 represent hierarchical (treestructured) data • Therefore, one can be translated into the other! • IBM ASN. 1/XML translator • We also have XER, the XML encoding rules 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2002 COPYRIGHT © 2002 MICHAEL I. SHAMOS

Q&A 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2002 COPYRIGHT © 2002 MICHAEL I. SHAMOS

Q&A 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2002 COPYRIGHT © 2002 MICHAEL I. SHAMOS