Microsoft KB Archive/301106

= How To Exchange Catalogs Between Commerce Server 2000 Sites Through Microsoft BizTalk Server =

Article ID: 301106

Article Last Modified on 8/5/2004

-

APPLIES TO


 * Microsoft BizTalk Server 2000 Standard Edition
 * Microsoft Commerce Server 2000 Standard Edition

-



This article was previously published under Q301106



SUMMARY
The &quot;More Information&quot; section of this article describes the steps to configure Commerce Server 2000 sites to send and receive catalogs through BizTalk Server 2000. Note that the information in this article is for users who have BizTalk Server and Commerce Server 2000 installed on the same computer.



How to Install Two Sample Commerce Server 2000 Sites
 Download and install Microsoft Commerce Server Solution Sites from:

http://download.microsoft.com/download/comserver/Trial/Evaluation/NT5/EN-US/CommerceServerSolution.exe

 Double-click the Retail.pup file in the Program Files\Microsoft Commerce Server\PuP Packages folder to unpack the Retail site that is available after you install the Commerce Server Solution Sites. When you double-click this file, the Commerce Server Site Packager Wizard starts. When you are prompted, set the Custom unpack option to the site name Retailer . In the Unpack Method dialog box, click Create a new site, and then click Next. Enter the site name Retailer, and then click Next. In the Select Resources dialog box, click Next. In the Global Resource Pointers dialog box, click Next.</li> In the Database Connection Strings dialog box, click Next.</li> In the Select Applications dialog box, make sure that Retail and RetailbizDesk are selected (checked), and then click Next.</li> In the Select IIS Web Sites and Virtual Directories dialog box, change the IIS virtual directory for the Retail application from Retail to Retailer, change the IIS virtual directory for the RetailBizDesk application from Retailbizdesk to Retailerbizdesk, and then click Next.</li> When the Data Warehouse dialog box is displayed, change the name of the Data Warehouse to Data Warehouse Retailer, and then click OK.</li> In the Profiling dialog box, keep the default settings, click Next, and then click OK.</li> When the Unpacking is complete! dialog box is displayed, click Finish.</li> Repeat the previous steps, but substitute the names Wholesaler and Wholesalerbizdesk for Retailer and Retailerbizdesk.</li> You should now be able to access your Retailerbizdesk and Wholesalerbizdesk applications through http://localhost/Retailerbizdesk or http://localhost/Wholesalerbizdesk.</li></ol>

Modifying the Site Options for the Wholesaler Site
<ol> Start the Commerce Server Manager.</li> Navigate to the Wholesaler App Default Config settings by expanding Commerce Sites, expanding Wholesaler, expanding Site Resources, and then expanding App Default Config.</li> Right-click App Default Config, and then click Properties to configure the site options as follows:

</li></ol>

Copying Catalogxmlschema.xml to the BizTalk Server Repository

 * 1) Start the BizTalk Editor.
 * 2) Click Tools, import and select XDR Schema, and then click OK.
 * 3) In the Program Files\Microsoft Commerce Server folder, open the CatalogXMLSchema.xml file.
 * 4) You will receive several warnings that refer to various properties being blank. You can disregard these warnings.
 * 5) In the top left pane of the BizTalk Editor, expand MSCommerceCatalogCollection, expand CatalogSchema, and then expand AttributeDefinition. Click Edit, click Insert Field, and then insert a field named MaxLength with a data type of Number.
 * 6) On the File menu, click Store to WebDAV. When the BizTalk Editor prompts you to save this specification, click Yes.
 * 7) Open the Microsoft folder and save the schema as Catalogxmlschema.xml.

Creating the Catalog Document Definition in the BizTalk Messaging Manager

 * 1) Start the BizTalk Messaging Manager.
 * 2) On the File menu, click New, and then click Document Definition.
 * 3) Enter Catalog as the document definition name, click the check box for document specification, and then open the Catalogxmlschema.xml file in the WebDAV repository that you imported previously. Click OK.

