1.6. WSI Import Doc Reference

Web Service Automation Interface (WSI) 1.0
For AspDotNetStorefront v7.1 or higher
Document Revision 1.1
3/4/2007
AspDotNetStorefront WSI (BETA)
1 of 70
Table Of Contents
1. WSI Introduction ............................................................................................. 3
1.1.
Overview........................................................................................... 3
1.2.
WSI Abstraction Level ......................................................................... 3
1.3.
Using ID and GUID fields ..................................................................... 3
1.4.
Installing WSI .................................................................................... 4
1.5.
Security Considerations....................................................................... 5
1.6.
WSI Import Doc Reference .................................................................. 6
1.7.
WSI Import Doc DTD ........................................................................ 14
1.8.
WSI Import Doc Header Attributes ..................................................... 14
1.9.
Execution Sequence ......................................................................... 15
2. Examples ..................................................................................................... 16
2.1.
Pulling New Orders & Update Shipping Information Example .................. 16
2.2.
Pulling Customer Data Example ......................................................... 28
2.3.
Updating Customer Data Example ...................................................... 31
2.4.
Updating Product Prices .................................................................... 31
2.5.
Sample Test Program ....................................................................... 33
2.6.
Sample .net Client Code .................................................................... 34
3. WSI Element Nodes ....................................................................................... 38
3.1.
<Transaction> ................................................................................. 39
3.2.
<ProductType> ................................................................................ 40
3.3.
<Entity> ......................................................................................... 41
3.4.
<Product> ...................................................................................... 42
3.5.
<Customer>.................................................................................... 43
3.6.
<ShoppingCart> .............................................................................. 44
3.7.
<Mapping> ..................................................................................... 45
3.8.
<ClearMappings> ............................................................................. 46
3.9.
<GetGUID> ..................................................................................... 47
3.10.
<GetEntityHelper> ........................................................................... 48
3.11.
<GetEntity> .................................................................................... 54
3.12.
<GetProduct> ................................................................................. 55
3.13.
<GetMappings> ............................................................................... 56
3.14.
<AppConfig> ................................................................................... 57
3.15.
<ResetCache> ................................................................................. 58
3.16.
<Get> ............................................................................................ 59
3.17.
<Set> ............................................................................................ 62
3.18.
<XmlPackage> ................................................................................ 64
3.19.
<Query>......................................................................................... 65
3.20.
<ExecuteSQL> ................................................................................ 67
4. WSI Notes .................................................................................................... 69
4.1.
Performance Notes ........................................................................... 69
4.2.
Excel Bulk Product Importer .............................................................. 69
4.3.
Caching Notes.................................................................................. 69
4.4.
Node Processing ............................................................................... 69
4.5.
Security .......................................................................................... 69
5. WSI Event Notification Callbacks ..................................................................... 70
AspDotNetStorefront WSI (BETA)
2 of 70
1. WSI Introduction
1.1.
Overview
This guide covers the Import/Export Web Service Interface (WSI) v1.0 for
AspDotNetStorefront v7.1 or higher.
This web service replaces all prior “bulk import” routines, while still supporting all prior
bulk import features.
The new WSI is designed for programmatic & automatic add, update, and deletion of
AspDotNetStorefront database information from external agents. The objective of this
WSI is to facilitate other vendors (e.g. CMS systems, Fulfillment Systems, Accounting
Systems, etc) to import, export, update, and sync data with AspDotNetStorefront.
1.2.
WSI Abstraction Level
The WSI implementation right now consists of rather low level processing nodes (e.g.
Set, Get, etc). Over time, we expect to add higher abstractional elements (e.g.
UpdateOrderShipping, etc). So you can do updates on the database elements various
ways. You should use the highest abstraction element provided when possible, as it may
perform additional semantic processing (e.g. you could issue a <Set> node against the
ProductVariant table to update a variantprice, or you could use the <Product> node that
can do this same thing, which also has more semantic understanding of how products
work, so it may be prudent to use the higher level abstraction element.
1.3.
Using ID and GUID fields
Whenever an ID or GUID is referenced in the WSI documents, the ID corresponds to the
identify field (or other primary key field) of a table.
Nearly all of our tables have identity fields, which auto assign. You CANNOT force the db
to use a specific ID (e.g. product id 14) on any Add operations!
You can however pass in a GUID that can be assigned, even on data creation or add, and
then you can later use that GUID to correlate to ID. Each action returns both the ID
(which was auto assigned) and the GUID used.
The GUID corresponds to the GUID field we have in almost every table.
Note that the “ID” field may be called differently in different tables (and the ipx.xml file
has the mappings for non-standard fields, or those needed for performance). For
instance, the “ID” field on an Orders action corresponds to “OrderNumber”. The ID on a
Product action corresponds to ProductID.
Just think of ID as the master identity of the table, and you will have no trouble making
the associations.
Remember to assign your own GUIDS to all nodes, if you must keep the master “ID”
lookup on your system external to AspDotNetStorefront.
AspDotNetStorefront WSI (BETA)
3 of 70
1.4.
Installing WSI
WSI is provided as a set of 3 add-on files that you must place into your
AspDotNetStorefront web site. You will also need to make a few simple web.config file
mods to your root AspDotNetStorefront web.config file.
a) Deploying files:

ipx.asmx -> copy to root of your AspDotNetStorefront site. This is the
actual WSI calling point. You should rename this file when deployed on
your site to an unobvious name, to enhance security (e.g.
mywebif3453234page.asmx, or whatever you want).

ipx.xml -> copy to root of your AspDotNetStorefront site

ipx.cs -> copy to your AspDotNetStorefront app_code directory

ASPDNSFUsernameTokenManager.cs -> copy to your AspDotNetStorefront
app_code directory. This provides authenticated WSE3 username token
authentication manager class for secure login to the WSI.

WSI.cs -> should be in your ASPDNSFCommon project directory (requires
Source License Agreement (SLA) to get source to WSI.cs) and added to
your Common project in the solution. Make sure you have the latest
WSI.cs file, or AspDotNetStorefrontCommon.dll file(s) from support.

