6.0.0.2 Delete order items
This service deletes an order item in shopping cart. The client has a reference to the order facade client.
Usage scenario
- The client calls the order facade client method deleteOrderItem() with the following parameters: (orderId, orderItemId).
- OrderFacadeClient composes an SDO and calls the ChangeOrder service using the action code Update and XPath query /Order/OrderItem.
- The order item is updated in the WebSphere Commerce Server.
- The Order component responds with a RespondOrder BOD with an order ID that indicates that the deletion is successful.
Request
Request ChangeOrder business object document (BOD). Schema
Order-DataObjects/xsd/OAGIS/9.0/Overlays/IBM/Commerce/BODs/ChangeOrder.xsdService data object
com.ibm.commerce.order.facade.datatypes.ChangeOrderType
Sample request 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:ChangeOrder 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:18:07.359Z </oa:CreationDateTime> <oa:BODID> e55b5330-ad2e-11db-832d-831645b86890 </oa:BODID> </oa:ApplicationArea> <_ord:DataArea> <oa:Change> <oa:ActionCriteria> <oa:ActionExpression actionCode="Update" expressionLanguage="wc:XPath"> /Order/OrderItem </oa:ActionExpression> </oa:ActionCriteria> </oa:Change> <_ord:Order> <_ord:OrderIdentifier> <_wcf:UniqueID>.</_wcf:UniqueID> </_ord:OrderIdentifier> <_ord:OrderItem> <_ord:OrderItemIdentifier> <_wcf:UniqueID>540328</_wcf:UniqueID> </_ord:OrderItemIdentifier> <_ord:Quantity>0.0</_ord:Quantity> </_ord:OrderItem> <_ord:OrderItem> <_ord:OrderItemIdentifier> <_wcf:UniqueID>540327</_wcf:UniqueID> </_ord:OrderItemIdentifier> <_ord:Quantity>0.0</_ord:Quantity> </_ord:OrderItem> </_ord:Order> </_ord:DataArea> </_ord:ChangeOrder> </soapenv:Body> </soapenv:Envelope>
Response
The response is a RespondOrder BOD with an order ID, and the order item has been deleted.
Response BOD RespondOrder Schema Order-DataObjects/xsd/OAGIS/9.0/Overlays/IBM/Commerce/BODs/RespondOrder.xsd Service data object
com.ibm.commerce.order.facade.datatypes.RespondOrderTypeThe response contains the following information:
/Order/OrderIdentifier/UniqueID
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:RespondOrder xmlns:_ord="http://www.ibm.com/xmlns/prod/commerce/9/order" xmlns:_wcf="http://www.ibm.com/xmlns/prod/commerce/9/foundation"> <_ord:DataArea> <_ord:Order> <_ord:OrderIdentifier> <_wcf:UniqueID>43137</_wcf:UniqueID> </_ord:OrderIdentifier> </_ord:Order> </_ord:DataArea> </_ord:RespondOrder> </soapenv:Body> </soapenv:Envelope>
Exceptions
If there is something wrong with the parameter, the Order component fails to add the orderitems. The Order component responds with the RespondOrder BOD with ChangeStatus, which indicates that the deletion has failed.
The exception conditions are the same as for
OrderItemUpdate URL.
Customization
The following extensions are supported:
- Extend the method buildOrderItem of OrderFacadeClient to handle the input parameters.
- Extend the command RespondOrderBuildCmdImpl to populate information into the response.
- Customize the messaging mapping file ChangeOrderSOIBODMapping.xml by finding the section:
<Command CommandName="com.ibm.commerce.orderitems.commands.OrderItemUpdateCmd" Condition='actionCode="Update" AND actionExpression="/Order/OrderItem"'> <Constant Field="URL">NoURL</Constant> <Constant Field="ReUrl">NoReURL</Constant> <Constant Field="calculateOrder">1</Constant> <Constant Field="calculationUsageId">-1</Constant> <Constant FieldInfo='CONTROL' Field='flattenMessageClass'> com.ibm.commerce.messaging.programadapter.messagemapper.ecsax.ECSAXOrderMessageFlattener </Constant> <Constant FieldInfo='CONTROL' Field='responseCommand'> com.ibm.commerce.order.facade.server.commands.RespondOrderBuildCmdImpl </Constant> <Constant FieldInfo='CONTROL' Field='errorCommand'> com.ibm.commerce.order.facade.server.commands.RespondOrderErrorBuildCmdImpl </Constant> </Command>Replace the RespondOrderBuildCmdImpl with the new command that extends RespondOrderBuildCmdImpl.
Related concepts
Service Data Objects (SDO)
Related Reference
WebSphere Commerce services
Order services