cancel
Showing results for 
Search instead for 
Did you mean: 

How to call Business Rules Service in XSJS on SAP Cloud Platform

Hi All,

I am trying to call Business Rules service in XSJS app but I am getting the below error.

"HttpClient.request: request failed: unable to establish connection to XXX - IPcon: connection to host XXX failed!"

As I was doing a service to service call, I used port 8443. I have tried other port options also but no luck.

I am using the below code to call the service

var dest = $.net.http.readDestination(destination_package, destination_name); var client = new $.net.http.Client(); var req = new $.web.WebRequest($.net.http.GET, "/rules-service/v1/rules/xsrf-token"); req.headers.set("X-CSRF-Token", "Fetch"); req.headers.set("Accept" , "application/json"); client.request(req, dest); //This line throws the exception var response = client.getResponse();

It would be grateful if someone can help.

Regards,
Sruti

Accepted Solutions (0)

Answers (0)