Skip to Content
0
Sep 03, 2020 at 10:38 AM

Accessing an External http service from XSJS service in SAP WEB IDE

85 Views

We are trying to call external outbound http request from our XSJS service in SAP WEB IDE, for that we have created user provided service in cockpit under the specified space and also created XSHTTPDEST destination file in Nodejs module under lib folder and included the same destination file in our XSJS .

we found a blog which does calling of external service with authentication type as none but could not find any blog which calls external service with basic authentication in SAP WEB IDE.

created user provided service in cockpit.

  • Added created user provided service in mta.yml file under resource with type as org.cloudfoundry.existing-service
  • Under Parameters added key value pair service-name : EXTERNAL_HTTP
  • Under Properties added key value pair EXTERNAL_HTTP_SERVICE: ${service-name}
  • Added EXTERNAL_HTTP resource in Nodejs module.
  • Created xshttpdest file in Nodejs module under lib folder
  • included destination file in xsjs .
  • When we run XSJS service, we are getting error: no auth mechanism defined

we are getting this error since we have not provided any credentials for basic authentication tried giving credentials in user provided service and also in xsjs code but it didn't work.

Attachments

lg59q.png (47.5 kB)
znoch.png (24.5 kB)
4j8i9.png (35.9 kB)
n8reh.png (19.5 kB)
q5tge.png (120.7 kB)