cancel
Showing results for 
Search instead for 
Did you mean: 

How to check for Web Srvice Timeout in ABAP Proxy call

Former Member
0 Kudos

I am calling a web service in my ABAP program using ABAP proxy. The code is as under:

TRY.

y_v_request-mt_request-yaskkey = y_l_matnr.

y_v_request-mt_request-maktx = y_l_maktx.

y_v_request-mt_request-ymtart = y_l_mtart.

CALL METHOD y_v_prxy->execute_synchronous

EXPORTING

output = y_v_request

IMPORTING

input = y_v_response.

CATCH cx_ai_system_fault INTO y_v_fault.

y_v_message = y_v_fault->errortext.

ENDTRY.

y_l_ycod = y_v_response-mt_response-answer.

1. Is there is any way to know that the called web service has timed out ?

2. Is it possible to check for the time spent in the call if it is more then say 500 sec then it should be considered as timeout?

Any help will be appreciated.

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

udo_martens
Active Contributor
0 Kudos

Hi Subbu,

you can catch CX_AI_SYSTEM_FAULT.


  DATA:   lo_sys_exception  TYPE REF TO cx_ai_system_fault,
l_error_text type string.
CALL METHOD ...
CATCH cx_ai_system_fault INTO lo_sys_exception.
l_error_text = lo_sys_exception->errortext.

You can configure XI timeout parameter (for shure in SMICM / Parameter and, if i remeber right, as profile parameter in XI administration).

Regards,

Udo

Message was edited by: Udo Martens

Former Member
0 Kudos

Hi Udo,

Thanks for the prompt response. Is it possible to get the time spent in the web service call in my ABAP program in ECC.

I need a check in my program where call to the web service will be abandoned if it takes more then a certain time.

udo_martens
Active Contributor
0 Kudos

Hi Subbu,

you can ask for sy-uzeit before and after the call...

Regards,

Udo

Answers (1)

Answers (1)

adam_krawczyk1
Contributor
0 Kudos

If you expose WebService through SOAMANAGER configuration, there is a setting under "Transport Settings" - "Maximum Wait for WS Consumer".

This is the maximum waiting time in seconds we accept to wait. A useful configuration if we do not want to make program hanging for a long time.

Regards,
Adam