DB.cs -> should be in your ASPDNSFCommon project directory (requires
Source License Agreement (SLA) to get source to DB.cs) and added to your
Common project in the solution. Make sure you have the latest DB.cs file,
or AspDotNetStorefrontCommon.dll file(s) from support, as we have added
transaction support to this class for the WSI.
The execution hierarchy is ipx.asmx -> ipx.cs -> ASPDNSFUsenameTokenManager.cs ->
WSI.cs. The WSI.cs does all the actual heavy lifting/processing for WSI.
b) Modifying Web.Config
Added the following element to the <configSections> element
<section name="microsoft.web.services3"
type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration,
Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" />
Added the following :
<system.web>
<compilation defaultLanguage="c#" debug="true">
<assemblies>
<add assembly="Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35" />
AspDotNetStorefront WSI (BETA)
4 of 70
Added the following to the <system.web> element
<webServices>
<protocols>
<add name="HttpSoap12"/>
<add name="HttpSoap"/>
<!-- <add name="HttpPost"/> -->
<!-- <add name="HttpGet"/> -->
<add name="HttpPostLocalhost" />
<add name="Documentation"/>
</protocols>
<soapExtensionImporterTypes>
<add type="Microsoft.Web.Services3.Description.WseExtensionImporter,
Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" />
</soapExtensionImporterTypes>
<soapServerProtocolFactory type="Microsoft.Web.Services3.WseProtocolFactory,
Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" />
</webServices>
Added the following element as a child of the <configuration> element:
<microsoft.web.services3>
<!-- <policy fileName="wse3policyCache.config" /> -->
<security>
<securityTokenManager>
<add type="AspDotNetStorefront.ASPDNSFUsernameTokenManager"
namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecuritysecext-1.0.xsd" localName="UsernameToken" />
</securityTokenManager>
</security>
</microsoft.web.services3>
Once prepared, your web service will be at this url:
http://www.yourdomain.com/ipx.asmx (or https)
1.5.
Security Considerations
Theoretically, the WSI interface allows complete access to your store database. This may
include sensitive data. Adherence to the security practices defined here are mandatory
for proper deployment and usage.
a) Turn off all protocols except SOAP (this was actually done in step 1.2 above when
you made your web.config file mods)
b) You must use Microsoft Web Services 3 Enhancements, for Username Token
authenticated connections to the WSI web service. WSE3 must be installed on the
client and server sides. Your client calling the WSI must also then properly create
an authenticated request
AspDotNetStorefront WSI (BETA)
5 of 70
c) If you are NOT using WSI on your site, do NOT deploy the WSI files to your site.
There simply is no point to having them there if you are not using them.
d) Make sure you are running the web service over HTTPS protocol in a production
environment. Running over HTTP is ok in dev/test setup, but you must use SSL
encryption for production data transfers.
e) We do provide a method that can be invoked over HTTPS using email & password
validation on the actual web service call, which doesn’t require Microsoft Web
Services 3 Enhancements to be installed on the server, but we STRONGLY
recommend that you do not use it. Use the WSE3 authenticated method!
Related Links:
a) http://msdn2.microsoft.com/en-us/library/ms977317.aspx
b) http://msdn.microsoft.com/library/enus/dnpag2/html/WSS_Ch3_ImpDirectAuth_WSE30.asp
c) http://msdn.microsoft.com/library/default.asp?url=/library/enus/wse3.0/html/9fe501c6-1093-4a97-89b1-a6497aae26b5.asp
NOTE: When using WSE3 Authenticated invocation of WSI from your client
program, you MUST use the SuperAdmin Email and HASHED Password from the
master AspDotNetStorefront database!!! You cannot put the password in clear
text in the client! It MUST MUST MUST be the hashed raw value from the
storefront database!!! If you are using the NON WSE3 invocation, you use the
CLEAR TEXT password for the admin user!
1.6.
WSI Import Doc Reference
This example shows the complete sample set of WSI nodes supported at this time.
<AspDotNetStorefrontImport Version="7.1" AutoLazyAdd="boolean" AutoCleanup="boolean"
Verbose="boolean" UseImplicitTransactions="boolean">
<Transaction Name="string">
... any valid processing nodes here from below ...
... allows you to create transaction groups for sets of commands if you want them
to rollback on ANY error ...
</Transaction>
<ProductType Action="Add|Update|Delete|Nuke|Lookup" GUID="uniqueidentifier"
ID="integer">
<Name>string</Name>
</ProductType>
<Entity EntityType="Manufacturer|Distributor|Category|Section|Genre|Vector"
Action="Add|Update|Delete|Nuke|Lookup" ID="integer" GUID="uniqueidentifier"
RemoveMappings="boolean">
<Name>string</Name>
<XPath></XPath>
<SE>
<SEName></SEName>
<SETitle></SETitle>
<SEKeywords></SEKeywords>
<SEDescription></SEDescription>
<SENoScript></SENoScript>
<SEAltText></SEAltText>
AspDotNetStorefront WSI (BETA)
6 of 70
</SE>
<Address1></Address1>
<Address2></Address2>
<Suite></Suite>
<City></City>
<State></State>
<ZipCode></ZipCode>
<Country></Country>
<Phone></Phone>
<FAX></FAX>
<URL></URL>
<EMail></EMail>
<Summary></Summary>
<Description></Description>
<Display>
<XmlPackage></XmlPackage>
<ColWidth></ColWidth>
<PageSize></PageSize>
<SkinID></SkinID>
<TemplateName></TemplateName>
</Display>
<Images>
<Icon Extension="gif|jpg|png|jpeg" Delete="boolean">base64 encoded
image data here</Icon>
<Medium Extension="gif|jpg|png|jpeg" Delete="boolean">base64 encoded
image data here</Medium>
<Large Extension="gif|jpg|png|jpeg" Delete="boolean">base64 encoded
image data here</Large>
<ImageFilenameOverride></ImageFilenameOverride>
</Images>
<QuantityDiscount Name="string" ID="integer" GUID="uniqueidentifier"/>
<DisplayOrder></DisplayOrder>
<Published></Published>
<Wholesale></Wholesale>
<ExtensionData></ExtensionData>
<Entity EntityType="Manufacturer|Distributor|Category|Section|Genre|Vector"
Action="Add|Update|Delete|Nuke|Lookup" ID="integer" GUID="uniqueidentifier">
<Name>string</Name>
<XPath></XPath>
<SE>
<SEName></SEName>
<SETitle></SETitle>
<SEKeywords></SEKeywords>
<SEDescription></SEDescription>
<SENoScript></SENoScript>
<SEAltText></SEAltText>
</SE>
<Address1></Address1>
<Address2></Address2>
<Suite></Suite>
<City></City>
<State></State>
<ZipCode></ZipCode>
<Country></Country>
<Phone></Phone>
<FAX></FAX>
<URL></URL>
<EMail></EMail>
<Summary></Summary>
AspDotNetStorefront WSI (BETA)
7 of 70
<Description></Description>
<Display>
<XmlPackage></XmlPackage>
<ColWidth></ColWidth>
<PageSize></PageSize>
<SkinID></SkinID>
<TemplateName></TemplateName>
</Display>
<Images>
<Icon Extension="gif|jpg|png|jpeg" Delete="boolean">base64
encoded image data here</Icon>
<Medium Extension="gif|jpg|png|jpeg" Delete="boolean">base64
encoded image data here</Medium>
<Large Extension="gif|jpg|png|jpeg" Delete="boolean">base64
encoded image data here</Large>
<ImageFilenameOverride></ImageFilenameOverride>
</Images>
<QuantityDiscount Name="string" ID="integer" GUID="uniqueidentifier"/>
<DisplayOrder></DisplayOrder>
<Published></Published>
<Wholesale></Wholesale>
<ExtensionData></ExtensionData>
</Entity>
</Entity>
<Product Action="Add|Update|Delete|Nuke|Lookup" GUID="uniqueidentifier"
ID="integer">
<Name>string</Name>
<Summary></Summary>
<Description></Description>
<SpecTitle></SpecTitle>
<MiscText></MiscText>
<Notes></Notes>
<IsFeaturedTeaser></IsFeaturedTeaser>
<FroogleDescription></FroogleDescription>
<SKU></SKU>
<ManufacturerPartNumber></ManufacturerPartNumber>
<SwatchImageMap></SwatchImageMap>
<SE>
<SEName></SEName>
<SETitle></SETitle>
<SEKeywords></SEKeywords>
<SEDescription></SEDescription>
<SENoScript></SENoScript>
<SEAltText></SEAltText>
</SE>
<SizeOptionPrompt></SizeOptionPrompt>
<ColorOptionPrompt></ColorOptionPrompt>
<ProductType Name="string" ID="integer" GUID="uniqueidentifier"/>
<TaxClass Name="string" ID="integer" GUID="uniqueidentifier"/>
<SalesPrompt Name="string" ID="integer" GUID="uniqueidentifier"/>
<SpecCall></SpecCall>
<SpecsInline></SpecsInline>
<Display>
<XmlPackage></XmlPackage>
<ColWidth></ColWidth>
<PageSize></PageSize>
<SkinID></SkinID>
<TemplateName></TemplateName>
</Display>
AspDotNetStorefront WSI (BETA)
8 of 70
<Images>
<Icon Extension="gif|jpg|png|jpeg" Delete="boolean">base64 encoded
image data here</Icon>
<Medium Extension="gif|jpg|png|jpeg" Delete="boolean">base64 encoded
image data here</Medium>
<Large Extension="gif|jpg|png|jpeg" Delete="boolean">base64 encoded
image data here</Large>
<ImageFilenameOverride></ImageFilenameOverride>
</Images>
<QuantityDiscount Name="string" ID="integer" GUID="uniqueidentifier"/>
<RelatedProducts>
<CX ID="integer" GUID="uniqueidentifier"/>
<CX ID="integer" GUID="uniqueidentifier"/>
<CX ID="integer" GUID="uniqueidentifier"/>
<CX ID="integer" GUID="uniqueidentifier"/>
<CX ID="integer" GUID="uniqueidentifier"/>
</RelatedProducts>
<UpsellProducts DiscountPercentage="">
<CX ID="integer" GUID="uniqueidentifier"/>
<CX ID="integer" GUID="uniqueidentifier"/>
<CX ID="integer" GUID="uniqueidentifier"/>
<CX ID="integer" GUID="uniqueidentifier"/>
<CX ID="integer" GUID="uniqueidentifier"/>
</UpsellProducts>
<RequiresProducts>
<CX ID="integer" GUID="uniqueidentifier"/>
<CX ID="integer" GUID="uniqueidentifier"/>
<CX ID="integer" GUID="uniqueidentifier"/>
<CX ID="integer" GUID="uniqueidentifier"/>
<CX ID="integer" GUID="uniqueidentifier"/>
</RequiresProducts>
<InventoryType>
<TrackInventoryBySizeAndColor></TrackInventoryBySizeAndColor>
<WarehouseLocation></WarehouseLocation>
</InventoryType>
<IsFeatured></IsFeatured>
<IsAKit>1</IsAKit>
<IsSystem></IsSystem>
<IsAPack></IsAPack>
<PackSize></PackSize>
<ShowInProductBrowser></ShowInProductBrowser>
<ShowBuyButton></ShowBuyButton>
<Published></Published>
<Wholesale></Wholesale>
<RequiresRegistration></RequiresRegistration>
<HidePriceUntilCart></HidePriceUntilCart>
<IsCalltoOrder></IsCalltoOrder>
<ExcludeFromPriceFeeds></ExcludeFromPriceFeeds>
<GoogleCheckoutAllowed></GoogleCheckoutAllowed>
<RequiresTextOption></RequiresTextOption>
<TextOptionMaxLength></TextOptionMaxLength>
<TextOptionPrompt></TextOptionPrompt>
<AvailableStartDate></AvailableStartDate>
<AvailableStopDate></AvailableStopDate>
<Mappings AutoCleanup="boolean">
<Entity
EntityType="Manufacturer|Distributor|Category|Section|Genre|Vector" Name="" XPath=""
ID="integer" GUID="uniqueidentifier" DisplayOrder=""/>
AspDotNetStorefront WSI (BETA)
9 of 70
<Entity
EntityType="Manufacturer|Distributor|Category|Section|Genre|Vector" Name="" XPath=""
ID="integer" GUID="uniqueidentifier" DisplayOrder=""/>
<Entity
EntityType="Manufacturer|Distributor|Category|Section|Genre|Vector" Name="" XPath=""
ID="integer" GUID="uniqueidentifier" DisplayOrder=""/>
<Entity
EntityType="Manufacturer|Distributor|Category|Section|Genre|Vector" Name="" XPath=""
ID="integer" GUID="uniqueidentifier" DisplayOrder=""/>
<Entity
EntityType="Manufacturer|Distributor|Category|Section|Genre|Vector" Name="" XPath=""
ID="integer" GUID="uniqueidentifier" DisplayOrder=""/>
</Mappings>
<ExtensionData></ExtensionData>
<ExtensionData2></ExtensionData2>
<ExtensionData3></ExtensionData3>
<ExtensionData4></ExtensionData4>
<ExtensionData5></ExtensionData5>
<Kit AutoCleanup="boolean"> <!-- only used if IsAKit is 1 -->
<KitGroup>
<Name>Motherboard</Name>
<Description>Select the type of motherboard you want in your
computer</Description>
<DisplayOrder>1</DisplayOrder>
<KitGroupTypeID>1</KitGroupTypeID>
<IsRequired>1</IsRequired>
<KitItem>
<Name>AMD 64x</Name>
<Description></Description>
<PriceDelta>0.00</PriceDelta>
<IsDefault>1</IsDefault>
<DisplayOrder>1</DisplayOrder>
<TextOptionMaxLength></TextOptionMaxLength>
<TextOptionWidth></TextOptionWidth>
<TextOptionHeight></TextOptionHeight>
<WeightDelta></WeightDelta>
</KitItem>
<KitItem>
<Name>AMD 64x-2</Name>
<Description></Description>
<PriceDelta>100.00</PriceDelta>
<IsDefault>0</IsDefault>
<DisplayOrder>2</DisplayOrder>
<TextOptionMaxLength></TextOptionMaxLength>
<TextOptionWidth></TextOptionWidth>
<TextOptionHeight></TextOptionHeight>
<WeightDelta></WeightDelta>
</KitItem>
<KitItem>
<Name>Intel Quad 48C</Name>
<Description></Description>
<PriceDelta>250.00</PriceDelta>
<IsDefault>0</IsDefault>
<DisplayOrder>3</DisplayOrder>
<TextOptionMaxLength></TextOptionMaxLength>
<TextOptionWidth></TextOptionWidth>
<TextOptionHeight></TextOptionHeight>
<WeightDelta></WeightDelta>
</KitItem>
AspDotNetStorefront WSI (BETA)
10 of 70
</KitGroup>
<KitGroup>
<Name>Memory</Name>
<Description>Select the memory size you want</Description>
<DisplayOrder>2</DisplayOrder>
<KitGroupTypeID>1</KitGroupTypeID>
<IsRequired>1</IsRequired>
<KitItem>
<Name>1GB</Name>
<Description></Description>
<PriceDelta>0.00</PriceDelta>
<IsDefault>1</IsDefault>
<DisplayOrder>1</DisplayOrder>
<TextOptionMaxLength></TextOptionMaxLength>
<TextOptionWidth></TextOptionWidth>
<TextOptionHeight></TextOptionHeight>
<WeightDelta></WeightDelta>
</KitItem>
<KitItem>
<Name>2GB</Name>
<Description></Description>
<PriceDelta>100.00</PriceDelta>
<IsDefault>0</IsDefault>
<DisplayOrder>2</DisplayOrder>
<TextOptionMaxLength></TextOptionMaxLength>
<TextOptionWidth></TextOptionWidth>
<TextOptionHeight></TextOptionHeight>
<WeightDelta></WeightDelta>
</KitItem>
<KitItem>
<Name>3GB</Name>
<Description></Description>
<PriceDelta>550.00</PriceDelta>
<IsDefault>0</IsDefault>
<DisplayOrder>3</DisplayOrder>
<TextOptionMaxLength></TextOptionMaxLength>
<TextOptionWidth></TextOptionWidth>
<TextOptionHeight></TextOptionHeight>
<WeightDelta></WeightDelta>
</KitItem>
</KitGroup>
<KitGroup>
<Name>Software Options</Name>
<Description>Select the bundled software you want</Description>
<DisplayOrder>3</DisplayOrder>
<KitGroupTypeID>3</KitGroupTypeID>
<IsRequired>0</IsRequired>
<KitItem>
<Name>Microsoft Office</Name>
<Description></Description>
<PriceDelta>450.00</PriceDelta>
<IsDefault>0</IsDefault>
<DisplayOrder>1</DisplayOrder>
<WeightDelta></WeightDelta>
</KitItem>
<KitItem>
<Name>Visual Studio</Name>
<Description></Description>
<PriceDelta>250.00</PriceDelta>
AspDotNetStorefront WSI (BETA)
11 of 70
<IsDefault>0</IsDefault>
<DisplayOrder>1</DisplayOrder>
<WeightDelta></WeightDelta>
</KitItem>
<KitItem>
<Name>Symantec AntiVirus</Name>
<Description></Description>
<PriceDelta>100.00</PriceDelta>
<IsDefault>0</IsDefault>
<DisplayOrder>1</DisplayOrder>
<WeightDelta></WeightDelta>
</KitItem>
</KitGroup>
</Kit>
<Variants AutoCleanup="boolean">
<Variant Action="Add|Update|Delete|Nuke|Lookup" Name="string"
SKUSuffix="" GUID="uniqueidentifier" ID="integer">
<IsDefault></IsDefault>
<Name>string</Name>
<Description></Description>
<SE>
<SEName></SEName>
<SEKeywords></SEKeywords>
<SEDescription></SEDescription>
<SENoScript></SENoScript>
<SEAltText></SEAltText>
</SE>
<FroogleDescription></FroogleDescription>
<ProductID></ProductID>
<SKUSuffix></SKUSuffix>
<ManufacturerPartNumber></ManufacturerPartNumber>
<Price></Price>
<SalePrice></SalePrice>
<Weight></Weight>
<MSRP></MSRP>
<Cost></Cost>
<Points></Points>
<Dimensions></Dimensions>
<Inventory></Inventory>
<DisplayOrder></DisplayOrder>
<Notes></Notes>
<IsTaxable></IsTaxable>
<IsShipSeparately></IsShipSeparately>
<IsDownload></IsDownload>
<DownloadLocation></DownloadLocation>
<FreeShipping></FreeShipping>
<Published></Published>
<Wholesale></Wholesale>
<IsRecurring></IsRecurring>
<RecurringInterval></RecurringInterval>
<RecurringIntervalType></RecurringIntervalType>
<SubscriptionInterval></SubscriptionInterval>
<SubscriptionIntervalType></SubscriptionIntervalType>
<RestrictedQuantities></RestrictedQuantities>
<MinimumQuantity></MinimumQuantity>
<Images ClearBeforeImport="boolean">
<Icon Extension="gif|jpg|png|jpeg">base64 encoded
image data here</Icon>
AspDotNetStorefront WSI (BETA)
12 of 70
<Medium Extension="gif|jpg|png|jpeg">base64 encoded
image data here</Medium>
<Large Extension="gif|jpg|png|jpeg">base64 encoded
image data here</Large>
<ImageFilenameOverride></ImageFilenameOverride>
</Images>
<CustomerEntersPrice></CustomerEntersPrice>
<CustomerEntersPricePrompt></CustomerEntersPricePrompt>
<ExtensionData></ExtensionData>
<ExtensionData2></ExtensionData2>
<ExtensionData3></ExtensionData3>
<ExtensionData4></ExtensionData4>
<ExtensionData5></ExtensionData5>
<Sizes>
<Size SKUModifier="xx" PriceDelta="">red</Size>
<Size SKUModifier="xx" PriceDelta="">green</Size>
<Size SKUModifier="xx" PriceDelta="">blue</Size>
</Sizes>
<Colors>
<Color SKUModifier="xx" PriceDelta="">s</Color>
<Color SKUModifier="xx" PriceDelta="">m</Color>
<Color SKUModifier="xx" PriceDelta="">l</Color>
</Colors>
<InventoryBySizeAndColor>
<Inv Color="" Size="" Quantity="" VendorID="integer"
VendorFullSKU="" ExtensionData=""/>
<Inv Color="" Size="" Quantity="" VendorID="integer"
VendorFullSKU="" ExtensionData=""/>
<Inv Color="" Size="" Quantity="" VendorID="integer"
VendorFullSKU="" ExtensionData=""/>
<Inv Color="" Size="" Quantity="" VendorID="integer"
VendorFullSKU="" ExtensionData=""/>
</InventoryBySizeAndColor>
</Variant>
</Variants>
</Product>
<Mapping Action="Add|Delete"
EntityType="Manufacturer|Distributor|Category|Section|Genre|Vector" EntityID="integer"
EntityGUID="uniqueidentifier" ObjectType="Product" ObjectID="integer"
ObjectGUID="uniqueidentifier" DisplayOrder=""/>
<ClearMappings EntityType="Manufacturer|Distributor|Category|Section|Genre|Vector"
ID="integer" GUID="uniqueidentifier"/>
<GetGUID Count="N"/>
<GetEntity EntityType="Manufacturer|Distributor|Category|Section|Genre|Vector"
EntityID="integer" EntityGUID="uniqueidentifier" Recursive="boolean"
IncludeImages="boolean"/> <!-- if ID and GUID are empty, gets all of the specified entities from
root on down -->
<GetProduct ID="integer" GUID="uniqueidentifier"
ForEntityType="Manufacturer|Distributor|Category|Section|Genre|Vector|Affiliate|CustomerLevel"
ForEntityID="integer" ForEntityGUID="uniqueidentifier" IncludeVariants="boolean"
IncludeImages="boolean"/>
<GetMappings EntityType="Manufacturer|Distributor|Category|Section|Genre|Vector"
EntityID="integer" EntityGUID="uniqueidentifier"/>
<Get Table="string" Name="string">
<IDColumn>string</IDColumn>
<XmlPackage RuntimeParams="x=1&y=2">packagename</XmlPackage>
<DefaultWhereClause>IsNew=1</DefaultWhereClause>
<OrderBy>DisplayOrder, Name</OrderBy>
<Criteria Field1="value" Field2="value" Field3="value"... />
AspDotNetStorefront WSI (BETA)
13 of 70
</Get>
<Set Table="string" ID="integer" GUID="uniqueidentifier" IDColumn="string"
GUIDColumn="string">
<Field1>value</Field1>
<Field2>value</Field2>
</Set>
<Query Name="string" RowName="string">
<SQL>
<![CDATA[
select * from whatever where whatever
]]>
</SQL>
</Query>
<ExecuteSQL Name="string">
<SQL>
<![CDATA[
update whatever set whateverfield=whatevervalue where whatever clause
you want
]]>
</SQL>
</ExecuteSQL>
<GetEntityHelper EntityType="Manufacturer|Distributor|Category|Section|Genre|Vector"/>
<AppConfig Action="Add|Update|Delete|Lookup" Name="string" Description="string"
ConfigValue="string" SuperOnly="boolean"/>
<XmlPackage Name="string"
RuntimeParams="pararm1=value1&param2=value2&param3=value3"
OutputType="INLINE|CDATA"/>
<ResetCache Confirm="true"/>
</AspDotNetStorefrontImport>
You can use this reference for now, to determine syntax, etc. it shows many of the
supported node elements. See the DTD for formal specifcations.
1.7.
WSI Import Doc DTD
The DTD is not done yet.
1.8.
WSI Import Doc Header Attributes
The import doc has a number of header attributes, which can affect how the document is
processed.
<AspDotNetStorefrontImport Version="7.1" AutoLazyAdd="true|false"
AutoCleanup="true|false" Verbose="true|false" TransactionsEnabled="true|false">
…
</AspDotNetStorefrontImport>
Each attribute is listed and described below.

