cancel
Showing results for 
Search instead for 
Did you mean: 

how 2 call an API that contains 'HTTPS://' ?

Former Member
0 Kudos

hi,

How to call an API from ABAP that have scheme of 'HTTPS' and not 'HTTP'???

pls light me on this.

thanks.

gaurav.

Accepted Solutions (0)

Answers (1)

Answers (1)

athavanraja
Active Contributor
0 Kudos

we need more info. The info is not clear.

My understanding is that you want to call a https url get the data returned from ABAP

is it right?

REgards

Raja

Former Member
0 Kudos

i have 2 call a https url through ABAP , pass some parameters along with it, and finally get the response .

gaurav

athavanraja
Active Contributor
0 Kudos

first of all you need to obtain the certificate of that particular site and import it into the ABAP environment (transaction STRUSTSSO2).

then you can use class cl_http_client to call the url and get the data back.

the call would be something like below.

call method cl_http_client=>create

exporting

host = 'www.domain.com'

service = '80'

scheme = '2' " 1 http 2 https

importing

client = http_client.

call method http_client->request->set_header_field

exporting

name = '~request_method'

value = 'POST'.

call method http_client->send

exceptions

http_communication_failure = 1

http_invalid_state = 2.

call method http_client->receive

exceptions

http_communication_failure = 1

http_invalid_state = 2

http_processing_failed = 3.

wf_string1 = http_client->response->get_cdata( ).

Hope this is clear.

Regards

Raja

This question should have been posted in ABAP forum

Former Member
0 Kudos

Thank u

athavanraja
Active Contributor
0 Kudos

if the question is answered, can you mark it as answered.

Regards

Raja

Former Member
0 Kudos

i tried doin it, but after importing ,it is not showing the certificate in 'VSTRUSTCERT'.

and i think it should also come in SSL Client Certificate in SM59.

are there any Basis settings which needs to be performed??

Pls help!!!

gaurav.

athavanraja
Active Contributor
0 Kudos

check out the following two weblogs

(these are for consuming webservies from ABAP but section of the weblog describes about loading certificate)

/people/thomas.jung3/blog/2005/05/13/calling-webservices-from-abap-via-https

/people/thomas.jung3/blog/2004/11/17/bsp-a-developers-journal-part-xiv--consuming-webservices-with-abap

Regards

Raja