cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ASA 17.0.10: Calling an external HTTP:GET service

Stalker4
Explorer
0 Likes
497

Hi,

My procedure for calling an external HTTP:GET service:

 

CREATE PROCEDURE "dba"."WebTestRun"(in "cAccessToken" long varchar )
result( "cAttribute" long varchar,"cValue" long varchar,"npp" integer )
url 'http://OtherSite/WebTest1'
type 'HTTP:GET'
header 'Authorization: !cAccessToken'

 

 Calling this procedure:

 

select cValue from dba.WebTestRun('MyToken')
 where cAttribute = 'Body'

 

An error occurs when calling the Web service:

 

HTTP request failed. Status code '500 Internal Server Error'

 

When calling the Web Service "http://OtherSite/WebTest1" in a browser or from Postman, everything works fine. I think I am not calling 'HTTP:GET' from ASA correctly.
Calling other Web-Services from the same site, but via 'HTTP:POST' from ASA works without errors. 

Accepted Solutions (1)

Accepted Solutions (1)

PCollins
Participant

Two things I would do is set the type to HTTPS (presumably the endpoint is using https?) and also set the protocol version to 1.1 (it defaults to 1.0), like this:

CREATE PROCEDURE "dba"."WebTestRun"(in "cAccessToken" long varchar )
result( "cAttribute" long varchar,"cValue" long varchar,"npp" integer )
url 'http://OtherSite/WebTest1'
set 'HTTP(EXCEPTIONS=off; VERSION=1.1)'
type 'HTTPS:GET'
header 'Authorization: !cAccessToken'

I suspect the real winner is Version 1.1 is important if the other side is proxying the connection as it requires a Host Header, 1.0 doesn't. That said I always force type's to HTTPS when I know the server uses it.


You can more about the various options here CREATE PROCEDURE Statement [Web Service] | SAP Help Portal

Answers (0)