Version: This should be set to 7.1

AutoLazyAdd (Default=false): This should be set to either true or false. This
flag affects how an update action behaves if an item doesn’t exist (e.g. you issue
an update action on a product that doesn’t exist). If AutoLazyAdd=”false”, then an
error will be raised in the case you update a non-existent item. If
AspDotNetStorefront WSI (BETA)
14 of 70
AutoLazyAdd=”true”, the product will be automatically added, using the values in
the update action node.

AutoCleanup (Default=false): This flag is not yet supported at the document
level. See the AutoCleanup attribute on various processing nodes, which are
supported.

Verbose (Default=false): This flag indicates whether or not to output
information processing nodes in the resulting XmlDocument. Setting
Verbose=”true” will enable easier debugging of WSI actions and allow you to trace
through all execution steps, and SQL statements. Your client should ignore any
informational nodes produced, when processing the output for automation.

UseImplicitTransactions (Default=false): This flag control whether or not
nodes in the input document are handled in transaction mode or not implicitly.
This flag does NOT affect explicit <Transaction>…</Transaction> blocks which
are always honored. If UseImplicitTransactions=”true”, then if there are
processing nodes in the input Xml document which are not nested inside a
<Transaction> block, the WSI will create an implicit default transaction for EACH
node it processes. This can allow you to ensure the node and all resulting data
either commits or rolls back on any error (e.g. when adding a Product). If
UseImplicitTransactions=”false”, then any non Transaction block nodes are just
executed as is. They can partially succeed or fail, and you will have to examine
the output result Xml document to determine what was performed.
In this root node, you can set the following attributes. Defaults are marked with a *.

Version = 7.1

SetImportFlag = true | *false {this is not supported yet in BETA}

