cancel
Showing results for 
Search instead for 
Did you mean: 

How to ensure idempotency of requests to SAP?

Former Member
0 Kudos


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

Accepted Solutions (1)

Accepted Solutions (1)

knutheusermann
Product and Topic Expert
Product and Topic Expert

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

Former Member
0 Kudos

Hi Knut

Thank you for the correct and expected solution, and this provided the exact functionality I was looking for.

I was unable to locate such general documentation on using ByD web services, on facing failures and recovery etc. Maybe I have missed to read some guide which is not easily found..I will keep looking

Thanks again,

regards

asankha

Answers (0)