Configuring the Receivestandard.asp File to Receive the Catalog
Receivestandard.asp is a file that receives XML documents and calls the BizTalk interchange.submit method. You need to modify this file to call a specific channel. This is done in the Retailer site because it is the site that is receiving the catalog. In this example, the site is named &quot;Catalog Import Channel.&quot; Modify line 89 of the Receivestandard.asp file in the physical directory that contains the \Retailer virtual directory by changing: SubmissionHandle = interchange.submit( 1, PostedDocument ) to: SubmissionHandle = interchange.submit(1, PostedDocument,,,,,,&quot;Catalog Import Channel&quot;) This takes the PostedDocument, which is the exported catalog, and submits it to the Catalog Import Channel, which you will create by following the steps in the &quot;Creating the Catalog Import Channel&quot; section of this article.

Modifying the Home Organization

 * 1) In the BizTalk Messaging Manager, click Organizations, and then click Search Now.
 * 2) Double-click Home Organization, and then change the Organization name from Home to Wholesaler.
 * 3) Click the Identifiers tab, and then add the name Catalog as a new Custom identifier with a qualifier of Catalog and a value of Wholesaler.
 * 4) Click the Applications tab, add a new Application with the name CatalogApplication, and then click OK.

Creating the Retailer Organization

 * 1) In the BizTalk Messaging Manager, click File, click New, and then click Organization.
 * 2) Enter an Organization name of Retailer, and then click the Identifiers tab.
 * 3) Add the name Catalog as a new Custom identifier with a qualifier of Catalog and a value of Retailer.
 * 4) Click to check the Set as default check box, and then click OK.

Creating the Wholesaler Port to Retailer

 * 1) In the BizTalk Messaging Manager, click File, click New, click Messaging Port, and then click To an Organization.
 * 2) Enter the name CatalogPort, and then click Next.
 * 3) Select the Organization name Retailer, and then click OK.
 * 4) For the Primary transport Transport type:, select HTTP and for Address:, select http://localhost/retailer/receivestandard.asp. Click Next.
 * 5) In the Envelope Information dialog box, make sure that the Organization identifier is set to Catalog/Retailer, and then click Next.
 * 6) In the Security Information dialog box, click to check the Create a channel for this messaging port option, select From an application for the Channel type:, and then click Finish.

Creating the Channel to Retailer

 * 1) In the first dialog box of the New Channel Wizard, enter Channel to Retailer for Name of:, and then click Next.
 * 2) In the Source Application dialog box, select the Application radio button and make sure that Name of: CatalogApplication is selected.
 * 3) Set the Organization identifier to Organization/Wholesaler, and then click Next.
 * 4) For the Inbound document definition name:, select Catalog, and then click Next.
 * 5) For the Outbound document definition name:, select Catalog, and then click Finish.

Creating the Retailer Receive Port

 * 1) In the BizTalk Messaging Manager, click File, click New, click Messaging Port, and then click To an Organization.
 * 2) Enter the name Retailer Receive, and then click Next.
 * 3) For the Organization name, select Retailer, and then click OK.
 * 4) For the Primary transport Transport type:, select Application Integration Component and for Component name:, select BizTalk Scriptor. Click OK twice, and then click Next.
 * 5) In the Envelope Information dialog box, make sure that the Organization identifier is set to Catalog/Retailer, and then click Next.
 * 6) In the Security Information dialog box, click to check the Create a channel for this messaging port check box. For Channel type:,select From an organization, and then click Finish.

Creating the Catalog Import Channel
<ol> In the first dialog box of the New Channel Wizard, for Name:, enter Catalog Import Channel, and then click Next.</li> In the Source Organization dialog box, select Retailer for the Organization Name:, select Catalog/Retailer for the Organization identifier, and then click Next.</li> For the Inbound document definition name:, select Catalog, and the click Next.</li> For the Outbound document definition name:, select Catalog, and the click Next twice.</li> <li>In the Advanced Configuration dialog box, click Advanced, and then click Properties on the Primary Transport tab.</li> <li> Replace the existing default script with the following script, click OK twice, and then click Finish: function MSCSExecute(config, orderform, context, flags)

soutput = orderform.Value(&quot;working_data&quot;)