AutoLazyAdd = true | *false. This flag is supported and controls how an update
node performs, if the targeted data doesn’t exist in the database. If an update is
1.9.
Execution Sequence
The WSI processes elements sequentially, IN ORDER THEY APPEAR in your input Xml
document!
AspDotNetStorefront WSI (BETA)
15 of 70
2. Examples
2.1.
Pulling New Orders & Update Shipping Information Example
The WSI can be used to automate commonly performed tasks such as pulling new
orders, updating shipping tracking information, etc. A few examples will be given here.
For example, to pull all “new” orders from the storefront, you could execute this:
<AspDotNetStorefrontImport Verbose="false">
<Get Table="Orders" Name="NewOrders">
<XmlPackage>DumpOrder.xml.config</XmlPackage>
<OrderBy>OrderDate asc</OrderBy>
<Criteria IsNew="1"/>
</Get>
</AspDotNetStorefrontImport>
This might return a document like shown below:
<?xml version="1.0" encoding="utf-8"?>
<AspDotNetStorefrontImportResult Version="" DateTime="3/4/2007 11:16:40 AM">
<Get Table="Orders" Name="NewOrders" XmlPackage="DumpOrder.xml.config"
IDColumn="OrderNumber" DefaultWhereClause="" OrderBy="OrderDate asc">
<Criteria IsNew="1" />
<Order OrderNumber="100000" ShowCardNumber="">
<OrderNumber>100000</OrderNumber>
<OrderGUID>80784eed-ddea-4ef1-adb7-cde7935f775b</OrderGUID>
<ParentOrderNumber>
</ParentOrderNumber>
<StoreVersion>AspDotNetStorefront ML 7.1.0.0/7.0.0.3</StoreVersion>
<QuoteCheckout>0</QuoteCheckout>
<IsNew>1</IsNew>
<ShippedOn>
</ShippedOn>
<CustomerID>58639</CustomerID>
<CustomerGUID>b9672b60-311c-42b5-bb12-8d3b6af81814</CustomerGUID>
<Referrer>
</Referrer>
<SkinID>1</SkinID>
<LastName>Anderson</LastName>
<FirstName>Robert</FirstName>
<Email>[email protected]</Email>
<Notes>
</Notes>
<BillingEqualsShipping>1</BillingEqualsShipping>
<BillingLastName>Anderson</BillingLastName>
<BillingFirstName>Robert</BillingFirstName>
<BillingCompany>
</BillingCompany>
<BillingAddress1>13105 N 145th Way</BillingAddress1>
<BillingAddress2>
</BillingAddress2>
AspDotNetStorefront WSI (BETA)
16 of 70
<BillingSuite>
</BillingSuite>
<BillingCity>Scottsdale</BillingCity>
<BillingState>AZ</BillingState>
<BillingZip>85259</BillingZip>
<BillingCountry>United States</BillingCountry>
<BillingPhone>602-490-0243</BillingPhone>
<ShippingLastName>Anderson</ShippingLastName>
<ShippingFirstName>Robert</ShippingFirstName>
<ShippingCompany>
</ShippingCompany>
<ShippingResidenceType>1</ShippingResidenceType>
<ShippingAddress1>13105 N 145th Way</ShippingAddress1>
<ShippingAddress2>
</ShippingAddress2>
<ShippingSuite>
</ShippingSuite>
<ShippingCity>Scottsdale</ShippingCity>
<ShippingState>AZ</ShippingState>
<ShippingZip>85259</ShippingZip>
<ShippingCountry>United States</ShippingCountry>
<ShippingMethodID>1</ShippingMethodID>
<ShippingMethod>Ground</ShippingMethod>
<ShippingPhone>602-490-0243</ShippingPhone>
<ShippingCalculationID>2</ShippingCalculationID>
<Phone>602-490-0243</Phone>
<RegisterDate>2/10/2007 12:19:31 PM</RegisterDate>
<AffiliateID>0</AffiliateID>
<CouponCode>
</CouponCode>
<CouponType>0</CouponType>
<CouponDescription>
</CouponDescription>
<CouponDiscountAmount>0.0000</CouponDiscountAmount>
<CouponDiscountPercent>0.0000</CouponDiscountPercent>
<CouponIncludesFreeShipping>0</CouponIncludesFreeShipping>
<OkToEmail>1</OkToEmail>
<Deleted>0</Deleted>
<CardType>VISA</CardType>
<CardName>Robert Anderson</CardName>
<Last4>1111</Last4>
<CardExpirationMonth>04</CardExpirationMonth>
<CardExpirationYear>2011</CardExpirationYear>
<OrderSubtotal>4.9500</OrderSubtotal>
<OrderTax>0.0000</OrderTax>
<OrderShippingCosts>5.0000</OrderShippingCosts>
<OrderTotal>9.9500</OrderTotal>
<PaymentGateway>MANUAL</PaymentGateway>
<AuthorizationCode>0</AuthorizationCode>
<AuthorizationPNREF>1638D330-8CFB-4598-BE5102033D23FB9B</AuthorizationPNREF>
<OrderDate>2/25/2007 7:45:50 PM</OrderDate>
<LevelID>0</LevelID>
AspDotNetStorefront WSI (BETA)
17 of 70
<LevelName>
</LevelName>
<LevelDiscountPercent>
</LevelDiscountPercent>
<LevelDiscountAmount>
</LevelDiscountAmount>
<LevelHasFreeShipping>
</LevelHasFreeShipping>
<LevelAllowsQuantityDiscounts>
</LevelAllowsQuantityDiscounts>
<LevelHasNoTax>
</LevelHasNoTax>
<LevelAllowsCoupons>
</LevelAllowsCoupons>
<LevelDiscountsApplyToExtendedPrices>
</LevelDiscountsApplyToExtendedPrices>
<LastIPAddress>
</LastIPAddress>
<PaymentMethod>CREDITCARD</PaymentMethod>
<OrderNotes>
</OrderNotes>
<PONumber>
</PONumber>
<DownloadEmailSentOn>
</DownloadEmailSentOn>
<ReceiptEmailSentOn>
</ReceiptEmailSentOn>
<DistributorEmailSentOn>
</DistributorEmailSentOn>
<ShippingTrackingNumber>
</ShippingTrackingNumber>
<ShippedVIA>
</ShippedVIA>
<CustomerServiceNotes>
</CustomerServiceNotes>
<RTShipRequest>
</RTShipRequest>
<RTShipResponse>
</RTShipResponse>
<TransactionState>AUTHORIZED</TransactionState>
<AVSResult>OK</AVSResult>
<CardinalLookupResult>
</CardinalLookupResult>
<CardinalAuthenticateResult>
</CardinalAuthenticateResult>
<CardinalGatewayParms>
</CardinalGatewayParms>
<AffiliateCommissionRecorded>0</AffiliateCommissionRecorded>
<OrderOptions>
</OrderOptions>
<OrderWeight>1.0000</OrderWeight>
<eCheckBankABACode>
</eCheckBankABACode>
AspDotNetStorefront WSI (BETA)
18 of 70
<eCheckBankAccountNumber>
</eCheckBankAccountNumber>
<eCheckBankAccountType>
</eCheckBankAccountType>
<eCheckBankName>
</eCheckBankName>
<eCheckBankAccountName>Robert Anderson</eCheckBankAccountName>
<CarrierReportedRate>
</CarrierReportedRate>
<CarrierReportedWeight>
</CarrierReportedWeight>
<LocaleSetting>en-US</LocaleSetting>
<FinalizationData>&lt;root&gt;&lt;/root&gt;</FinalizationData>
<ExtensionData>
</ExtensionData>
<AlreadyConfirmed>0</AlreadyConfirmed>
<CartType>0</CartType>
<THUB_POSTED_TO_ACCOUNTING>N</THUB_POSTED_TO_ACCOUNTING>
<THUB_POSTED_DATE>
</THUB_POSTED_DATE>
<THUB_ACCOUNTING_REF>
</THUB_ACCOUNTING_REF>
<ReadyToShip>0</ReadyToShip>
<IsPrinted>0</IsPrinted>
<AuthorizedOn>2/25/2007 7:45:50 PM</AuthorizedOn>
<CapturedOn>
</CapturedOn>
<RefundedOn>
</RefundedOn>
<VoidedOn>
</VoidedOn>
<InventoryWasReduced>0</InventoryWasReduced>
<MaxMindFraudScore>-1.00</MaxMindFraudScore>
<MaxMindDetails>
</MaxMindDetails>
<CardStartDate>
</CardStartDate>
<CardIssueNumber>
</CardIssueNumber>
<TransactionType>1</TransactionType>
<Crypt>1</Crypt>
<VATRegistrationID>
</VATRegistrationID>
<OrderItems>
<Item>
<OrderNumber>100000</OrderNumber>
<ShoppingCartRecID>25</ShoppingCartRecID>
<CustomerID>58639</CustomerID>
<ProductID>1</ProductID>
<VariantID>1</VariantID>
<Quantity>1</Quantity>
<ChosenColor />
<ChosenColorSKUModifier />
AspDotNetStorefront WSI (BETA)
19 of 70
<ChosenSize />
<ChosenSizeSKUModifier />
<OrderedProductName>Simple Product 1</OrderedProductName>
<OrderedProductVariantName />
<OrderedProductSKU>01-0001</OrderedProductSKU>
<OrderedProductManufacturerPartNumber />
<OrderedProductWeight>0.0000</OrderedProductWeight>
<OrderedProductPrice>4.9500</OrderedProductPrice>
<OrderedProductRegularPrice>4.9500</OrderedProductRegularPrice>
<OrderedProductSalePrice>0.0000</OrderedProductSalePrice>
<OrderedProductExtendedPrice>0.0000</OrderedProductExtendedPrice>
<OrderedProductQuantityDiscountName />
<OrderedProductQuantityDiscountID />
<OrderedProductQuantityDiscountPercent />
<IsTaxable>1</IsTaxable>
<IsShipSeparately>0</IsShipSeparately>
<IsDownload>0</IsDownload>
<DownloadLocation />
<FreeShipping>0</FreeShipping>
<IsSecureAttachment>0</IsSecureAttachment>
<TextOption />
<CartType>0</CartType>
<SubscriptionInterval>0</SubscriptionInterval>
<ShippingAddressID>4</ShippingAddressID>
<ShippingDetail>&lt;Detail&gt;&lt;Address&gt;&lt;AddressID&gt;4&lt;/AddressID&gt;&lt;
NickName&gt;&lt;/NickName&gt;&lt;FirstName&gt;Robert&lt;/FirstName&gt;&lt;LastNam
e&gt;Anderson&lt;/LastName&gt;&lt;Company&gt;&lt;/Company&gt;&lt;ResidenceType&
gt;1&lt;/ResidenceType&gt;&lt;Address1&gt;13105 N 145th
Way&lt;/Address1&gt;&lt;Address2&gt;&lt;/Address2&gt;&lt;Suite&gt;&lt;/Suite&gt;&lt;
City&gt;Scottsdale&lt;/City&gt;&lt;State&gt;AZ&lt;/State&gt;&lt;Zip&gt;85259&lt;/Zip&g
t;&lt;Country&gt;United States&lt;/Country&gt;&lt;Phone&gt;602-4900243&lt;/Phone&gt;&lt;EMail&gt;[email protected]&lt;/EMail&gt;&lt;/Addr
ess&gt;&lt;Shipping&gt;&lt;CustomerID&gt;58639&lt;/CustomerID&gt;&lt;Date&gt;0001
-01-01T00:00:00&lt;/Date&gt;&lt;/Shipping&gt;&lt;/Detail&gt;</ShippingDetail>
<ShippingMethodID>1</ShippingMethodID>
<ShippingMethod>Ground</ShippingMethod>
<DistributorID />
<GiftRegistryForCustomerID>0</GiftRegistryForCustomerID>
<Notes />
<DistributorEmailSentOn />
<ExtensionData />
<SizeOptionPrompt />
<ColorOptionPrompt />
<TextOptionPrompt />
<CreatedOn>2/25/2007 7:45:50 PM</CreatedOn>
<SubscriptionIntervalType>3</SubscriptionIntervalType>
<CustomerEntersPrice>0</CustomerEntersPrice>
<CustomerEntersPricePrompt />
<IsAKit>0</IsAKit>
<IsAPack>0</IsAPack>
<IsSystem>0</IsSystem>
<TaxClassID>1</TaxClassID>
AspDotNetStorefront WSI (BETA)
20 of 70
<TaxRate>0.0000</TaxRate>
</Item>
</OrderItems>
<OrderPackDetail />
<OrderKitDetail />
</Order>
<Order OrderNumber="100001" ShowCardNumber="">
<OrderNumber>100001</OrderNumber>
<OrderGUID>06575f7c-2586-4a87-a3e3-8e38628fe616</OrderGUID>
<ParentOrderNumber>
</ParentOrderNumber>
<StoreVersion>AspDotNetStorefront ML 7.1.0.0/7.0.0.3</StoreVersion>
<QuoteCheckout>0</QuoteCheckout>
<IsNew>1</IsNew>
<ShippedOn>
</ShippedOn>
<CustomerID>58639</CustomerID>
<CustomerGUID>b9672b60-311c-42b5-bb12-8d3b6af81814</CustomerGUID>
<Referrer>
</Referrer>
<SkinID>1</SkinID>
<LastName>Anderson</LastName>
<FirstName>Robert</FirstName>
<Email>[email protected]</Email>
<Notes>
</Notes>
<BillingEqualsShipping>1</BillingEqualsShipping>
<BillingLastName>Anderson</BillingLastName>
<BillingFirstName>Robert</BillingFirstName>
<BillingCompany>
</BillingCompany>
<BillingAddress1>13105 N 145th Way</BillingAddress1>
<BillingAddress2>
</BillingAddress2>
<BillingSuite>
</BillingSuite>
<BillingCity>Scottsdale</BillingCity>
<BillingState>AZ</BillingState>
<BillingZip>85259</BillingZip>
<BillingCountry>United States</BillingCountry>
<BillingPhone>602-490-0243</BillingPhone>
<ShippingLastName>Anderson</ShippingLastName>
<ShippingFirstName>Robert</ShippingFirstName>
<ShippingCompany>
</ShippingCompany>
<ShippingResidenceType>1</ShippingResidenceType>
<ShippingAddress1>13105 N 145th Way</ShippingAddress1>
<ShippingAddress2>
</ShippingAddress2>
<ShippingSuite>
</ShippingSuite>
<ShippingCity>Scottsdale</ShippingCity>
<ShippingState>AZ</ShippingState>
AspDotNetStorefront WSI (BETA)
21 of 70
<ShippingZip>85259</ShippingZip>
<ShippingCountry>United States</ShippingCountry>
<ShippingMethodID>1</ShippingMethodID>
<ShippingMethod>Ground</ShippingMethod>
<ShippingPhone>602-490-0243</ShippingPhone>
<ShippingCalculationID>2</ShippingCalculationID>
<Phone>602-490-0243</Phone>
<RegisterDate>2/10/2007 12:19:31 PM</RegisterDate>
<AffiliateID>0</AffiliateID>
<CouponCode>
</CouponCode>
<CouponType>0</CouponType>
<CouponDescription>
</CouponDescription>
<CouponDiscountAmount>0.0000</CouponDiscountAmount>
<CouponDiscountPercent>0.0000</CouponDiscountPercent>
<CouponIncludesFreeShipping>0</CouponIncludesFreeShipping>
<OkToEmail>1</OkToEmail>
<Deleted>0</Deleted>
<CardType>VISA</CardType>
<CardName>Robert Anderson</CardName>
<Last4>1111</Last4>
<CardExpirationMonth>04</CardExpirationMonth>
<CardExpirationYear>2011</CardExpirationYear>
<OrderSubtotal>4.9500</OrderSubtotal>
<OrderTax>0.0000</OrderTax>
<OrderShippingCosts>5.0000</OrderShippingCosts>
<OrderTotal>9.9500</OrderTotal>
<PaymentGateway>MANUAL</PaymentGateway>
<AuthorizationCode>0</AuthorizationCode>
<AuthorizationPNREF>5A882CCC-0663-4647-83AEADA63B5C4ABF</AuthorizationPNREF>
<OrderDate>2/25/2007 7:46:47 PM</OrderDate>
<LevelID>0</LevelID>
<LevelName>
</LevelName>
<LevelDiscountPercent>
</LevelDiscountPercent>
<LevelDiscountAmount>
</LevelDiscountAmount>
<LevelHasFreeShipping>
</LevelHasFreeShipping>
<LevelAllowsQuantityDiscounts>
</LevelAllowsQuantityDiscounts>
<LevelHasNoTax>
</LevelHasNoTax>
<LevelAllowsCoupons>
</LevelAllowsCoupons>
<LevelDiscountsApplyToExtendedPrices>
</LevelDiscountsApplyToExtendedPrices>
<LastIPAddress>
</LastIPAddress>
<PaymentMethod>CREDITCARD</PaymentMethod>
AspDotNetStorefront WSI (BETA)
22 of 70
<OrderNotes>
</OrderNotes>
<PONumber>
</PONumber>
<DownloadEmailSentOn>
</DownloadEmailSentOn>
<ReceiptEmailSentOn>
</ReceiptEmailSentOn>
<DistributorEmailSentOn>
</DistributorEmailSentOn>
<ShippingTrackingNumber>
</ShippingTrackingNumber>
<ShippedVIA>
</ShippedVIA>
<CustomerServiceNotes>
</CustomerServiceNotes>
<RTShipRequest>
</RTShipRequest>
<RTShipResponse>
</RTShipResponse>
<TransactionState>CAPTURED</TransactionState>
<AVSResult>OK</AVSResult>
<CardinalLookupResult>
</CardinalLookupResult>
<CardinalAuthenticateResult>
</CardinalAuthenticateResult>
<CardinalGatewayParms>
</CardinalGatewayParms>
<AffiliateCommissionRecorded>0</AffiliateCommissionRecorded>
<OrderOptions>
</OrderOptions>
<OrderWeight>1.0000</OrderWeight>
<eCheckBankABACode>
</eCheckBankABACode>
<eCheckBankAccountNumber>
</eCheckBankAccountNumber>
<eCheckBankAccountType>
</eCheckBankAccountType>
<eCheckBankName>
</eCheckBankName>
<eCheckBankAccountName>Robert Anderson</eCheckBankAccountName>
<CarrierReportedRate>
</CarrierReportedRate>
<CarrierReportedWeight>
</CarrierReportedWeight>
<LocaleSetting>en-US</LocaleSetting>
<FinalizationData>&lt;root&gt;&lt;/root&gt;</FinalizationData>
<ExtensionData>
</ExtensionData>
<AlreadyConfirmed>0</AlreadyConfirmed>
<CartType>0</CartType>
<THUB_POSTED_TO_ACCOUNTING>N</THUB_POSTED_TO_ACCOUNTING>
<THUB_POSTED_DATE>
AspDotNetStorefront WSI (BETA)
23 of 70
</THUB_POSTED_DATE>
<THUB_ACCOUNTING_REF>
</THUB_ACCOUNTING_REF>
<ReadyToShip>0</ReadyToShip>
<IsPrinted>0</IsPrinted>
<AuthorizedOn>2/25/2007 7:46:47 PM</AuthorizedOn>
<CapturedOn>2/25/2007 7:46:47 PM</CapturedOn>
<RefundedOn>
</RefundedOn>
<VoidedOn>
</VoidedOn>
<InventoryWasReduced>1</InventoryWasReduced>
<MaxMindFraudScore>-1.00</MaxMindFraudScore>
<MaxMindDetails>
</MaxMindDetails>
<CardStartDate>
</CardStartDate>
<CardIssueNumber>
</CardIssueNumber>
<TransactionType>1</TransactionType>
<Crypt>1</Crypt>
<VATRegistrationID>
</VATRegistrationID>
<OrderItems>
<Item>
<OrderNumber>100001</OrderNumber>
<ShoppingCartRecID>25</ShoppingCartRecID>
<CustomerID>58639</CustomerID>
<ProductID>1</ProductID>
<VariantID>1</VariantID>
<Quantity>1</Quantity>
<ChosenColor />
<ChosenColorSKUModifier />
<ChosenSize />
<ChosenSizeSKUModifier />
<OrderedProductName>Simple Product 1</OrderedProductName>
<OrderedProductVariantName />
<OrderedProductSKU>01-0001</OrderedProductSKU>
<OrderedProductManufacturerPartNumber />
<OrderedProductWeight>0.0000</OrderedProductWeight>
<OrderedProductPrice>4.9500</OrderedProductPrice>
<OrderedProductRegularPrice>4.9500</OrderedProductRegularPrice>
<OrderedProductSalePrice>0.0000</OrderedProductSalePrice>
<OrderedProductExtendedPrice>0.0000</OrderedProductExtendedPrice>
<OrderedProductQuantityDiscountName />
<OrderedProductQuantityDiscountID>0</OrderedProductQuantityDiscountID>
<OrderedProductQuantityDiscountPercent>0.0000</OrderedProductQuantityDiscountPer
cent>
<IsTaxable>1</IsTaxable>
<IsShipSeparately>0</IsShipSeparately>
<IsDownload>0</IsDownload>
<DownloadLocation />
AspDotNetStorefront WSI (BETA)
24 of 70
<FreeShipping>0</FreeShipping>
<IsSecureAttachment>0</IsSecureAttachment>
<TextOption />
<CartType>0</CartType>
<SubscriptionInterval>0</SubscriptionInterval>
<ShippingAddressID>4</ShippingAddressID>
<ShippingDetail>&lt;Detail&gt;&lt;Address&gt;&lt;AddressID&gt;4&lt;/AddressID&gt;&lt;
NickName&gt;&lt;/NickName&gt;&lt;FirstName&gt;Robert&lt;/FirstName&gt;&lt;LastNam
e&gt;Anderson&lt;/LastName&gt;&lt;Company&gt;&lt;/Company&gt;&lt;ResidenceType&
gt;1&lt;/ResidenceType&gt;&lt;Address1&gt;13105 N 145th
Way&lt;/Address1&gt;&lt;Address2&gt;&lt;/Address2&gt;&lt;Suite&gt;&lt;/Suite&gt;&lt;
City&gt;Scottsdale&lt;/City&gt;&lt;State&gt;AZ&lt;/State&gt;&lt;Zip&gt;85259&lt;/Zip&g
t;&lt;Country&gt;United States&lt;/Country&gt;&lt;Phone&gt;602-4900243&lt;/Phone&gt;&lt;EMail&gt;[email protected]&lt;/EMail&gt;&lt;/Addr
ess&gt;&lt;Shipping&gt;&lt;CustomerID&gt;58639&lt;/CustomerID&gt;&lt;Date&gt;0001
-01-01T00:00:00&lt;/Date&gt;&lt;/Shipping&gt;&lt;/Detail&gt;</ShippingDetail>
<ShippingMethodID>1</ShippingMethodID>
<ShippingMethod>Ground</ShippingMethod>
<DistributorID />
<GiftRegistryForCustomerID>0</GiftRegistryForCustomerID>
<Notes />
<DistributorEmailSentOn />
<ExtensionData />
<SizeOptionPrompt />
<ColorOptionPrompt />
<TextOptionPrompt />
<CreatedOn>2/25/2007 7:46:47 PM</CreatedOn>
<SubscriptionIntervalType>3</SubscriptionIntervalType>
<CustomerEntersPrice>0</CustomerEntersPrice>
<CustomerEntersPricePrompt />
<IsAKit>0</IsAKit>
<IsAPack>0</IsAPack>
<IsSystem>0</IsSystem>
<TaxClassID>1</TaxClassID>
<TaxRate>0.0000</TaxRate>
</Item>
</OrderItems>
<OrderPackDetail />
<OrderKitDetail />
</Order>
</Get>
</AspDotNetStorefrontImportResult>
This allows you to pull the full order, including cart items, kit items, etc to an external
system for processing. Let’s suppose then that you just wanted to update the shipping
information on that order later via the WSI after processing. You might then issue a
document like the following:
<AspDotNetStorefrontImport Verbose="false">
<Transaction>
<Set Table="Orders" ID="100000">
<ShippedOn>2/25/2007 7:46:47 PM</ShippedOn>
AspDotNetStorefront WSI (BETA)
25 of 70
<ShippedVia>FedEx</ShippedVia>
<ShippingTrackingNumber>12345</ShippingTrackingNumber>
</Set>
<Set Table="Orders" ID="100001">
<ShippedOn>2/25/2007 7:46:47 PM</ShippedOn>
<ShippedVia>FedEx</ShippedVia>
<ShippingTrackingNumber>12346</ShippingTrackingNumber>
</Set>
<Set Table="Orders" ID="100002">
<ShippedOn>2/25/2007 7:46:47 PM</ShippedOn>
<ShippedVia>FedEx</ShippedVia>
<ShippingTrackingNumber>12347</ShippingTrackingNumber>
</Set>
</Transaction>
</AspDotNetStorefrontImport>
This might result in a response like:
<?xml version="1.0" encoding="utf-8"?>
<AspDotNetStorefrontImportResult Version="" DateTime="3/4/2007 11:20:48 AM">
<Transaction Name="Transaction1">
<Set Table="Orders" ID="100000" GUID="" Name="Set1">
</Set>
<Set Table="Orders" ID="100001" GUID="" Name="Set2">
</Set>
<Set Table="Orders" ID="100002" GUID="" Name="Set3">
</Set>
<Commit />
</Transaction>
</AspDotNetStorefrontImportResult>
Note the Commit node as this was issued as a Transaction. You could also issue without
using Transactions.
Let’s suppose you sent data for an invalid order (e.g. 99999):
<AspDotNetStorefrontImport Verbose="false">
<Transaction>
<Set Table="Orders" ID="100000">
<ShippedOn>2/25/2007 7:46:47 PM</ShippedOn>
<ShippedVia>FedEx</ShippedVia>
<ShippingTrackingNumber>12345</ShippingTrackingNumber>
</Set>
<Set Table="Orders" ID="100001">
<ShippedOn>2/25/2007 7:46:47 PM</ShippedOn>
<ShippedVia>FedEx</ShippedVia>
<ShippingTrackingNumber>12345</ShippingTrackingNumber>
</Set>
<Set Table="Orders" ID="99999">
<ShippedOn>2/25/2007 7:46:47 PM</ShippedOn>
<ShippedVia>FedEx</ShippedVia>
<ShippingTrackingNumber>12345</ShippingTrackingNumber>
</Set>
AspDotNetStorefront WSI (BETA)
26 of 70
</Transaction>
</AspDotNetStorefrontImport>
if you use a Transaction, you might see output like:
<?xml version="1.0" encoding="utf-8"?>
<AspDotNetStorefrontImportResult Version="" DateTime="3/4/2007 11:28:30 AM">
<Transaction Name="Transaction1">
<Set Table="Orders" ID="100000" GUID="" Name="Set1">
</Set>
<Set Table="Orders" ID="100001" GUID="" Name="Set2">
</Set>
<Error Message="Specified record ID (99999) not found!" />
<Rollback />
</Transaction>
<Error Message="Specified record not found!" />
</AspDotNetStorefrontImportResult>
This means that NONE of these sets were committed. The entire transaction was rolled
back.
If you submitted it NOT using a transaction:
<AspDotNetStorefrontImport Verbose="false">
<Set Table="Orders" ID="100000">
<ShippedOn>2/25/2007 7:46:47 PM</ShippedOn>
<ShippedVia>FedEx</ShippedVia>
<ShippingTrackingNumber>12345</ShippingTrackingNumber>
</Set>
<Set Table="Orders" ID="100001">
<ShippedOn>2/25/2007 7:46:47 PM</ShippedOn>
<ShippedVia>FedEx</ShippedVia>
<ShippingTrackingNumber>12345</ShippingTrackingNumber>
</Set>
<Set Table="Orders" ID="99999">
<ShippedOn>2/25/2007 7:46:47 PM</ShippedOn>
<ShippedVia>FedEx</ShippedVia>
<ShippingTrackingNumber>12345</ShippingTrackingNumber>
</Set>
</AspDotNetStorefrontImport>
You would get each one done that was successful:
<?xml version="1.0" encoding="utf-8"?>
<AspDotNetStorefrontImportResult Version="" DateTime="3/4/2007 11:31:01 AM">
<Set Table="Orders" ID="100000" GUID="" Name="Set1">
</Set>
<Set Table="Orders" ID="100001" GUID="" Name="Set2">
</Set>
<Error Message="Specified record ID (99999) not found!" />
<Set Table="Orders" ID="99999" GUID="" Name="Set3">
</Set>
</AspDotNetStorefrontImportResult>
AspDotNetStorefront WSI (BETA)
27 of 70
This means that the Set for orders 100000 and 100001 WERE successful, but that the
Set for order 99999 failed.
This gives you control over how to issue updates.
2.2.
Pulling Customer Data Example
To pull the information for a specified customer, you could use:
<AspDotNetStorefrontImport Verbose="false">
<Get Table="Customer" Name="Get1">
<XmlPackage>DumpCustomer.xml.config</XmlPackage>
<Criteria CustomerID=”11111”/>
</Get>
</AspDotNetStorefrontImport>
Note that this input document says issue a <Get> action against the Customer table, and
we called it “Get1”. The name is optional and up to you. We return the name in the result
set so you can correlate results to your input document. This Get says return the
information for CustomerID 11111 and use the DumpCustomer.xml.config page to format
the result for each customer result. You could return multiple customers also depending
on your Criteria. You could also match on different Criteria (e.g.
[email protected]). The criteria can be any valid field name/value in
the Customer table in this case. Note that you do not have to use an XmlPackage to
format the output, and if none is specified, the raw Xml will be returned matching the
result of the Get.
This would pull that customer’s data and return a document (like) the one shown below:
<?xml version="1.0" encoding="utf-8"?>
<AspDotNetStorefrontImportResult Version="" DateTime="3/4/2007 10:49:46 AM">
<Get Table="Customer" Name="Get1" XmlPackage="DumpCustomer.xml.config"
IDColumn="CustomerID" DefaultWhereClause="CustomerID &gt; 0" OrderBy="">
<Criteria />
<Customer>
<CustomerID>11111</CustomerID>
<CustomerGUID>B9672B60-311C-42B5-BB12-8D3B6AF81814</CustomerGUID>
<CustomerLevelID>0</CustomerLevelID>
<RegisterDate>2007-02-10T12:19:31.543</RegisterDate>
<EMail>[email protected]</EMail>
<Password />
<FirstName>Robert</FirstName>
<LastName>Anderson</LastName>
<SkinID>1</SkinID>
<Phone>602-490-0243</Phone>
<OkToEMail>1</OkToEMail>
<IsAdmin>3</IsAdmin>
<BillingEqualsShipping>1</BillingEqualsShipping>
<LastIPAddress />
<LocaleSetting>en-US</LocaleSetting>
<MicroPayBalance>0.0000</MicroPayBalance>
<RecurringShippingMethodID>1</RecurringShippingMethodID>
AspDotNetStorefront WSI (BETA)
28 of 70
<BillingAddressID>3</BillingAddressID>
<ShippingAddressID>4</ShippingAddressID>
<GiftRegistryGUID>CC2F6D62-08BE-4587-A29AE91FAF31FF36</GiftRegistryGUID>
<GiftRegistryIsAnonymous>1</GiftRegistryIsAnonymous>
<GiftRegistryAllowSearchByOthers>1</GiftRegistryAllowSearchByOthers>
<GiftRegistryHideShippingAddresses>1</GiftRegistryHideShippingAddresses>
<CODCompanyCheckAllowed>0</CODCompanyCheckAllowed>
<CODNet30Allowed>0</CODNet30Allowed>
<Deleted>0</Deleted>
<CreatedOn>2007-02-10T12:19:31.543</CreatedOn>
<Over13Checked>1</Over13Checked>
<StoreCCInDB>1</StoreCCInDB>
<IsRegistered>1</IsRegistered>
<LockedUntil>2007-03-03T19:16:36</LockedUntil>
<AdminCanViewCC>1</AdminCanViewCC>
<PwdChanged>2007-02-10T12:19:31.543</PwdChanged>
<BadLoginCount>0</BadLoginCount>
<Active>1</Active>
<PwdChangeRequired>0</PwdChangeRequired>
<SaltKey>-536047274</SaltKey>
<VATSetting>1</VATSetting>
<VATRegistrationID />
<Address>
<AddressID>3</AddressID>
<AddressGUID>9D65D969-4311-4EC5-8289-E7741DD97E53</AddressGUID>
<CustomerID>11111</CustomerID>
<NickName />
<FirstName>Robert</FirstName>
<LastName>Anderson</LastName>
<Company />
<Address1>13105 N 145th Way</Address1>
<Address2 />
<Suite />
<City>Scottsdale</City>
<State>AZ</State>
<Zip>85259</Zip>
<Country>United States</Country>
<ResidenceType>1</ResidenceType>
<Phone>602-490-0243</Phone>
<Email>[email protected]</Email>
<PaymentMethodLastUsed>CREDITCARD</PaymentMethodLastUsed>
<CardType />
<CardName>Robert Anderson</CardName>
<CardExpirationMonth />
<CardExpirationYear />
<eCheckBankABACode />
<eCheckBankAccountNumber />
<eCheckBankAccountType />
<eCheckBankName />
<eCheckBankAccountName>Robert Anderson</eCheckBankAccountName>
<PONumber />
<Deleted>0</Deleted>
AspDotNetStorefront WSI (BETA)
29 of 70
<CreatedOn>2007-02-25T19:45:31.287</CreatedOn>
<CardStartDate />
<CardIssueNumber />
<Crypt>1</Crypt>
</Address>
<Address>
<AddressID>4</AddressID>
<AddressGUID>8B5435D4-3A58-4D73-85E6-1FB03898CECC</AddressGUID>
<CustomerID>11111</CustomerID>
<NickName />
<FirstName>Robert</FirstName>
<LastName>Anderson</LastName>
<Company />
<Address1>13105 N 145th Way</Address1>
<Address2 />
<Suite />
<City>Scottsdale</City>
<State>AZ</State>
<Zip>85259</Zip>
<Country>United States</Country>
<ResidenceType>1</ResidenceType>
<Phone>602-490-0243</Phone>
<Email>[email protected]</Email>
<PaymentMethodLastUsed />
<CardType />
<CardName>Robert Anderson</CardName>
<CardExpirationMonth />
<CardExpirationYear />
<eCheckBankABACode />
<eCheckBankAccountNumber />
<eCheckBankAccountType />
<eCheckBankName />
<eCheckBankAccountName>Robert Anderson</eCheckBankAccountName>
<PONumber />
<Deleted>0</Deleted>
<CreatedOn>2007-02-25T19:45:31.317</CreatedOn>
<CardStartDate />
<CardIssueNumber />
<Crypt>1</Crypt>
</Address>
</Customer>
</Get>
</AspDotNetStorefrontImportResult>
Using XmlPackages allows you to add almost any type of processing to the WSI without
recoding it. For example, suppose you wanted a condensed “output” from this same
query that just returned Email addresses. You could write a QuickCustomer.xml.config
XmlPackage, this must live in the /admin/XmlPackages dir on your site, and then invoke
it to format the results.
<AspDotNetStorefrontImport Verbose="false">
<Get Table="Customer" Name="Get1">
<XmlPackage>QuickCustomer.xml.config</XmlPackage>
AspDotNetStorefront WSI (BETA)
30 of 70
<Criteria CustomerID=”11111”/>
</Get>
</AspDotNetStorefrontImport>
Might return this:
<?xml version="1.0" encoding="utf-8"?>
<AspDotNetStorefrontImportResult Version="" DateTime="3/4/2007 10:49:46 AM">
<Get Table="Customer" Name="Get1" XmlPackage="DumpCustomer.xml.config"
IDColumn="CustomerID" DefaultWhereClause="CustomerID &gt; 0" OrderBy="">
<Criteria />
<Customer>
<CustomerID>11111</CustomerID>
<CustomerGUID>B9672B60-311C-42B5-BB12-8D3B6AF81814</CustomerGUID>
<CustomerLevelID>0</CustomerLevelID>
<EMail>[email protected]</EMail>
<FirstName>Robert</FirstName>
<LastName>Anderson</LastName>
</Customer>
</Get>
</AspDotNetStorefrontImportResult>
You therefore have complete control using XmlPackages to process and setup output
data.
2.3.
Updating Customer Data Example
Let’s suppose you want to update a customer’s data, you could issue a Set against the
Customer like (just for example) the one below to update their Email address:
<AspDotNetStorefrontImport Verbose="false">
<Set Table="Customer" ID="11111">
<Notes>Hi There</Notes>
</Set>
</AspDotNetStorefrontImport>
This might result in:
<?xml version="1.0" encoding="utf-8"?>
<AspDotNetStorefrontImportResult Version="" DateTime="3/4/2007 11:36:16 AM">
<Set Table="Customer" ID="58639" GUID="" Name="Set1">
</Set>
</AspDotNetStorefrontImportResult>
You just updated the Notes field for CustomerID 11111. Almost any other field of the
Customer, or Address table could be updated this way also.
2.4.
Updating Product Prices
Let’s suppose you want to update the pricing for products that are already in the db. You
could issue a transaction like:
<AspDotNetStorefrontImport Verbose="false">
AspDotNetStorefront WSI (BETA)
31 of 70
<Transaction>
<Product Action="Update" ID="1">
<Variants>
<Variant Action="Update" ID="143">
<Price>99.99</Price>
</Variant>
</Variants>
</Product>
<Product Action="Update" ID="2">
<Variants>
<Variant Action="Update" ID="430">
<Price>14.44</Price>
<SalePrice>10.44</SalePrice>
</Variant>
</Variants>
</Product>
<Product Action="Update" ID="3">
<Variants>
<Variant Action="Update" ID="33">
<Price>4.35</Price>
</Variant>
</Variants>
</Product>
<Product Action="Update" ID="4">
<Variants>
<Variant Action="Update" ID="79">
<Price>88.88</Price>
</Variant>
</Variants>
</Product>
</Transaction>
</AspDotNetStorefrontImport>
This might result in:
<?xml version="1.0" encoding="utf-8"?>
<AspDotNetStorefrontImportResult Version="" DateTime="3/4/2007 11:40:43 AM">
<Transaction Name="Transaction1">
<Item NodeType="Product" Name="" GUID="" ID="1" ActionTaken="Update"
Status="OK" Message="" />
<Item NodeType="Variant" Name="" GUID="" ID="143" ActionTaken="Update"
Status="OK" Message="" />
<Item NodeType="Product" Name="" GUID="" ID="2" ActionTaken="Update"
Status="OK" Message="" />
<Item NodeType="Variant" Name="" GUID="" ID="430" ActionTaken="Update"
Status="OK" Message="" />
<Item NodeType="Product" Name="" GUID="" ID="3" ActionTaken="Update"
Status="OK" Message="" />
<Item NodeType="Variant" Name="" GUID="" ID="33" ActionTaken="Update"
Status="OK" Message="" />
<Item NodeType="Product" Name="" GUID="" ID="4" ActionTaken="Update"
Status="OK" Message="" />
AspDotNetStorefront WSI (BETA)
32 of 70
<Item NodeType="Variant" Name="" GUID="" ID="79" ActionTaken="Update"
Status="OK" Message="" />
<Commit />
</Transaction>
</AspDotNetStorefrontImportResult>
You can obtain the ID values from prior WSI calls or prior WSI “imports”. You could also
use a GUID here as the key, if you assigned your own GUID to products & variants that
were prior added via WSI. Note that we also did this as a Transaction. They either all
commit or rollback.
2.5.
Sample Test Program
We have provided a simple asp.net WSI test program that you can use to send WSI calls
to your storefront and receive responses back. The test program can be downloaded
from:
http://www.aspdotnetstorefront.com/download/WSITestProgram.zip (77KB)
The interface is pretty simple, but effective for exercising the WSI calls to your
storefront, so you can easily see the results:
At the top, you can enter these values:
AspDotNetStorefront WSI (BETA)
33 of 70







