cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP Timeout requirement using SAP PI

Former Member
0 Kudos

Hi,

The *synchronous* scenario is as shown below

SAP CRM - ABAP Proxy -> SAP PI -- webservice-call --> External Partner

The requirement is that, SAP CRM needs to set a time-out in one of the screen incase the synchronous call takes more than 'n' seconds.

1st case: What if the web-service takes 'n' seconds to return a response

Resolution: The external partner has agreed that if the web-service takes 'n' seconds, then they would set a generic status and send a response message back to SAP PI

2nd case: What if the web service URL is not reachable. How do we achieve the time-out requirement at SAP CRM.

In this case, since this is a synchronous scenario, a auto-generated technical error message would be sent back by SAP PI to SAP CRM. Now the question is

- Will SAP CRM be able to read/parse that technical error message in their system (since it is not in the expected response format)?

- Does SAP CRM have the ability to set a time-out parameter at their end itself instead of depending on the web-service response or SAP PI's technical response?

Need you inputs in the 2nd case. And also any suggestion to achieve the requirement is welcome.

Regards,

Prajeet

Accepted Solutions (1)

Accepted Solutions (1)

Shabarish_Nair
Active Contributor
0 Kudos

Now the question is

> - Will SAP CRM be able to read/parse that technical error message in their system (since it is not in the expected response format)?

the proxy will go into a system fault/application fault.

you will need to handle this and then throw a readable message back to CRM user.

> - Does SAP CRM have the ability to set a time-out parameter at their end itself instead of depending on the web-service response or SAP PI's technical response?

>

> Need you inputs in the 2nd case. And also any suggestion to achieve the requirement is welcome.

>

> Regards,

> Prajeet

you can set a timeout at SOAP adapter. Check the SOAP FAQ OSS note for the parameter. this will again raise an exception in ABAP proxy which you should be able to handle

Answers (3)

Answers (3)

Former Member
0 Kudos

The issue was resolved. We did it in 2 steps

Step-1: A time-out parameter was set in the SOAP receiver channel in SAP PI

Parameter Name : XMBWS.Timeout

Step-2: SAP CRM system handled the standard exception message generated by SAP PI using cx_ai_system_fault class. Based on the exception text in the message, CRM proceeded with the next steps of processing

Just to give more information on the scenarios I was looking at

1st case: What if the web-service takes 'n' seconds to return a response

Resolution : Due to the time-out parameter set to 'n' seconds in the SOAP receiver channel, SAP PI would generate a standard exception message after 'n' seconds and sends it to SAP CRM.

SAP PI Standard Exception Message

<SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">

<SAP:Category>XIAdapterFramework</SAP:Category>

<SAP:Code area="MESSAGE">GENERAL</SAP:Code>

<SAP:P1 />

<SAP:P2 />

<SAP:P3 />

<SAP:P4 />

<SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException: Read timed out</SAP:AdditionalText>

<SAP:ApplicationFaultMessage namespace="" />

<SAP:Stack />

<SAP:Retry>M</SAP:Retry>

</SAP:Error>

2nd case: What if the web service URL is not reachable. How do we achieve the time-out requirement at SAP CRM.

Resolution: If the web-service is not accessible, SAP PI immediately generates the standard exception message to SAP CRM.

SAP PI Standard Exception Message

<SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">

<SAP:Category>XIAdapterFramework</SAP:Category>

<SAP:Code area="MESSAGE">GENERAL</SAP:Code>

<SAP:P1 />

<SAP:P2 />

<SAP:P3 />

<SAP:P4 />

<SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException: Message </SAP:AdditionalText>

<SAP:ApplicationFaultMessage namespace="" />

<SAP:Stack />

<SAP:Retry>M</SAP:Retry>

</SAP:Error>

Thanks for helping me. Rewarded points as well

Regards,

Prajeet

Former Member
0 Kudos

Hi Prajeet,

I am facing same problem.

I am able to retrieve node <SAP:Code area="MESSAGE">GENERAL</SAP:Code> from class

    cx_ai_system_fault

But how to retrieve node <SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException: Read timed out</SAP:AdditionalText> so that based on error we can resend the data.

naveen_chichili
Active Contributor
0 Kudos

Hi Prajeeth,

go through the note #1593920 which would help for your query.

Regards,

Naveen.

Former Member
0 Kudos

Regarding the technical response from PI, you can customize the error messages by creating a Fault Message Type. Please check the help page below.

http://help.sap.com/saphelp_nwpi71/helpdata/en/dd/b7623c6369f454e10000000a114084/content.htm

Former Member
0 Kudos

Hi Lucas,

Please help me out here.

My understanding of using fault message type is that this message has to be triggered by the receiver system, right?

But in my scenario, if the recevier URL is not reachable, then receiver would not be sending the message, in that case, how do we populate the fault message to SAP CRM?

Regards,

Prajeet