Share via


Generating and Using the XSD Files Required by Different Commerce Server Systems

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

If you change the default schemas for the Orders, Catalog, Inventory, or Profiles Systems within Commerce Server, and you are going to use one or more of the BizTalk adapters provided with Commerce Server, you will need to generate an up-to-date version of the XSD file that describes the now changed schemas and deploy the schemas to the BizTalk application in which your adapters reside. By doing this, the BizTalk processing that you develop for the adapter messages will be able to properly validate and interpret the data in the body of the messages. This topic provides an overview of the tools provided with Commerce Server to generate up-to-date versions of the XSD files that describe your Commerce Server schemas. It also describes the process of deploying the updated schemas into BizTalk Server.

Note

The Commerce Server adapters do not support dynamic schema discovery within your BizTalk projects in Visual Studio 2005 or Visual Studio 2008. Instead, you must run these tools on your Commerce Server computer and then deploy the generated schemas by following the steps described in How to Setup Visual Studio for BizTalk Adapter Development.

Generating Up-To-Date Commerce Server System Schema Files

If the following two conditions exist for your Commerce Server adapter implementation, you must generate an up-to-date version of one or more Commerce Server system schemas:

  1. For the Commerce Server adapter in question, you have changed the default schema of the corresponding Commerce Server system. For example, if you are using the Commerce Server catalog adapter, and you have changed the schema of the Commerce Server Catalog System.

  2. Within BizTalk Server, your processing of the messages coming from or going to the adapter in question includes validation or other examination or manipulation of the contents of the corresponding message bodies. In other words, you are using BizTalk Server for more than simple message routing.

When these conditions are true, you must use one of the following methods to generate an up-to-date version of the XSD file that describes the XML representation of the updated schema for each relevant Commerce Server system:

  • Orders System. Use the OrderMapping.exe tool to generate an up-to-date XSD schema for the Commerce Server Orders System. You may have to run this tool both with and without the /c parameter to generate all the required schemas.

    Note

    The Web.config file for the Orders Web Service may restrict the number of items in a collection. This restriction is not included in the XSD schema generated by this tool, although you can edit the generated schema and include a similar restriction.

  • Catalog System. Use the Catalog receive adapter itself to generate an up-to-date XSD schema for the Commerce Server Catalog System. Set the endpoint transport properties for the Catalog receive adapter as specified in the following table. When you then enable the endpoint, it will export a CommerceServerCatalogExport message to the send port file location you have configured to take the receive port message. The body of this message may be used as a new XSD schema for the Catalog System.

    Transport property

    Setting

    Format Type

    Xsd

    Namespace

    Specify your namespace, as appropriate.

    Export Mode

    Full Export

    After the new schema has been exported, you may disable the Catalog receive adapter endpoint until a new Catalog schema is required.

    Note

    You may also use the ExportCatalog.exe tool to generate an up-to-date XSD schema for the Commerce Server Catalog System.

  • Inventory System. Use the Inventory receive adapter itself to generate an up-to-date XSD schema for the Commerce Server Inventory System. Set the endpoint transport properties of the Inventory receive adapter as specified in the following table. When you then enable the endpoint, it will export a CommerceServerInventoryExport message to the send port file location you have configured to take the receive port message. The body of this message may be used as a new XSD schema for the Inventory System.

    Transport property

    Setting

    Format Type

    Xsd

    Namespace

    Specify your namespace, as appropriate.

    Export Mode

    Full Export

    After the new schema has been exported, you may disable the Inventory receive adapter endpoint until a new Inventory schema is required.

  • Profiles System. Use the ExportProfileXsd.exe tool to generate an up-to-date XSD schema for the Commerce Server Profiles System.

For information about how to run these schema generation tools, and detailed information about their command line parameters, see BizTalk Adapter Tools.

Deploying Up-To-Date Commerce Server System Schemas to BizTalk Server

The BizTalk adapters SDK contains a Visual Studio 2005 or Visual Studio 2008 solution and BizTalk Server project that contains the Commerce Server system and adapter XSD files that describe the message bodies of the various adapter messages. For the system schemas, which describe message bodies that conform to an XML representation of data produced by a Commerce Server system, the SDK contains the default versions of those schemas. The relevancy of the default schema versions will last only until the underlying schema of the corresponding Commerce Server system is customized to suit the needs of your implementation.

To use the up-to-date versions of the XSD files that describe your customized Commerce Server system schemas within BizTalk Server, you must deploy the updated schemas to your BizTalk Server application. You can do this by following the steps for building and deploying your XSD schemas that are described in the topic How to Setup Visual Studio for BizTalk Adapter Development, after having used the editor of your choice to replace the contents of the corresponding XSD file with the updated XSD schema you created using one of the supplied tools that are described above.

See Also

Other Resources

BizTalk Adapter Tools

BizTalk Adapters SDK

Adapter Message Schemas

Working with the BizTalk Adapters