Dim fso, MyFile Set fso = CreateObject(&quot;Scripting.FileSystemObject&quot;) Mydrive = &quot;c:\commercecatalogs\&quot; MyDate = cstr(Date) MyTime = cstr(Time) Filename = MyDate & MyTime & &quot;.xml&quot; FileName = Replace(FileName, &quot;/&quot;, &quot;&quot;) FileName = Replace(FileName, &quot;:&quot;, &quot;&quot;) Filename = Mydrive & FileName Filename = Replace(Filename, &quot; &quot;, &quot;&quot;) Set MyFile = fso.CreateTextFile(Filename, True, True) MyFile.WriteLine(soutput) MyFile.Close set appcfg = createobject(&quot;commerce.appconfig&quot;) set catalogmanager = createobject(&quot;commerce.catalogmanager&quot;) appcfg.initialize(&quot;retailer&quot;) set optdict = appcfg.getoptionsdictionary(&quot;&quot;) connstr = optdict.s_CatalogConnectionString catalogmanager.initialize connstr, true catalogmanager.importxml Filename, TRUE, FALSE MSCSExecute = 1  'set function return value to 1 end function

sub MSCSOpen(config) 'optional open routine end sub

sub MSCSClose 'optional close routine end sub </li> <li>On the computer running BizTalk Server, create a c:\commmercecatalogs folder.</li></ol>

In the previous BizTalk scriptor, the orderform is used to pass in the contents of the XML document. When you grab the working_data node, you have the XML document. In this case, you grab the XML document and use the scripting.filesystemobject to write out the XML document to a file.

Testing to Ensure that Catalogs Sent from the Wholesaler Site Are Automatically Imported into the Retailer Site
<ol> <li>If you do not already have catalogs imported into the Wholesaler site, import a catalog into the Wholesaler site:

<ol style="list-style-type: lower-alpha;"> <li>Open the Wholesaler BizDesk, use the Import Catalog key combination ALT+I, and then press the ENTER key.</li> <li>Make sure that the Import XML option is selected, and then press the ENTER key.</li> <li>In the Import XML Catalog dialog box, type \Program Files\Microsoft Commerce Server\SDK\Samples\Sitelets\Auction\booksfull.xml for the file name, and then click OK.</li> <li>After the catalog import is successful, you should have the Books catalog available in your Wholesaler site.</li></ol> </li> <li>Select the Books catalog that you imported.</li> <li>Type the Send Catalog key combination ALT+ S. In the Select Vendor dialog box, select Retailer, and then click OK.</li></ol>

When you select the Books catalog in the Wholesaler site and send it to the Retailer site, the following actions occur:
 * 1) The Process_Send subroutine in the Wwwroot\Wholesalerbizdesk\Catalogs\Editor\List_Catalogs.asp folder runs and performs the following tasks:


 * 1) * Calls the ExportXML method of the Commerce Server 2000 CatalogManager object and exports the Books catalog to the root of the Wholesalerbizdesk virtual directory.
 * 2) * Loads an instance of the Microsoft XML DOM Object and loads the exported file into the XML DOM.
 * 3) * Calls the BizTalk Interchange.Submit method, which submits the XML contained in the DOM to the BizTalk Channel to Retailer.
 * 4) * Deletes the Books catalog from the root of the Wholesalerbizdesk virtual directory.
 * 5) The BizTalk Channel to Retailer validates the catalog that has been submitted against the Catalog schema, and then passes the catalog to the CatalogPort.
 * 6) The BizTalk CatalogPort passes the catalog to the specified transport address http://localhost/retailer/receivestandard.asp.
 * 7) Receivestandard.asp performs another BizTalk Interchange.Submit of the catalog to the Catalog Import Channel.
 * 8) The Catalog Import Channel validates the submitted catalog against the Catalog schema (again), and then passes the catalog to the Retailer Receive port.
 * 9) The Retailer Receive port passes the catalog to the specified transport address of BizTalk Scriptor.
 * 10) The BizTalk Scriptor writes a copy of the catalog to the Commercecatalogs folder on the computer running BizTalk Server, and then calls the ImportXML method of the Commerce Server 2000 CatalogManager object to import the catalog into the Retailer site.

Keywords: kbhowto kbdownload KB301106

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.