Steve Kirk
Microsoft Developer Network
August 1999
The Duwamish Books, Phase 4 Workflow API exposes COM and HTTP interfaces to provide Workflow services that support clients on diverse platforms. The Workflow API is implemented as a COM component, and as Active Server Pages (ASP) script.
The Duwamish Books, Phase 4 Workflow Layer (WFL) component is a COM component written in Microsoft® Visual Basic® that provides an XML wrapper around the Business Logic Layer (BLL) component API.
Server-side ASP scripts use the ASP object model, WFL component, cache component, the XML Document Object Model (XML DOM), and XSL style sheets to implement Workflow methods.
Duwamish Books, Phase 4 Workflow requires the following:
The Workflow Layer (WFL) component wraps the Business Logic Layer (BLL) API with an XML interface. The following methods are implemented.
Returns an XML search results list of Authors for SearchText.
<Search Type="SearchAuthor" SearchText="SearchText">
<Author PKId="0" Authorname=""/>
…
</Search>
Returns an XML representation of a Category for CategoryId. If CategoryId is not supplied or if CategoryId < 1, the root category specified by the RootCategory setting in the database Settings table is returned. If specified category is not found, an empty string is returned.
<CategoryChunk>
<Category PKId="0" ParentId="0" Description="" IsLeaf="False" />
<ParentCategory PKId="0" ParentId="0" Description="" IsLeaf="False" />
<SubCategory PKId="0" ParentId="0" Description="" IsLeaf= False />
…
<Item PKId="0" SortOrder="0" ItemTypeId="0" PublisherId="0" SupplierId="0" PublicationYear="" ISBN="" ImageFileSpec="" Title="" Description="" UnitPrice="0.00" UnitCost="0.00" KeywordList="" ItemType="" IsBook="False" AuthorList=" " PublisherName="" SupplierName=""/>
…
</CategoryChunk>
Returns an XML representation of Customer for Alias.
<Customer PKId="0" Alias="" Password="" CustomerName="" Email="" Address="" Country="" PhoneNumber="" Fax="" LastSale="01/01/1980" TotalSaleYTD="0.00"/>
Returns an XML representation of Item for ISBN.
<Search Type="SearchISBN" SearchText="ISBN">
<Item PKId="0" ItemTypeId="0" PublisherId="0" SupplierId="0" PublicationYear="" ISBN="" ImageFileSpec="" Title="" Description="" UnitPrice="0.00" UnitCost="0.00" KeywordList="" ItemType=" " IsBook="False" AuthorList="" PublisherName="" SupplierName=""/>
</Search>
Returns an XML representation of Item for ItemId.
<Item PKId="0" ItemTypeId="0" PublisherId="0" SupplierId="0" PublicationYear="" ISBN="" ImageFileSpec=" " Title=" " Description="" UnitPrice="0.00" UnitCost="0.00" KeywordList="" ItemType="" IsBook="False" AuthorList="" PublisherName="" SupplierName="" AlsoPurchasedList=""/>
Returns an XML search results list of Items for AuthorKeywordList.
<Search Type="SearchAuthorKeyword" SearchText="AuthorKeywordList">
<Item PKId="0" MatchLevel="0" ItemTypeId="0" PublisherId="0" SupplierId="0" PublicationYear="" ISBN="" ImageFileSpec="" Title="" Description="" UnitPrice="0.00" UnitCost="0.00" KeywordList="" ItemType="" IsBook="False" AuthorList="" PublisherName="" SupplierName=""/>
…
</Search>
Returns an XML list of Items for ItemIdList.
<Items>
<Item PKId="0" ItemTypeId="0" PublisherId="0" SupplierId="0" PublicationYear="" ISBN="" ImageFileSpec="" Title="" Description="" UnitPrice="0.00" UnitCost="0.00" KeywordList="" ItemType="" IsBook="False" AuthorList="" PublisherName="" SupplierName=""/>
…
</Items>
Returns an XML search results list of Items for SearchText.
<Search Type="SearchNaturalLanguage" SearchText="SearchText">
<Restated>SearchTextRestated</Restated>
<Item PKId="0" ItemTypeId="0" PublisherId="0" SupplierId="0" PublicationYear="" ISBN="" ImageFileSpec="" Title="" Description="" UnitPrice="0.00" UnitCost="0.00" KeywordList="" ItemType="" IsBook="False" AuthorList="" PublisherName="" SupplierName=""/>
...
</Search>
Returns an XML search results list of Items for SubjectKeywordList.
<Search Type="SearchSubjectKeyword" SearchText=" SubjectKeywordList">
<Item PKId="0" MatchLevel="" ItemTypeId="0" PublisherId="0" SupplierId="0" PublicationYear="" ISBN="" ImageFileSpec="" Title="" Description="" UnitPrice="0.00" UnitCost="0.00" KeywordList="" ItemType="" IsBook="False" AuthorList="" PublisherName="" SupplierName=""/>
…
</Search>
Returns an XML search results list of Items for Title.
<Search Type="SearchTitle" SearchText="Title">
<Item PKId="0" ItemTypeId="0" PublisherId="0" SupplierId="0" PublicationYear="" ISBN="" ImageFileSpec="" Title="" Description="" UnitPrice="0.00" UnitCost="0.00" KeywordList="" ItemType="" IsBook="False" AuthorList="" PublisherName="" SupplierName=""/>
</Search>
Returns an XML search results list of Items for TitleKeywordList.
<Search Type="SearchTitleKeyword" SearchText=" TitleKeywordList">
<Item PKId="0" MatchLevel="0" ItemTypeId="0" PublisherId="0" SupplierId="0" PublicationYear="" ISBN="" ImageFileSpec="" Title="" Description="" UnitPrice="0.00" UnitCost="0.00" KeywordList="" ItemType="" IsBook="False" AuthorList="" PublisherName="" SupplierName=""/>
</Search>
If supplied alias is unique, GetNewAccount returns an XML representation of a new Customer account for Alias. Returns empty string if Alias is already in use.
<Customer PKId="0" Alias="" Password="" CustomerName="" Email="" Address="" Country="" PhoneNumber="" Fax="" LastSale="01/01/1980" TotalSaleYTD="0.00"/>
Returns an XML list of Orders for CustomerId.
<Search Type="SearchCustomerOrders" SearchText="CustomerId">
<Order PKId="0" CustomerId="0" EmployeeId="0" StoreId="0" OrderDate="1/1/1980" SubTotal="0.00" Tax="0.00" PaymentType="" CreditCardNumber="" ExpirationDate="" NameOnCard="" ApprovalCode="" Ship="True" OrderType="0" OrderStatus="0" ShippingHandling="0.00" ShipToName="" Address="" Country="" PhoneNumber="" Fax=""/>
…
</Search>
Returns an XML payment request to pass to payment service for XMLSaleContext.
XMLSaleContext is an XML representation of a sale prepared for InsertSale as follows:
<Sale HasCustomer="True" HasItems="True" HasPayment="False" HasShipping="True" HasSummary="True" >
<Customer PKId="0" Alias="" Password="" CustomerName="" Email="" Address="" Country="" PhoneNumber="" Fax="" LastSale="" TotalSaleYTD="0.00"/>
<Shipping Address="" ChkAddress="" />
<Summary SubTotal="0.00" Tax="0.00" Shipping="0.00" Total="0.00" />
<ShoppingCart>
<Item ItemId="0" Title="" UnitPrice="0.00" Qty="0"/>
…
</ShoppingCart>
</Sale>
GetPayReq returns an XML representation of a payment authorization request to be passed to payment services object. The payment authorization request is similar to the following XML:
<PaymentAuthorizationRequest MerchantId="" TransactionId="0" TransactionAmount="0.00" TransactionCurrency=""/>"
Returns an XML representation of a Sale for TrackingId.
<Sale PKId="0" CustomerId="0" EmployeeId="0" StoreId="0" OrderDate="1/1/1980" SubTotal="0.00" Tax="0.00" PaymentType="" CreditCardNumber="" ExpirationDate="" NameOnCard="" ApprovalCode="" Ship="True" OrderType="0" OrderStatus="0" ShippingHandling="0.00" ShipToName="" Address="" Country="" PhoneNumber="" Fax="">
<Detail PKId="0" OrderId="0" ItemId="0" UnitPrice="0.00" Quantity="0" Qty_Shipped="0" Notes=""/>
…
</Sale>
Returns data for SessionId and Alias wrapped in an XML representation of a session.
Replaces data for SessionId and Alias with contents of Session parameter if Session parameter <> "".
Creates a new contextual session in the back-end database and returns the SessionId if supplied SessionId and Alias do not match an already establishes contextual
<Session PKId="SessionId" Alias="Alias" />
Session Data
…
</Session>
Returns an XML results list of all system Settings. If Code is supplied, GetSettings returns Setting for Code.
<Settings>
<Setting Code="Code" Value="" Description=""/>
…
</Settings>
Inserts Sale for data in XMLWorkingSale. Returns TrackingId.
XMLWorkingSale is an XML representation of a sale prepared for InsertSale as follows:
<Sale HasCustomer="True" HasItems="True" HasPayment="False" HasShipping="True" HasSummary="True" >
<Customer PKId="0" Alias="" Password="" CustomerName="" Email="" Address="" Country="" PhoneNumber="" Fax="" LastSale="" TotalSaleYTD="0.00"/>
<Shipping Address="" ChkAddress="" />
<Summary SubTotal="0.00" Tax="0.00" Shipping="0.00" Total="0.00" />
<ShoppingCart>
<Item ItemId="0" Title="" UnitPrice="0.00" Qty="0"/>
…
</ShoppingCart>
</Sale>
Returns:
<Sale PKId="0" Amount="0.00"/>
Returns an XML representation of Customer for Alias and password.
<Customer PKId="0" Alias="Alias" Password="Password" CustomerName="" Email="" Address="" Country="" PhoneNumber="" Fax="" LastSale="1/1/1980" TotalSaleYTD="0.00"/>
Optional ByVal Password, _
Optional ByVal CustomerName, _
Optional ByVal Address, _
Optional ByVal Country, _
Optional ByVal PhoneNumber, _
Optional ByVal Fax, _
Optional ByVal Email)
Updates customer and returns an XML representation of Customer for PKId.
<Customer PKId="0" Alias="" Password="" CustomerName="" Email="" Address="" Country="" PhoneNumber="" Fax="" LastSale="1/1/1980" TotalSaleYTD=""/>
Returns true on success and updates Sale ApprovalCode for PkId.
Methods are listed by logical name along with implementation specifics.
Returns advanced search results for SearchType and SearchText.
SearchType="SearchAuthor" calls WFL Component GetAuthors(SearchText)
SearchType="SearchISBN" calls WFL Component GetItemByItemISBN (SearchText)
SearchType="SearchNaturalLanguage" calls WFL Component GetItemsByNaturalLanguage (SearchText)
SearchType="SearchAuthorKeyword" calls WFL Component GetItemsByAuthorKeywords (SearchText)
SearchType="SearchSubjectKeyword" calls WFL Component GetItemsBySubjectKeywords (SearchText)
SearchType="SearchTitleKeyword" calls WFL Component GetItemsByTitleKeywords (SearchText)
SearchType="SearchTitle" calls WFL Component GetItemsByTitle(SearchText)
|
|
|
Returns category list chunk for CategoryId.
|
|
|
Returns Item Detail for ItemId. Calls WFL component GetItemByItemId(ItemId).
|
|
|
Returns Order for OrderId.
|
|
|
The following methods (from \common\d4wfl1a.asp) operate on the following XML representation of a Shopping Cart:
<ShoppingCart>
<Item ItemId="0" Title="" UnitPrice="0.00" Qty="0"/>
…
</ShoppingCart>
Adds Item entity for ItemID to Shopping Cart and returns XML representation of Shopping Cart.
Increments item quantity by 1 if item is already in Shopping Cart.
Updates Shopping Cart for ItemId and Quantity and returns XML representation of Shopping Cart.
A Quantity of < 1 removes ItemId from Shopping Cart.
Comments? We welcome your feedback at duwamish@microsoft.com.