WebSphere Commerce services error information

When an exception occurs during the processing of a message, the OAGIS convention is to return a well-formed response message, with the error data embedded. The ChangeStatus element is used to store exception data; if the request was completed successfully, this area is not populated. Because only one action per message is supported, there can be only one error per message. For this reason the limitation of one ChangeStatus area per message is reasonable.

Within the response criteria, the ResponseExpression indicates the actionCode of the request and the ChangeStatus element contains exception information if the request fails. The following is a mapping of exception and the ChangeStatus.

Code

Error code for the specific exception encountered (if application exception) or the generic error code (if system exception)

Description

Locale-specific exception detail text

EffectiveDateTime

Time when processing failed

ReasonCode

Exception GUID (for correlation)

Reason

Generic exception string, for example "An Application Exception has occurred."

The following example shows a Respond error message:

<?xml version="1.0" encoding="UTF-8"?>
<member:RespondCustomer releaseID=""
       
xmlns:member="http://www.ibm.com/xmlns/prod/commerce/member"
        xmlns:oa="http://www.openapplications.org/oagis/9"
       
xmlns:wc="http://www.ibm.com/xmlns/prod/commerce/foundation"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       
xsi:schemaLocation="http://www.ibm.com/xmlns/prod/commerce/member
../BODs/RespondCustomer.xsd
          http://www.openapplications.org/oagis/9
../../../Resources/Nouns/BOD.xsd 
          http://www.openapplications.org/oagis/9
../../../Resources/Components/Common/Meta.xsd 
          http://www.ibm.com/xmlns/prod/commerce/foundation
../Resources/Components/CommerceComponents.xsd ">

        <oa:ApplicationArea>
               
<oa:CreationDateTime>2006-05-11</oa:CreationDateTime>
                <oa:Signature qualifyingAgencyId="" />
               
<oa:BODID>b4b712b0-e0ff-11da-af1f-824744633eaa</oa:BODID>
        </oa:ApplicationArea>

        <DataArea>
                <oa:Respond>
                        <oa:ResponseCriteria>
                                <oa:ChangeStatus>
                                       
<oa:Code>ERROR_CODE</oa:Code>
                                        <oa:Description>The
distinguished name specified could not be
resolved.</oa:Description>
                                       
<oa:ReasonCode>CORRELATION_ID</oa:ReasonCode>
                                        <oa:Reason>An
application exception was encountered while processing the
request.</oa:Reason>
                                </oa:ChangeStatus>
                        </oa:ResponseCriteria>
                </oa:Respond>
        </DataArea>

</member:RespondCustomer>

The ChangeStatus area is used only for error reporting. If this area is not present in the BOD, then you know that processing has been completed successfully.

If the request fails with an error, the Noun in the DataArea should be not be present. The rationale is that a defined noun might have required fields, and the exception handling code might not have sufficient information to populate these fields properly. So it makes more sense to pass back the response without the Noun.


Related Concepts


Message mappers
Service Data Objects (SDO)
WebSphere Commerce services
WebSphere Commerce service module
Component facade interfaces
Design pattern for Get service implementation
Design patterns

Related tasks

Create the component facade


Related Reference


WebSphere Commerce services
Client library exceptions