WSI URL: enter the URL to your web service ipx.asmx file
Select whether to use WSE3 Username token authentication or not. If you select
to use this (STRONGLY RECOMMENDED), you must have WSE3 installed on client
and server, and you must use the RAW HASHED BINARY value as the password
value from the database. You have to get this value from your SQL server
database customer record for the admin user you are connecting.
Enter the Admin user email and password
If you are NOT using WSE3 authentication, enter the CLEAR TEXT password for
the admin user. It will be hashed on the WSI side of the call and then compared.
Enter the input Xml doc you want to send to the WSI on the top box
Click GO
The results are shown in the bottom box
NOTE: When using WSE3 Authenticated invocation of WSI from your client
program, you MUST use the SuperAdmin Email and HASHED Password from the
master AspDotNetStorefront database!!! You cannot put the password in clear
text in the client! It MUST MUST MUST be the hashed raw value from the
storefront database!!! If you are using the NON WSE3 invocation, you use the
CLEAR TEXT password for the admin user!
2.6.
Sample .net Client Code
Excerpted from our Test Client tool, here is the code to invoke the WSI from the client.
Use this as a sample starting point. The sample shows both WSE3 and non WSE3
invocations. The lines in blue show the actual WSI invocation. The rest is just test
scaffolding from the windows client application to show input/output.
using
using
using
using
using
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Text;
System.Xml;
System.IO;
System.Windows.Forms;
Microsoft.Web.Services3;
Microsoft.Web.Services3.Design;
Microsoft.Web.Services3.Security;
Microsoft.Web.Services3.Security.Tokens;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
bool keyHandled = false;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
OutputXml.Text = "working...";
AspDotNetStorefront WSI (BETA)
34 of 70
OutputXml.Refresh();
String Result = String.Empty;
if (InputXml.Text.Trim().Length == 0)
{
OutputXml.Text = "Nothing to do!";
}
else
{
if (UseWSE3.Checked)
{
UsernameToken token = new UsernameToken(EMail.Text,
Password.Text, PasswordOption.SendHashed);
WSI.AspDotNetStorefrontImportWebServiceWse svc = new
WSI.AspDotNetStorefrontImportWebServiceWse();
svc.Url = WSIURL.Text;
//svc.SetPolicy("UserNameToken");
//svc.SetClientCredential(token);
svc.RequestSoapContext.Security.Tokens.Add(token);
Result = svc.DoItWSE3(InputXml.Text.Trim());
}
else
{
WSI.AspDotNetStorefrontImportWebService svc = new
WSI.AspDotNetStorefrontImportWebService();
svc.Url = WSIURL.Text;
Result = svc.DoItUsernamePwd(EMail.Text, Password.Text,
InputXml.Text.Trim());
}
OutputXml.Text = PrettyPrintXml(Result);
}
}
catch (Exception ex)
{
if (UseWSE3.Checked && !ShowRawErrors.Checked &&
ex.Message.ToLowerInvariant().IndexOf("the computed password digest doesn't match
that of the incoming username token") != -1)
{
OutputXml.Text = "Authentication Failure. Probably an invalid
Password specified? When using WSE3, you must enter here the master hashed password
from the AspDotNetStorefront database (do not use the clear text password)";
}
else if (UseWSE3.Checked && !ShowRawErrors.Checked &&
ex.Message.ToLowerInvariant().IndexOf("the incoming username token contains a
password hash") != -1)
{
OutputXml.Text = "Authentication Failure. Probably an invalid
E-Mail specified?";
}
else
{
OutputXml.Text = ex.Message;
}
}
}
public static String PrettyPrintXml(String Xml)
{
String Result = Xml;
if (Xml.Length != 0)
{
try
{
// Load the XmlDocument with the Xml.
AspDotNetStorefront WSI (BETA)
35 of 70
XmlDocument D = new XmlDocument();
D.LoadXml(Xml);
MemoryStream MS = new MemoryStream();
XmlTextWriter W = new XmlTextWriter(MS, Encoding.Unicode);
W.Formatting = Formatting.Indented;
// Write the Xml into a formatting XmlTextWriter
D.WriteContentTo(W);
W.Flush();
MS.Flush();
// Have to rewind the MemoryStream in order to read
// its contents.
MS.Position = 0;
// Read MemoryStream contents into a StreamReader.
StreamReader SR = new StreamReader(MS);
// Extract the text from the StreamReader.
String FormattedXml = SR.ReadToEnd();
Result = FormattedXml;
try
{
MS.Close();
MS = null;
W.Close();
W = null;
}
catch { }
}
catch { }
}
return Result;
}
private void InputXml_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e)
{
keyHandled = false;
if (e.Control && e.KeyCode == Keys.A)
{
((TextBox)sender).SelectAll();
((TextBox)sender).Focus();
keyHandled = true;
}
}
private void InputXml_KeyPress(object sender,
System.Windows.Forms.KeyPressEventArgs e)
{
if (keyHandled)
{
e.Handled = true;
}
}
private void OutputXml_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e)
{
AspDotNetStorefront WSI (BETA)
36 of 70
keyHandled = false;
if (e.Control && e.KeyCode == Keys.A)
{
((TextBox)sender).SelectAll();
((TextBox)sender).Focus();
keyHandled = true;
}
}
private void OutputXml_KeyPress(object sender,
System.Windows.Forms.KeyPressEventArgs e)
{
if (keyHandled)
{
e.Handled = true;
}
}
}
}
AspDotNetStorefront WSI (BETA)
37 of 70
3. WSI Element Nodes
This section documents all supported WSI element nodes, along with descriptions and
samples. The entire XmlDocument sent to the WSI must be included in this type of
structure:
<AspDotNetStorefrontImport Version="7.1" SetImportFlag="true|false"
AutoLazyAdd="true|false" AutoCleanup="true|false" Verbose="true|false">
… execution nodes go here…
</AspDotNetStorefrontImport>
General notes for the supported node actions are documented here:

