Skip to Content

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

Calling a web service via HTTPS

Dear all,

I wrote an ABAP program to call a web service in order to send SMS messages. The program takes the 3 following steps to make the request and get the response.

1 - First I create an http client using the following method passing as parameters the URL and the proxy_host used.

CALL METHOD cl_http_client=>create_by_url

EXPORTING

url = ws_url

proxy_host = my_proxy

IMPORTING

client = http_client.

2 - Then I use the following method to send the request

CALL METHOD http_client->send

EXCEPTIONS

http_communication_failure = 1

http_invalid_state = 2.

3 - And finally I try to get the response with the following method

CALL METHOD http_client->receive

EXCEPTIONS

http_communication_failure = 1

http_invalid_state = 2

http_processing_failed = 3.

However, the receive method returns an http_communication_failure.

Here, I must mention that the protocol used is HTTPS that does not use the default port 443 but another port specified by the provider of the service. That is, the url is like the following: HTTPS://xxx-yyyy:5678/.........

(I used transaction strust to import the provider's certificate. Do I have to do something else as well?)

Does anyone know how to call a web service over HTTPS using the 3 steps I mentioned above

Note: When I call another web service over a simple HTTP protocol then I can send my request and receive a response without any problem.

Looking forward to your answer,

Best regards

George

Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question