on 2018 Jun 20 9:19 PM
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");
}
}
Request clarification before answering.
There is an example of how to it on our Github.
Check the B1SLLogic.xsjslib
Basically we replace the SAP CP destination with an xshttpdest file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 29 | |
| 14 | |
| 14 | |
| 6 | |
| 5 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.