6.0.0.2 Get shopping carts

This service gets shopping carts for a shopper in a specific store. Before using this service, the client has a reference to the order facade client.

 

Usage scenario

  1. The client calls the order facade client method getShoppingCarts() with the parameters: (memberId and storeId in context).

  2. OrderFacadeClient composes an SDO and then calls the GetOrder service with XPath query "/Order[OrderHeader[OrderStatus[(Status='P')]]] " and access profile WC_OrderSummaryProfile which indicates that only high-level order information is required.

  3. The Order component queries the database using the search condition from the XPath.

  4. The Order component composes the ShowOrder SDO according to the access profile.

Request

Request BOD GetOrder business object document (BOD)
Schema Order-DataObjects/xsd/OAGIS/9.0/Overlays/IBM/Commerce/BODs/GetOrder.xsd
Service data object

com.ibm.commerce.order.facade.datatypes.GetOrderType

 

Sample request

<soapenv:Envelope
        xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <soapenv:Header />
        <soapenv:Body>
                <_ord:GetOrder
                       
xmlns:_ord="http://www.ibm.com/xmlns/prod/commerce/9/order"
                       
xmlns:_wcf="http://www.ibm.com/xmlns/prod/commerce/9/foundation"
                       
xmlns:oa="http://www.openapplications.org/oagis/9"
                       
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <oa:ApplicationArea
xsi:type="_wcf:ApplicationAreaType">
                                <oa:CreationDateTime>
                                        2007-01-26T19:26:28.078Z
                                </oa:CreationDateTime>
                                <oa:BODID>
                                       
0fcefb20-ad30-11db-832d-831645b86890
                                </oa:BODID>
                        </oa:ApplicationArea>
                        <_ord:DataArea>
                                <oa:Get>
                                        <oa:Expression
expressionLanguage="wc:XPath">
                                               
{ibmwcf.ap=WC_OrderSummaryProfile}/Order[OrderStatus[(Status=P)]]
                                        </oa:Expression>
                                </oa:Get>
                        </_ord:DataArea>
                </_ord:GetOrder>
        </soapenv:Body>
</soapenv:Envelope>

 

Response

Post conditions: The response is a ShowOrder BOD containing a list of shopping carts with high-level information.

Schema Order-DataObjects/xsd/OAGIS/9.0/Overlays/IBM/Commerce/BODs/ShowOrder.xsd
Service data object

com.ibm.commerce.order.facade.datatypes.ShowOrderType

 

Sample response BOD

<soapenv:Envelope
        xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <soapenv:Header />
        <soapenv:Body>
                <_ord:ShowOrder
                       
xmlns:_ord="http://www.ibm.com/xmlns/prod/commerce/9/order"
                       
xmlns:_wcf="http://www.ibm.com/xmlns/prod/commerce/9/foundation"
                       
xmlns:oa="http://www.openapplications.org/oagis/9">
                        <_ord:DataArea>
                                <oa:Show recordSetCount="1"
recordSetStartNumber="0"
                                        recordSetTotal="1" />
                                <_ord:Order
shipAsComplete="true">
                                       
<_ord:OrderIdentifier>
                                               
<_wcf:UniqueID>43141</_wcf:UniqueID>
                                       
</_ord:OrderIdentifier>
                                       
<_ord:StoreIdentifier>
                                               
<_wcf:UniqueID>10001</_wcf:UniqueID>
                                       
</_ord:StoreIdentifier>
                                       
<_ord:BuyerIdentifier>
                                               
<_wcf:UniqueID>-1000</_wcf:UniqueID>
                                               
<_wcf:DistinguishedName>
                                                       
uid=wcsadmin,o=root organization
                                               
</_wcf:DistinguishedName>
                                       
</_ord:BuyerIdentifier>
                                        <_ord:OrderAmount>
                                                <_ord:GrandTotal
currency="USD">
                                                        149.80000
                                               
</_ord:GrandTotal>
                                               
<_ord:TotalProductPrice currency="USD">
                                                        187.25000
                                               
</_ord:TotalProductPrice>
                                               
<_ord:TotalAdjustment currency="USD">
                                                        -37.45000
                                               
</_ord:TotalAdjustment>
                                               
<_ord:Adjustment>
                                                       
<_ord:Usage>Discount</_ord:Usage>
                                                       
<_ord:Code>
                                                               
Brake Pads Category Discount
                                                       
</_ord:Code>
                                                       
<_ord:Description language="-1">
                                                               
Save 20% on all Brake Pads!
                                                       
</_ord:Description>
                                                       
<_ord:Amount currency="USD">
                                                               
-37.45000
                                                       
</_ord:Amount>
                                                       
<_ord:DisplayLevel>
                                                               
OrderItem
                                                       
</_ord:DisplayLevel>
                                               
</_ord:Adjustment>
                                               
<_ord:TotalShippingCharge currency="USD">
                                                        0.00000
                                               
</_ord:TotalShippingCharge>
                                               
<_ord:TotalSalesTax currency="USD">
                                                        0.00000
                                               
</_ord:TotalSalesTax>
                                               
<_ord:TotalShippingTax currency="USD">
                                                        0.00000
                                               
</_ord:TotalShippingTax>
                                        </_ord:OrderAmount>
                                        <_ord:OrderPaymentInfo
/>
                                        <_ord:OrderStatus
prepareIndicator="false">
                                               
<_ord:Status>P</_ord:Status>
                                        </_ord:OrderStatus>
                                        <_ord:LastUpdateDate>
                                               
2007-01-26T11:25:04.078Z
                                       
</_ord:LastUpdateDate>
                                </_ord:Order>
                        </_ord:DataArea>
                </_ord:ShowOrder>
        </soapenv:Body>
</soapenv:Envelope>

 

Exceptions

If there is something wrong with the parameter, the Order component fails to get the shopping cart. The Order component responds with a ShowOrder BOD with ChangeStatus, which indicates that the action failed.

See the exception conditions for
OrderListDataBean.

 

Customization

The following extensions are supported:

Related concepts

Service Data Objects (SDO)


Related Reference


WebSphere Commerce services
Order services