Add: Add data to the database. Any ID field passed into this operation will be
ignored. You can pass in a GUID that we will use when we create the new record
in the database. All Adds then return “our” ID that was auto generated by the
database. You can then correlate your GUID to our ID, for later passing into
update, delete, or nuke operations. You must pass a valid .net GUID into the
GUID. If you do not pass in any ID or GUID, we will auto assign both ID and GUID
and return them in the output results.

Update: Update data in the database. All update actions MUST have either the
node ID or GUID passed in. Without one of those key fields, the update would fail.
On update actions, if you want to reset a field to “empty string”, you should pass
an empty element (e.g. <Description></Description>). If you want to leave an
existing value in the db alone, just omit the field from your Xml (e.g. if you do not
have a <Description></Description> field on your update, that field will remain
unchanged in the db, even when other fields get updated).

Delete: Mark a record as Deleted. All delete actions MUST have either the node ID
or GUID passed in. If the table supports it, a soft-delete will be performed (e.g.
Deleted flag set to 1). If the table doesn’t support soft-delete, a Nuke will be
performed automatically.

Nuke: Physically delete the specified record. All nuke actions MUST have either
the node ID or GUID passed in.

Lookup: Lookup a record in the database, to retrieve data for it. Must have either
ID or GUID passed in.
Transactional Support is also now built into the WSI interface (and DB.cs class). To use
transactions, just embed your instruction Xml nodes inside a <Transaction> element,
e.g.:
<AspDotNetStorefrontImport Version="7.1">
<Transaction Name=”MyName”>
… execution nodes go here…
</Transaction>
</AspDotNetStorefrontImport>
The transaction will either all Commit or all Rollback. See the <Transaction> node
description below for more information.
AspDotNetStorefront WSI (BETA)
38 of 70
3.1.
<Transaction>
Description:

You can use this node to start a transaction group. All nodes in that group must
complete successfully for the transaction to commit, or they are all rolled back.
You can use any of the supported nodes (documented in this document) inside the
transaction node. When the transaction executes, the Transaction element is
echoed to the output Xml document, along with the results of each node inside
that transaction. At the end of the Transaction output node, there will either be a
final <Commit/> or <Rollback/> node which indicates the final status of the
transaction.
Each transaction can be given a name, so your output handler can associate
transaction results. If no name is given to the transaction, it will be assigned a
default name by the WSI (e.g. Transaction1, Transaction2, etc…)
Full Syntax:

<Transaction Name=”string”>
Notes:

Warnings:

Example:
<Transaction Name=”Rob1”>
… nodes here …
</Transaction>
AspDotNetStorefront WSI (BETA)
39 of 70
3.2.
<ProductType>
Description:

Full Syntax:

Notes:

Warnings:

