Welcome once again to another BizTalk Server Best practices, Tips, and Tricks blog post! In my previous blog post, I discussed some essential tips and tricks for BizTalk Server administrators:
And for BizTalk Server Developers:
Today I’m going to speak about another critical Best practice, Tips and Tricks for BizTalk Server developers: Automatically Generate XSD Schemas.
There are several ways we can create an XSD Schema or XML Schema in BizTalk Server. Of course, you can always manually create the XSD schemas from scratch, but normally the Schema generation should be a simple, easy and fast operation. These are our options for creating XSD schemas:
This is the option for you to create, especially internal or our own schemas from our BizTalk Server applications.
To create a new schema, you need to:
XDR is a discontinued schema language for specifying and validating XML documents. BizTalk has a simple way option for you to migrate them to XSD Schemas.
To generate an XSD schema from an XDR schema, you need to:
A new schema is generated from the specified XDR schema file, using the same name as that file with the .xsd extension, and then opened in BizTalk Editor.
For those who don’t know what DTD is, a DTD is a Document Type Definition that defines the structure and the legal elements and attributes of an XML document… So basically, it is the equivalent of what BizTalk Server uses to define how an XML document can be structured: XSD Schema. Nevertheless, there are many differences between DTD (Document Type Definition) and XSD (XML Schema Definition). In short, DTD provides less control on XML structure whereas XSD (XML schema) provides more control.
Some of you may wonder, who cares? No one uses DTD anymore, so why bother? Yes, indeed, DTD is not used very regularly nowadays, and, probably, you will never use it… unless… for example, you are working with RosettaNet or in the future, you will need to work with RosettaNet. Why? Because most of the RosettaNet Standards – PIP messages – are defined in the format of DTD format!
To accomplish this, we need to:
A new schema, or sometimes at least two schemas, are generated from the specified file, using the same name as that file with the .xsd extension, and opened in BizTalk Editor.
Quick, simple, and practical.
If you already have a valid XML instance or message with you, why spend too much time trying to manually create an XSD schema that represents that message? Why not automatically generate one based on that XML instance?
To accomplish this, we need to perform the following steps:
A new schema, or sometimes at least two schemas, are generated from the specified file, using the same name as that file with the .xsd extension, and opened in BizTalk Editor
The BizTalk Adapter Framework provides a way to add adapter schemas and BizTalk types to BizTalk projects. The BizTalk WCF Service Consuming Wizard enables you to add WCF send adapters to a BizTalk project.
To add the schemas and types for WCF send adapters to your project
The BizTalk WCF Service Consuming Wizard creates in your BizTalk project the BizTalk schemas and types necessary to consume WCF services.
And the last option is to generate the XSD schemas directly from our LOB systems like Oracle, SQL Server or SAP.
To accomplish that we need to:
From the Select a binding drop-down list, select your LOB system like, for example, sqlBinding, and then click Configure.
In the Configure Adapter dialog box, click the Security tab, and from the Client credential type drop-down list.
Of course, you need to select the actions you want, like calling a stored procedure or performing a Select of a table, and click OK for the wizard to generate and add that XSD Schemas to your BizTalk Server Visual Studio project.
Stay tuned for the following BizTalk Server Best practices, Tips, and Tricks.