on 2020 Sep 23 2:53 PM
Hi,
I have an interesting error which I am not sure how to solve. I am calling an API with HTTP REST Service with a GET request. If I run my program as is, I get a communication failure from CL_REST_HTTP_CLIENT-IF_REST_RESOURCE~GET. If I put a debug point on my method call, the GET request works perfectly and I get a status 200 back with a response. The only difference is that I enter debug mode, nothing else changes. Without debug, I get a communication failure, with debug, I get response 200 and everything works perfectly.
I get see the the communication failure happens in CL_REST_HTTP_CLIENT-SEND_RECEIVE when it does the CALL METHOD mo_http_client->receive. When I try to debug the method, then I don't get the communication error anymore 😞
Any suggestions? I have tried to do a commit and wait before the HTTP Get and Wait up to 10 seconds but that makes no difference.
* Create REST client instance
CREATE OBJECT lo_rest_client
EXPORTING
io_http_client = go_http_client.
"/--- Do HTTP GET Request ---/"
TRY.
lo_rest_client->if_rest_client~get( ).
CATCH cx_rest_client_exception INTO DATA(lo_exc).
lv_message = lo_exc->get_text( ).
CALL METHOD send_mail EXPORTING iv_message = lv_message.
WRITE:/ 'HTTP Connection Error: ', lv_message.
EXIT.
ENDTRY.
Kind Regards
Deon
Request clarification before answering.
BASIS increased the HTTPS timeout and it now it works. I am still not sure why the "WAIT UP TO sec SECONDS" worked but at least it is working now 🙂
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
48 | |
6 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.