Example:
AspDotNetStorefront WSI (BETA)
40 of 70
3.3.
<Entity>
Description:

Full Syntax:

Notes:

Warnings:

Example:
AspDotNetStorefront WSI (BETA)
41 of 70
3.4.
<Product>
Description:

Full Syntax:

Notes:

Warnings:

Example:
AspDotNetStorefront WSI (BETA)
42 of 70
3.5.
<Customer>
Description:

Full Syntax:

Notes:

Warnings:

Example:
AspDotNetStorefront WSI (BETA)
43 of 70
3.6.
<ShoppingCart>
Description:

Full Syntax:

Notes:

Warnings:

Example:
AspDotNetStorefront WSI (BETA)
44 of 70
3.7.
<Mapping>
Description:

Full Syntax:

Notes:

Warnings:

Example:
AspDotNetStorefront WSI (BETA)
45 of 70
3.8.
<ClearMappings>
Description:

Full Syntax:

Notes:

Warnings:

Example:
AspDotNetStorefront WSI (BETA)
46 of 70
3.9.
<GetGUID>
Description:

Full Syntax:

Notes:

Warnings:

Example:
AspDotNetStorefront WSI (BETA)
47 of 70
3.10.
<GetEntityHelper>
Description:

This element returns the EntityHelper in – memory state corresponding to the
Entity Axis you specify. This can be extremely handy to get a quick dump of all
Entities in tree form. The EntityHelper is also used internally by most of the
storefront code to do breadcrumbs, menu setup, tree navigation setup, etc.
Full Syntax:

<GetEntityHelper
EntityType="Manufacturer|Distributor|Category|Section|Genre|Vector"/>
Notes:

The results are in full nested tree order, where each level is ordered by
DisplayOrder,Name as specified in the database. All returned entity lists start at
the “root” of that entity.
Warnings:

If you have thousands of categories, sections, manufacturers, etc. the resulting
data document can be a bit large.
Example 1:
<AspDotNetStorefrontImport>
<GetEntityHelper EntityType="Category"/>
</AspDotNetStorefrontImport>
Example Result:
<?xml version="1.0" encoding="utf-8"?>
<AspDotNetStorefrontImportResult Version="" DateTime="3/4/2007 7:29:48
PM">
<GetEntityHelper EntityType="Category">
<root>
<Entity>
<EntityID>24</EntityID>
<Name>Books</Name>
<ColWidth>4</ColWidth>
<Description />
<SEKeywords />
<SEDescription />
<SETitle />
<SENoScript />
<SEAltText />
<ParentEntityID>0</ParentEntityID>
<DisplayOrder>1</DisplayOrder>
<SortByLooks>0</SortByLooks>
<XmlPackage />
AspDotNetStorefront WSI (BETA)
48 of 70
<Published>1</Published>
<SEName>books</SEName>
<ContentsBGColor />
<PageBGColor />
<GraphicsColor />
<NumObjects>3</NumObjects>
<PageSize>20</PageSize>
<QuantityDiscountID />
<SkinID>0</SkinID>
<TemplateName />
</Entity>
<Entity>
<EntityID>21</EntityID>
<Name>cat1</Name>
<ColWidth>4</ColWidth>
<Description />
<SEKeywords />
<SEDescription />
<SETitle />
<SENoScript />
<SEAltText />
<ParentEntityID>0</ParentEntityID>
<DisplayOrder>1</DisplayOrder>
<SortByLooks>0</SortByLooks>
<XmlPackage />
<Published>1</Published>
<SEName>cat1</SEName>
<ContentsBGColor />
<PageBGColor />
<GraphicsColor />
<NumObjects>0</NumObjects>
<PageSize>20</PageSize>
<QuantityDiscountID />
<SkinID>0</SkinID>
<TemplateName />
<Entity>
<EntityID>22</EntityID>
<Name>cat1-1</Name>
<ColWidth>4</ColWidth>
<Description />
<SEKeywords />
<SEDescription />
<SETitle />
<SENoScript />
<SEAltText />
<ParentEntityID>21</ParentEntityID>
<DisplayOrder>1</DisplayOrder>
<SortByLooks>0</SortByLooks>
<XmlPackage />
<Published>1</Published>
<SEName>cat1-1</SEName>
<ContentsBGColor />
<PageBGColor />
AspDotNetStorefront WSI (BETA)
49 of 70
<GraphicsColor />
<NumObjects>0</NumObjects>
<PageSize>20</PageSize>
<QuantityDiscountID />
<SkinID>0</SkinID>
<TemplateName />
<Entity>
<EntityID>23</EntityID>
<Name>cat-1-1-1</Name>
<ColWidth>4</ColWidth>
<Description />
<SEKeywords />
<SEDescription />
<SETitle />
<SENoScript />
<SEAltText />
<ParentEntityID>22</ParentEntityID>
<DisplayOrder>1</DisplayOrder>
<SortByLooks>0</SortByLooks>
<XmlPackage />
<Published>1</Published>
<SEName>cat-1-1-1</SEName>
<ContentsBGColor />
<PageBGColor />
<GraphicsColor />
<NumObjects>2</NumObjects>
<PageSize>20</PageSize>
<QuantityDiscountID />
<SkinID>0</SkinID>
<TemplateName />
</Entity>
<Entity>
<EntityID>25</EntityID>
<Name>cat-1-1-2</Name>
<ColWidth>4</ColWidth>
<Description />
<SEKeywords />
<SEDescription />
<SETitle />
<SENoScript />
<SEAltText />
<ParentEntityID>22</ParentEntityID>
<DisplayOrder>1</DisplayOrder>
<SortByLooks>0</SortByLooks>
<XmlPackage />
<Published>1</Published>
<SEName>cat-1-1-2</SEName>
<ContentsBGColor />
<PageBGColor />
<GraphicsColor />
<NumObjects>1</NumObjects>
<PageSize>20</PageSize>
<QuantityDiscountID />
AspDotNetStorefront WSI (BETA)
50 of 70
<SkinID>0</SkinID>
<TemplateName />
</Entity>
</Entity>
</Entity>
<Entity>
<EntityID>26</EntityID>
<Name>Category 1</Name>
<ColWidth>4</ColWidth>
<Description />
<SEKeywords />
<SEDescription />
<SETitle />
<SENoScript />
<SEAltText />
<ParentEntityID>0</ParentEntityID>
<DisplayOrder>1</DisplayOrder>
<SortByLooks>0</SortByLooks>
<XmlPackage />
<Published>1</Published>
<SEName>category-1</SEName>
<ContentsBGColor />
<PageBGColor />
<GraphicsColor />
<NumObjects>1</NumObjects>
<PageSize>20</PageSize>
<QuantityDiscountID />
<SkinID>0</SkinID>
<TemplateName />
</Entity>
<Entity>
<EntityID>3</EntityID>
<Name>Golf</Name>
<ColWidth>4</ColWidth>
<Description />
<SEKeywords />
<SEDescription />
<SETitle />
<SENoScript />
<SEAltText />
<ParentEntityID>0</ParentEntityID>
<DisplayOrder>1</DisplayOrder>
<SortByLooks>0</SortByLooks>
<XmlPackage />
<Published>1</Published>
<SEName>golf</SEName>
<ContentsBGColor />
<PageBGColor />
<GraphicsColor />
<NumObjects>1</NumObjects>
<PageSize>20</PageSize>
<QuantityDiscountID />
<SkinID>0</SkinID>
AspDotNetStorefront WSI (BETA)
51 of 70
<TemplateName />
</Entity>
<Entity>
<EntityID>2</EntityID>
<Name>PWS Items</Name>
<ColWidth>4</ColWidth>
<Description />
<SEKeywords />
<SEDescription />
<SETitle />
<SENoScript />
<SEAltText />
<ParentEntityID>0</ParentEntityID>
<DisplayOrder>1</DisplayOrder>
<SortByLooks>0</SortByLooks>
<XmlPackage />
<Published>1</Published>
<SEName>pws-items</SEName>
<ContentsBGColor />
<PageBGColor />
<GraphicsColor />
<NumObjects>2</NumObjects>
<PageSize>20</PageSize>
<QuantityDiscountID />
<SkinID>0</SkinID>
<TemplateName />
</Entity>
<Entity>
<EntityID>15</EntityID>
<Name>Random Items</Name>
<ColWidth>4</ColWidth>
<Description />
<SEKeywords />
<SEDescription />
<SETitle />
<SENoScript />
<SEAltText />
<ParentEntityID>0</ParentEntityID>
<DisplayOrder>1</DisplayOrder>
<SortByLooks>0</SortByLooks>
<XmlPackage />
<Published>1</Published>
<SEName>random-items</SEName>
<ContentsBGColor />
<PageBGColor />
<GraphicsColor />
<NumObjects>1</NumObjects>
<PageSize>20</PageSize>
<QuantityDiscountID />
<SkinID>0</SkinID>
<TemplateName />
</Entity>
<Entity>
AspDotNetStorefront WSI (BETA)
52 of 70
<EntityID>1</EntityID>
<Name>Test Cat</Name>
<ColWidth>4</ColWidth>
<Description />
<SEKeywords />
<SEDescription />
<SETitle />
<SENoScript />
<SEAltText />
<ParentEntityID>0</ParentEntityID>
<DisplayOrder>1</DisplayOrder>
<SortByLooks>0</SortByLooks>
<XmlPackage>entity.grid.xml.config</XmlPackage>
<Published>1</Published>
<SEName>test-cat</SEName>
<ContentsBGColor />
<PageBGColor />
<GraphicsColor />
<NumObjects>9</NumObjects>
<PageSize>20</PageSize>
<QuantityDiscountID />
<SkinID>0</SkinID>
<TemplateName>testcat.ascx</TemplateName>
</Entity>
</root>
</GetEntityHelper>
</AspDotNetStorefrontImportResult>
AspDotNetStorefront WSI (BETA)
53 of 70
3.11.
<GetEntity>
Description:

Full Syntax:

Notes:

Warnings:

Example:
AspDotNetStorefront WSI (BETA)
54 of 70
3.12.
<GetProduct>
Description:

Full Syntax:

Notes:

Warnings:

Example:
AspDotNetStorefront WSI (BETA)
55 of 70
3.13.
<GetMappings>
Description:

Full Syntax:

Notes:

Warnings:

Example:
AspDotNetStorefront WSI (BETA)
56 of 70
3.14.
<AppConfig>
Description:

Full Syntax:

Notes:

Warnings:

Example:
AspDotNetStorefront WSI (BETA)
57 of 70
3.15.
<ResetCache>
Description:

If this node is in your input document, it will do the same action as the “Reset
Cache” link does in the admin site, when clicked manually. This will reload all
cached Entity Helpers, etc. You can issue this node to force the storefront to
update after you have added categories, manufacturers, products, etc prior in the
input document. Calling this action too often will degrade storefront performance.
You should call this AT MOST once per input document, typically at the end.
Full Syntax:

<ResetCache Confirm=”true”/>
The Confirm flag MUST be present, and set to true, or the ResetCache node will
be ignored
Notes:

This element CANNOT be inside a <Transaction>.
Example:
<AspDotNetStorefrontImport>
… nodes here to add products, add categories, etc…
… more nodes here to do more things …
<ResetCache Confirm=”true”/>
</AspDotNetStorefrontImport>
AspDotNetStorefront WSI (BETA)
58 of 70
3.16.
<Get>
Description:

Get elements are extremely powerful, multi-purpose data retrieval nodes, that
can get data out of the storefront in various forms, using various means, even
using Custom output formatting (via XmlPackages). The Get also preserves ID
and GUID semantic identity checking and resolution for you.
Get can retrieve MULTIPLE rows of data if you need.
Full Syntax:

<Get Table="string" Name="string">
<IDColumn>string</IDColumn>
<XmlPackage RuntimeParams="x=1&y=2">packagename</XmlPackage>
<DefaultWhereClause>IsNew=1</DefaultWhereClause>
<OrderBy>DisplayOrder, Name</OrderBy>
<Criteria Field1="value" Field2="value" Field3="value"... />
</Get>

Table = The table over which this element is “getting”.

Name = The name of this get, so your automation can find the results in the WSI
output Xml Document

IDColumn = optionally force control of the identity column name used for ID
matching. This is almost never needed, as the WSI can determine this for you.

XmlPackage = The XmlPackage you want to use to process each “row” of the
result. You do not have to use an XmlPackage, in which case the result set rows
are returned as straight Xml. Using an XmlPackage allows server side processing
to occur to format the data (e.g. in the case of orders, the XmlPackage can
decrypt the credit card numbers, before the data is returned, etc).

RuntimeParams = Any runtime params that you may need to pass to the
XmlPackage, so it can receive additional instructions/parameters on how to
process the result row(s).

DefaultWhereClause = Any default where clause, to constrain the resulting
matched rows. You may also use Criteria to do this. Note that this must be in SQL
Server syntax (e.g. use single quote to delimit strings, etc).

OrderBy = Specifies the ordering of the result set.

Criteria = Specifies as many fields as you need, with matching values, that can be
used to build an “anded” together SQL constraint on the matching data that is to
be returned.
Notes:
AspDotNetStorefront WSI (BETA)
59 of 70

Use higher level abstraction WSI elements if provided, over the <Get> element.
Use Get when you need direct easy access.

You can retrieve multiple fields at one time.
Warnings:

