BizTalk Adapter Tools
There are three Commerce Server 2009 command-line tools that are of particular interest to developers who are using the BizTalk adapters provided with Commerce Server 2009, also known informally as the Commerce Server 2009 adapters, to integrate with other systems. These tools provide a way for you to generate up-to-date schemas from the Orders, Catalog, and Profiles Systems so that they can be deployed to, and used within, BizTalk Server.
Note
To generate an up-to-date schema for the Inventory System, use the Inventory receive adapter itself. For more information, see Generating and Using the XSD Files Required by Different Commerce Server Systems).
The three tools are:
OrderMapping.exe. Use this tool to generate an up-to-date XSD schema for the Orders System.
ExportCatalog.exe. Use this tool to generate an up-to-date XSD schema for the Catalog System.
Note
You can also use the Catalog receive adapter itself to generate an up-to-date version of the catalog schema. For more information about how to use these receive adapters in this way, see Generating and Using the XSD Files Required by Different Commerce Server Systems.
ExportProfileXsd.exe. Use this tool to generate an up-to-date XSD schema for the Profiles System.
Each of these tools, including their respective command line parameters, is described separately below.
Note
The Commerce Server 2009 adapters do not support dynamic schema discovery within your BizTalk projects in Visual Studio. Instead, you must run these tools on the computer running Commerce Server 2009, and then deploy the generated schemas by following the steps described in How to Setup Visual Studio for BizTalk Adapter Development.
OrderMapping.exe Tool
You use the command-line tool OrderMapping.exe, found in the Tools folder within the Commerce Server 2009 installation folder, to generate an up-to-date XSD representation of the Orders schema. The command for using this tool to generate an up-to-date XSD file is as follows:
OrderMapping /w[ebconfig] <web_config_file>
[/n[osql]]
[/nologo]
[/i[gnore]]
[/x[sd] <output_XSD_file>]
[/t[ype] <OrderGroup_derived_type>]
[/c[ollection]]
[/tn | /targetNamespace <target_namespace>]
[/p]
[/f <mapping_XML_file>]
Note
You can also use this tool to generate updated SQL table definitions and stored procedures, for which additional command-line parameters are required. For information about these additional parameters, see How to Generate SQL Tables and Stored Procedures for Orders Mapped Storage.
Parameter Descriptions
Note
Parameter specifiers are not case-sensitive and can begin with either the "/" or the "-" character.
/wweb_config_file or /webconfigweb_config_file
Required. web_config_file specifies the Web.config file to use./n or /nosql
Required if you want only XSD output. Suppresses all SQL-related processing./nologo
Optional. Suppresses display of start-up text and copyright information./i or /ignore
Optional. Forces overwrite of any existing output file; otherwise, any existing output file will not be overwritten./x output_XSD_file or /xsdoutput_XSD_file
Optional. output_XSD_file specifies the output file to use for XML schema definition. Defaults to type.xsd, where type is the value specified by OrderGroup_derived_type for the /t parameter./tOrderGroup_derived_type or /typeOrderGroup_derived_type
Required. OrderGroup_derived_type specifies the root type for which the XSD file should be generated. Must be an OrderGroup-derived type, such as PurchaseOrder./c or /collection
Optional. Specifies whether the XSD output will also include collections, such as OrderGroups. You may need to run this tool both with and without this parameter to generate all the schemas you required. For more information, see the examples below./tntarget_namespace or /targetNamespacetarget_namespace
Optional. target_namespace specifies the value of the TargetNamespace element to be included in the XSD output./p
Optional. Specifies that only a partial XSD is generated. When this parameter is specified, the /t parameter must specify PurchaseOrder or one of its derived types, if any./fmapping_XML_file
Optional. mapping_XML_file specifies the orders mapping XML file to use. This file specifies the mappings between the Orders System classes and the SQL tables in which order data is stored. By default, the OrderMapping.exe tool will look for the file OrderObjectMappings.xml, the default version of which can be found in the Orders Web Service folder.
Examples
The following example generates an XSD file named MyOrderGroupSchema.xsd that could be used to replace the schema in the default system schema file OrderGroupCollection.xsd:
OrderMapping /webconfig Web.config /collection /type PurchaseOrder /nosql /xsd MyOrderGroupSchema.xsd
The following example generates an XSD file named MyPOSchema.xsd that could be used to replace the schema in the default system schema file PurchaseOrder.xsd:
OrderMapping /webconfig Web.config /type PurchaseOrder /nosql /xsd MyPOSchema.xsd
The following example generates an XSD file named MyBasketSchema.xsd that could be used to replace the schema in the default system schema file Basket.xsd:
OrderMapping /webconfig Web.config /type Basket /nosql /xsd MyBasketSchema.xsd
ExportCatalog.exe Tool
You use the command-line tool ExportCatalog.exe, found in the Tools folder within the Commerce Server 2009 installation folder, to generate an up-to-date XSD representation of the Catalog schema. The command for using this tool to generate an up-to-date XSD file is:
ExportCatalog /Site:<sitename>
/Xsd
[/Namespace:<target_namespace>]
<filename>
Parameter Descriptions
Note
Parameter specifiers and choices are not case-sensitive.
/Site:sitename or /S:sitename
Required. sitename specifies the Commerce Server 2009 Web site name for which the catalog schema is generated./Xsd
Required. Specifies that an XSD representation of the catalog schema should be generated./Namespace:target_namespace
Optional. target_namespace specifies the value of the TargetNamespace element to be included in the XSD output.filename
Required. filename specifies the name of the output XSD file. Any existing file of the same name will be overwritten.
Example
The following example generates an XSD file named MyCatalog.xsd that could be used to replace the schema in the default system schema file DefaultCatalog.xsd:
exportcatalog /site:CSharpSite /xsd MyCatalog.xsd
The following example generates the same XSD file as the previous example, except that it includes a namespace specifier set to the value "MyNamespace":
exportcatalog /site:CSharpSite /xsd /namespace:MyNamespace MyCatalog.xsd
ExportProfileXsd.exe Tool
You use the command-line tool ExportProfileXsd.exe, found in the Tools folder within the Commerce Server 2009 installation folder, to generate an up-to-date XSD representation of the Profiles schema. The command for using this tool to generate an up-to-date XSD file is:
ExportProfileXsd {-s <site_name> | -c <connection_string>}
[-o <output_file_name>]
[-tn <target_namespace>]
<profile1> [<profile2> ... [<profileN>]]
Parameter Descriptions
-ssite_name or -cconnection_string
Required. Specifies either the name of the Commerce Server 2009 Web site for which the profile XSD should be generated (for example: "CSharpSite"), or a connection string to the Profiles data store (the s_BizDataStoreConnectionString resource).-ooutput_file_name
Optional. output_file_name specifies the name of the output XSD file. Any existing file of the same name will be overwritten. If a name is not specified, the output will be written to the console.-tntarget_namespace
Optional. target_namespace specifies the value of the TargetNamespace element to be included in the XSD output.profile1 [profile2 ... [profileN]]
Required. The final parameter or parameters are one or more profile types (space-separated) to be included in the XSD output. The generated XSD will define the XML representation of all listed profile types.
Example
The following example generates an XSD file named MyProfileSchema.xsd that could be used to replace the schema in the default system schema file ProfileDocument.xsd:
ExportProfileXsd –o MyProfileSchema.xsd –s CSharpSite UserObject Address Organization
See Also
Other Resources
Generating and Using the XSD Files Required by Different Commerce Server Systems