Skip to Content
0
Jun 20, 2018 at 08:19 PM

Connecting Service Layer from Development Workbench

134 Views

Hi,

I am trying to login to the B1 service layer using Web-based Development Workbench Editor on my on premise HANA system - see code below. The code works in the SAP Web IDE (pointing to the server using destination) but when I try to run from the Workbench Editor with the server url it fails. When I look at the POST in the Network tab the Params are blank as well as the Response.

What is the best way to connect to the service layer from Development Workbench? Is it possible to do it without going through XS?

Also why does $.ajax send the parameters from the SAP Web IDE but not the workbench.


Thanks,

Mel

var surl = this.serviceLayerUrl + "Login";
loginInfo = {"UserName":"manager", "Password":"manager","CompanyDB":"SBODEMOUS"};
$.ajax({
type: "POST",
url: surl,
xhrFields: {
withCredentials: true
},
data: JSON.stringify(loginInfo),
error: function(xhr, status, error) {
oLabelLogin.setText("Login Failed");
}
}