This is an extremely powerful command element. Use it when you know exactly
what you are doing!
Example 1:
This example returns all “New” orders, and uses the DumpOrder XmlPackage to
format each order as it’s returned. Multiple orders can be returned. The
XmlPackage fires on “each” row in the result set to do formatting and processing.
We are also passing in a RunTime param to tell the XmlPackage additional
instructions.
<AspDotNetStorefrontImport Verbose="true">
<Get Table="Orders" Name="Get1">
<XmlPackage
RuntimeParams="ShowCardNumber=true">DumpOrder.xml.config</XmlPackage>
<OrderBy>OrderNumber desc</OrderBy>
<Criteria IsNew="1" />
</Get>
</AspDotNetStorefrontImport>
Example 2:
This example retrieves the Customer information for Customer with e-mail
address ‘[email protected]’. Again, an XmlPackage is used to
process each result row.
<AspDotNetStorefrontImport Verbose="true">
<Get Table="Customer" Name="Get1">
<XmlPackage>DumpCustomer.xml.config</XmlPackage>
<DefaultWhereClause />
<OrderBy>CustomerID asc</OrderBy>
<Criteria Email=”[email protected]" />
</Get>
</AspDotNetStorefrontImport>
Example 3:
This example retrieves the Customer information for Customer 14, not using any
XmlPackage.
<AspDotNetStorefrontImport Verbose="true">
<Get Table="Customer" Name="Get1">
<Criteria CustomerID="15" />
</Get>
</AspDotNetStorefrontImport>
Example 4:
AspDotNetStorefront WSI (BETA)
60 of 70
This example retrieves the Customer information for all customers from affiliate
13 who have the OkToEMail flag set to true.
<AspDotNetStorefrontImport Verbose="true">
<Get Table="Customer" Name="Get1">
<Criteria AffiliateID=”13” OkToEMail=”1” />
</Get>
</AspDotNetStorefrontImport>
Example 5:
This example retrieves all customers for Affiliate 13 who have Notes fields which
are not null and e-mail addresses from domain “@pdq.com”.
<AspDotNetStorefrontImport Verbose="true">
<Get Table="Customer" Name="Get1">
<Criteria AffiliateID=”13” />
<DefaultWhereClause>(Notes IS NOT NULL and Notes <> ‘’) and Email lke
‘%@pdq.com’</DefaultWhereClause>
</Get>
</AspDotNetStorefrontImport>
AspDotNetStorefront WSI (BETA)
61 of 70
3.17.
<Set>
Description:

This element can be used to selectively update fields in almost any table, keying
off of ID identity value or GUID uniqueidentifier value. If provided, a higher level
abstraction element should be used instead over <Set> (e.g. <Product>). Set
provides quick access to do simple updates. The Set also preserves ID and GUID
semantic identity checking and resolution for you.
The Set can only affect “one” record at a time with matching ID or GUID.
Full Syntax:

<Set Table="string" ID="integer" GUID="uniqueidentifier" IDColumn="string"
GUIDColumn="string">
<Field1>value</Field1>
<Field2>value</Field2>
</Set>

Table = table name that you are setting values in

ID = integer primary key identity of the record you are affecting

GUID = uniqueidentifier of the record you are affecting.

One of ID or GUID MUST be specified!

IDColumn = optionally force control of the identity column name used for ID
matching. This is almost never needed, as the WSI can determine this for you.

GUIDCOlumn = optionally force control of the GUID column name used for GUID
matching. This is almost never needed, as the WSI can determine this for you.
Notes:

Use higher level abstraction WSI elements if provided, over the <Set> element.
Use Set when you need direct easy access.

ONLY the listed fields are updated in the table. All other fields remain unchanged

You can update multiple fields at one time.
Warnings:

This is an extremely powerful command element. Use it when you know exactly
what you are doing!
Example 1:
Update a Product Name using <Set> syntax:
AspDotNetStorefront WSI (BETA)
62 of 70
<AspDotNetStorefrontImport>
<Set Table=”Product” ID=”14”>
<Name>Lion King Updated Name</Name>
</Set>
</AspDotNetStorefrontImport>
Example 2:
Update a Order record with shipping tracking information using <Set> syntax.
Note that the WSI AUTOMATICALLY (!) knows that the “ID” identity column for an
order is “OrderNumber” and sets that for you during execution. You always just
use ID on the WSI input Xml doc (or GUID).
<AspDotNetStorefrontImport>
<Set Table=”Orders” ID=”100003>
<ShippedOn>3/4/2007</ShippedOn>
<ShippedVia>FedEx</ShippedVia>
<ShippingTrackingNumber>12345</ShippingTrackingNumber>
</Set>
</AspDotNetStorefrontImport>
AspDotNetStorefront WSI (BETA)
63 of 70
3.18.
<XmlPackage>
Description:

This element allows you to invoke any XmlPackage that resides on the storefront,
and also optionally pass in any runtime parameters to you dynamically on WSI
execution.
Full Syntax:

<XmlPackage Name="string"
RuntimeParams="pararm1=value1&param2=value2&param3=value3"
OutputType="INLINE|CDATA"/>

Name = The name of the XmlPackage you are going to run.

RuntimeParams = Any valid XmlPackage runtime params you want to set on the
execution of the XmlPackage.

OutputType = If inline, the output results are nested inside the InnerXml area of
this node in the WSI output Xml document. If CDATA, WSI will create a CDATA
section inside the WSI output Xml document. This allows you to return almost any
kind of data from the XmlPackage.
Notes:

The XmlPackage must already exist on the storefront site, in one of the supported
XmlPackage directories (usually /XmlPackages)
Warnings:

This is an extremely powerful command element. Use it when you know exactly
what you are doing!
Example 1:
This example runs the skin.helloworld.xml.config, which responds with a simple
greeting based on who is logged into the site:
<AspDotNetStorefrontImport>
<XmlPackage Name=" skin.helloworld.xml.config" OutputType="CDATA"/>
</AspDotNetStorefrontImport>
Returns:
<?xml version="1.0" encoding="utf-8"?>
<AspDotNetStorefrontImportResult Version="" DateTime="3/4/2007 7:25:07
PM">
<XmlPackage Name="skin.helloworld.xml.config"><![CDATA[<b>Hello
World</b>]]></XmlPackage>
</AspDotNetStorefrontImportResult>
AspDotNetStorefront WSI (BETA)
64 of 70
3.19.
<Query>
Description:

This element can be used to execute almost any arbitrary query (or stored
procedure) against the storefront database, and get resulting data returned from
the WSI in the output Xml Document. If you need to execute action queries, use
the <ExecuteSQL> element instead.

This element may be useful if you are trying to execute a query or inquiry of the
storefront database that just isn’t possible using other WSI element nodes.
Full Syntax:

<Query Name="string" RowName="string">
<SQL>
<![CDATA[
select * from whatever where whatever
]]>
</SQL>
</Query>

Name can be any valid name you want to assign to the Query, so you can
reference output results returned from the WSI in the output Xml document.

RowName can be any valid name, the results, for multiple rows returned, are
returned in that node name
Notes:

MAKE sure you know what your SQL is doing, and test before using on a
production environment.

You can execute stored procedures in your SQL also. ANY valid SQL commands
should be able to be executed in the CDATA section.

You do not have to use a CDATA section, but it’s usually much easier to write your
SQL if you do, as you don’t have to worry about escaping any characters that
affect Xml document markup (e.g. the “<” character, etc)

You can also use “for xml”, “for xml auto”, and “for xml auto,elements” SQL
qualifiers also. Again, test out the SQL first in SQL Enterprise Mgr or Sql Server
2005 Management Studio before running it through the WSI.
Warnings:

This is an extremely powerful command element. Use it when you know exactly
what you are doing!
Example 1:
AspDotNetStorefront WSI (BETA)
65 of 70
This query will return all orders for AffiliateID 10 that are in the database which
are in a CAPTURED transaction state, that were created in 2007.
<Query Name="Query493" RowName="row">
<SQL>
<![CDATA[
select OrderNumber from Orders where TransactionState=’CAPTURED’ and
CapturedOn IS NOT NULL and AffiliateID=10 where year(OrderDate)=2007
]]>
</SQL>
</Query>
Example 2:
This query will return all tax rates for all states by tax class.
<Query Name="TaxRates" RowName="row ">
<SQL>
<![CDATA[
select State.StateID, StateTaxRate.TaxClassID, TaxRate, State.Name,
State.Abbreviation, TaxClass.Name as TaxClassName
FROM
StateTaxRate INNER JOIN
State ON StateTaxRate.StateID = State.StateID INNER JOIN
TaxClass ON StateTaxRate.TaxClassID = TaxClass.TaxClassID
]]>
</SQL>
</Query>
Example 3:
This query will return all affiliates defined in the storefront.
<Query Name="Affiliates" RowName="row">
<SQL>
<![CDATA[
select * from Affiliate
]]>
</SQL>
</Query>
AspDotNetStorefront WSI (BETA)
66 of 70
3.20.
<ExecuteSQL>
Description:

This node can execute almost any arbitrary SQL statement against your
AspDotNetStorefront database. You may need this action when you have to
perform mass updates of products, and the only efficient way to do it is with
direct SQL statements.
For example, suppose you wanted to set EVERY product in your storefront to be
on sale, at 10% discount from MSRP. If you have 10,000 products in your db, you
could setup a WSI document that has 10,000 <Product> update action nodes in
it, or you could just execute this mass update via SQL. Using the SQL option will
be thousands of times faster and more efficient.
These SQL statements are usually “execute” command type SQL instructions. Use
the <Query> element if you are running Query SQL statements which you need to
return Xml data from.
Full Syntax:

<ExecuteSQL Name="string">
<SQL>
<![CDATA[
update whatever set whateverfield=whatevervalue where whatever clause you
want
]]>
</SQL>
</ExecuteSQL>

Name can be any valid name you want to assign to the SQL execution, so you can
reference output status returned from the WSI in the output Xml document.
Notes:

MAKE sure you know what your SQL is doing, and test it on a development server
first before applying to production. There is NO undo of this. You MAY be able to
undo the effects of the command by putting it inside a <Transaction> element,
but even then, since the nature of the SQL you can execute here is almost
unlimited, you must know what you are doing.

You can execute stored procedures in your SQL also. ANY valid SQL commands
should be able to be executed in the CDATA section.

You do not have to use a CDATA section, but it’s usually much easier to write your
SQL if you do, as you don’t have to worry about escaping any characters that
affect Xml document markup (e.g. the “<” character, etc)
Warnings:
AspDotNetStorefront WSI (BETA)
67 of 70

This is an extremely powerful command element. Use it when you know exactly
what you are doing!
Example 1:
This example sets the SalePrice of all products to be MSRP – 10%:
<ExecuteSQL Name="SetSale10PercentOff">
<SQL>
<![CDATA[
update ProductVariant set SalePrice=(Price*0.90)
]]>
</SQL>
</ExecuteSQL>
Example 2:
This example sets the (simple) Inventory of all products in Category 14 to 0:
<ExecuteSQL Name="ClearInventory">
<SQL>
<![CDATA[
update ProductVariant set Inventory=0 where ProductID in (select ProductID from
PrdouctCategory where CategoryID=14)
]]>
</SQL>
</ExecuteSQL>
Example 3:
This example sets all products in Category 1 to unpublished state:
<ExecuteSQL>
<SQL>
<![CDATA[
update Product set Published=0 where ProductID in (select ProductID from
PrdouctCategory where CategoryID=1)
]]>
</SQL>
</ExecuteSQL>
AspDotNetStorefront WSI (BETA)
68 of 70
4. WSI Notes
4.1.
Performance Notes
The WSI is NOT designed to do massive imports of thousands of products in one call. It is
more suitably designed for incremental sets/gets of data to/from the
AspDotNetStorefront database. Transactions can be used to rollback an entire set of adds
or updates on error.
4.2.
Excel Bulk Product Importer
The Excel bulk importer now also uses the WSI internally to process the file.
4.3.
Caching Notes
As the WSI executes and processes instructional nodes, it does this directly at the SQL
level, bypassing all “application layer” objects in AspDotNetStorefront. Therefore, after
executing WSI adds, updates, deletes, etc…you may need to reset the cache on the
storefront to ensure that the latest data is now in effect. There is a ResetCache
processing node element in the WSI that you can include in your Xml import document
that can also do this automatically.
4.4.
Node Processing
WSI processes nodes in the ORDER THEY APPEAR in your input XmlDocument!
4.5.
Security
DO NOT LEAVE THE ipx.asmx page unsecured on your site if you are not using it. Follow
all security guidelines documented herein!
Delete the file if you are not using the WSI interface!
If you are using the WSI interface, rename the ipx.asmx page to something less obvious
and unique for your own site (e.g. mywsi4334abc.asmx, or whatever you want).
Always run the WSI over HTTPS protocol in production.
Change your passwords regularly according to our v7.0 PABP best practices manual
guide.
AspDotNetStorefront WSI (BETA)
69 of 70
5. WSI Event Notification Callbacks
On exciting new feature is the ability to have the storefront call YOUR web service, when
certain events happen in the storefront.
We will be adding the ability for you to register your own web service event listener,
which the storefront will call back when various events occur (e.g. new order created,
etc). You can then use this web service to respond to new events that occur in the
storefront.
You can then call the WSI data interface from your web service to get/update data in the
storefront.
Usage of this event callback service will require the use of SQL Server 2005. SQL Server
2005 will also be required for v7.1 and subsequent AspDotNetStorefront releases.
More information to follow on this feature shortly…
AspDotNetStorefront WSI (BETA)
70 of 70