Microsoft BizTalk Server 2004: Creating Schemas - Exercise 2 Creating an XML Schema using the BizTalk Editor (Page 3 of 7 ) Scenario In this exercise, you will create a schema to define the structure of the shipping address record. You will also open an existing schema and use the import function to insert schema nodes within the existing schema. Tasks Detailed steps - Create the shipping address schema.
Selecting the Schema template causes BizTalk Editor to start.
- In Solution Explorer, right-click the NWMessaging project, point to
Add, and then select Add New Item.
- In the Add New Item dialog box, in the Templates pane, select Schema.
- In the Name box, type ShippingAddress.xsd to name the schema.
- Click Open to open the blank schema in BizTalk Editor.
- View the Properties pane.
The schema tree (left pane) and XSD view (right pane) appear in BizTalk Editor. Also, the new schema (ShippingAddress.xsd) is added to Solution Explorer.
- Create the schema record.
The Root node should always be renamed using a meaningful name that represents the type of document described by the schema. When possible, use a root node name unique throughout the enterprise.
You can right-click an empty area of the Toolbar and select BizTalk Editor to display a floating toolbar of BizTalk Editor options.
- In the Schema Tree, right-click the Root node, and then select Rename.
- Type ShippingAddress as the new name, and then press Enter.
- Right-click the ShippingAddress (root) node, point to Insert Schema Node, and then select Child Field Element to add the following fields (repeat this step for each field element):
- City
- Country
- Street
- Email
- Fax
- State
- Zip
- Phone
The completed schema should look like this:

- Click File | Save All.
- Open an existing schema and import a new child record.
This allows you open an existing schema and use the import function to insert schema nodes within an existing schema.
You can show properties in alphabetic order by clicking the Alphabetic button at the top of the Properties window.
- In Solution Explorer, right-click the NWMessaging project, point to Add, and then select Add Existing Item.
- Navigate to C:\Labs\Work, and then double-click the CustomerOrder.xsd schema to add it to the project.
The schema is added to Solution Explorer.
- In Solution Explorer, double-click CustomerOrder.xsd to open it in BizTalk Editor.
If the Properties window is not visible, then in BizTalk Editor right-click the <Schema> node of CustomerOrder.xsd, and then select Properties.
- In the Properties window, click the Imports property, and then click the ellipsis (…) button.
- In the Imports dialog box, verify that XSD Import is selected from the drop down box, and then click Add.
- In the BizTalk Type Picker, expand Schemas, select NWMessaging.ShippingAddress, and then click OK.
- In the Imports window, click OK.
- Right-click the CustomerOrder root node, select Insert Schema Node, and then click Child Record.
- Right-click the child record Record and click Properties.
- In the Properties window, select the Data Structure Type property and, from the drop-down box, select ns1:ShippingAddress (Reference).
The ShippingAddress record is added to the schema.
- Click File | Save All.
 | Take Microsoft software for a test drive. With MSDN Virtual Labs, you get full access to all available Microsoft products through 90-minute modules, each with its own downloadable manual. Try this lab out now. |
Next: Exercise 3 Promoting Schema Properties >>
More BrainDump Articles More By MSDN Virtual Labs |