1 / 20

Module 2: Creating Schemas

Module 2: Creating Schemas. Overview. Lesson 1: Introduction to BizTalk Schemas Lesson 2: Creating XML and Flat File Schemas. Lesson 1: Introduction to BizTalk Schemas . Reviewing XML Terminology What Are XML Namespaces? How Does BizTalk Use XML Namespaces? What Is a BizTalk XML Schema?

zhen
Download Presentation

Module 2: Creating Schemas

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. Module 2:Creating Schemas

  2. Overview • Lesson 1: Introduction to BizTalk Schemas • Lesson 2: Creating XML and Flat File Schemas

  3. Lesson 1: Introduction to BizTalk Schemas • Reviewing XML Terminology • What Are XML Namespaces? • How Does BizTalk Use XML Namespaces? • What Is a BizTalk XML Schema? • Supported BizTalk Schema Types • Flat File Structures

  4. Reviewing XML Terminology XML Standards Elements Attributes Namespaces in XML XML Schema (XSD) XML Path Language (XPath) Extensible Stylesheet Language Transformations (XSLT) Document Object Model (DOM) SOAP Web Services Description Language (WSDL)

  5. What Are XML Namespaces? Namespaces Provide unique names for elements and attributes Prevent naming conflicts with other schemas Use the xmlns attribute to declare the namespace the element belongs to A prefix is added to the declaration to remove ambiguity <salesReport> <customerid="Fabrikam"> <sales> <id>widget1004</id> <unitsSold>100</unitsSold> <price currency="USD">35</price> </sales> </customer> </salesReport> <salesReportxmlns="http://adventure-works.com/salesReport"> <customerid="Fabrikam"> <sales> <id>widget1004</id> <unitsSold>100</unitsSold> <price currency="USD">35</price> </sales> </customer> </salesReport> <salesReportxmlns="http://adventure-works.com/salesReport"xmlns:prod="http://adventure-works.com/products"> <customerid="Fabrikam"> <sales> <id>widget1004</id> <unitsSold>100</unitsSold> <price currency="USD">35</price> </sales> </customer> </salesReport> <salesReportxmlns="http://adventure-works.com/salesReport"xmlns:prod="http://adventure-works.com/products"> <customerid="Fabrikam"> <sales> <prod:id>widget1004</prod:id> <prod:unitsSold>100</prod:unitsSold> <prod:price prod:currency="USD">35</prod:price> </sales> </customer> </salesReport>

  6. How Does BizTalk Use XML Namespaces? Message ATargetNamespace=“NewOrders” BizTalk Server Schema ATargetNamespace=“NewOrders” Message BTargetNamespace=“OrderUpdate” Schema BTargetNamespace=“OrdersUpdate” Message CTargetNamespace=“Inventory” No Match

  7. What Is a BizTalk XML Schema? <xs:schematargetNamespace="http://contoso.com/invoice"xmlns:xs=“http://www.w3.org/2001/XMLSchema”> </xs:schema> • <xs:schematargetNamespace="http://contoso.com/invoice"xmlns:xs=“http://www.w3.org/2001/XMLSchema”attributeFormDefault="unqualified“elementFormDefault="qualified"> • </xs:schema> • <xs:schematargetNamespace="http://contoso.com/invoice"xmlns:xs=“http://www.w3.org/2001/XMLSchema”attributeFormDefault="unqualified“elementFormDefault="qualified"> • <xs:elementname="Item"> • </xs:element> • </xs:schema> • <xs:schematargetNamespace="http://contoso.com/invoice"xmlns:xs=“http://www.w3.org/2001/XMLSchema”attributeFormDefault="unqualified“elementFormDefault="qualified"> • <xs:elementname="Item"> • <xs:complexType> • <xs:sequence> • </xs:sequence> • </xs:complexType> • </xs:element> • </xs:schema> • <xs:schematargetNamespace="http://contoso.com/invoice"xmlns:xs=“http://www.w3.org/2001/XMLSchema”attributeFormDefault="unqualified“elementFormDefault="qualified"> • <xs:elementname="Item"> • <xs:complexType> • <xs:sequence> • <xs:elementname="Description"type="xs:string" /> • <xs:elementname="Quantity"type="xs:integer" /> • <xs:elementname="UnitPrice"type="xs:decimal" /> • <xs:elementname="ItemID"type="xs:string"/> </xs:sequence> • </xs:complexType> • </xs:element> • </xs:schema> BizTalk uses the XML schema definition language (XSD) <!-- XML Instance --> <Item xmlns="http://contoso.com/invoice"> <Description>Widget</Description> <Quantity>10</Quantity> <UnitPrice>1.04</UnitPrice> <ItemID>A1234</ItemID> </Item>

  8. Supported BizTalk Schema Types Node Structure Start Length Description Delimited 0 50 UnitPrice Delimited 50 10 Quantity Delimited 60 10 Item TotalPrice Delimited 70 10 Description Quantity Delimited 80 10 ItemID UnitPrice Delimited 99 1 Status TotalPrice ItemID Status ISA:00:   :00:   :01:1515151515     :01:515151  :041201:1217:U:00403:000032123:0:P:*~GS:CT:9988776655:1122334455:20041201:1217:128:X:004030~ST:831:00128001~BGN:00:88200001:20041201~N9:BT:88200001~TRN:1:88200001~AMT:2:10

  9. Flat File Structures Delimited flat files Fields separated by a specified delimiter Have a common end-of-record terminator John, Smith, 123 Main St., “Learning BizTalk Server 2010” Positional flat files Fields are fixed length Have a common end-of-record terminator John Smith 123 Main St. Learning BizTalk Server 2010

  10. Lesson 2: Creating XML and Flat File Schemas • Methods for Creating BizTalk XML Schemas • Generating Schemas • Creating a Schema by Using the BizTalk Editor • Using Multiple Schemas • Testing a Schema • Demonstration: Creating and Testing a Schema • Using the Flat File Schema Wizard • Demonstration: Creating and Testing a Flat File Schema • Building a BizTalk Project

  11. Methods for Creating BizTalk XML Schemas Schema creation methods Create from scratch using BizTalk Editor Import or include existing types Generate from an instance message Migrate an older XDR schema to an XSD schema

  12. Generating Schemas Schema creation methods XDR schema DTD A well-formed XML document

  13. Creating a Schema by Using the BizTalk Editor Schema Tree View XSD View

  14. Using Multiple Schemas Purchase Order Date Ship To Contact Item Company Part Number City Description State Unit Cost Zip Weight

  15. Testing a Schema Validate XSD Validate XML Create XML

  16. Demonstration: Creating and Testing a Schema In this demonstration, you will see how to: • Use the BizTalk Editor to createa schema • Validate and test a schema

  17. Using the Flat File Schema Wizard Flat File Schema Wizard Graphical tool for defining flat file schemas Can define schemas for delimited or positional flat files

  18. Demonstration: Creating and Testing a Flat File Schema In this demonstration, you will see how to: • Create a schema by using theFlat File Schema Wizard • Validate and test a flat file schema

  19. Building a BizTalk Project Build Project BizTalk Project .NETAssembly XSD Schema Compile .DLL Building a project Compiles the project items (schemas, maps, orchestrations, pipelines) Creates an assembly (DLL file) Stores the assembly in the project subfolder (…\bin\Development) Displays any errors or warnings in the task list

  20. Lab: Creating and Configuring BizTalk Schemas Exercise 1: Creating a New BizTalk Project Exercise 2: Creating an XML Schema Exercise 3: Creating a Flat File Schema Exercise 4: Generating a Schema from an XML Message Instance

More Related