Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to ensure idempotency of requests to SAP?


Hi All

We need to submit Sales Orders to SAP BYD over the SOAP web services interface. If there is a communication failure we can safely retry, however if there is a socket timeout, we need to know how we can replay the same request again, without SAP BYD creating a duplicate sales order for it.

I have gone through the documentation and there is a "UUID" which we can optionally pass into a request. However this is not adequate to prevent a duplicate order from being created. There is also a "BuyerID" described as an "External Reference ID" - However neither of these provide what we would desire.

Our expected result is that on a resubmission of the same SOAP web service request, SAP BYD should reply/ignore a duplicate message it has successfully received/processed having the same UUID / BuyerID?

I appreciate if someone could point me to the relevant information that could help me achieve what we expect

thanks

asankha

Former Member
replied

Hi Asankha,

ByD synchonous writing web services support transparent retries (idem potency) in case of lost server responses caused by bad network connections. Using idem potency is optional. If the Web service consumer fills the UUID element of the BasicMessageHeader message element, the server returns the cached response if the same UUID is received within a short time period. This allows the consumer to perform multiple retries in case the original response did not reach the consumer in time. The maximum time span a consumer performs retries should not exceed some minutes. Responses for requests with a filled UUID are cached for 2-4 hours. Reusing the same UUID after this period is not allowed and results in a fault message response.

Example:

<BasicMessageHeader>

      <UUID>f81d4fae-7dec-1d0-a765-00a0c91e6bf6</UUID>

</BasicMessageHeader>

Beyond idem potency you can avoid creating duplicates by providing the corresponding key elements and using action code "01 - create". Using action code 01 the system returns an error message if a business object with the same key already exists.

Best regards,

Knut

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question