on 11-11-2019 10:20 AM
Hi,
I am calling a rest web service created in SAP PO, from a UI5 app created in NWDS.
The code is as follows:
$.ajax({ url: "http://<server>:<port>/RESTAdapter/checkvendorexistence?vendornumber=<value>?anycode=value",
type: "GET",
crossDomain: true,
//data: JSON.stringify(data),
contentType: "application/json; charset=utf-8",
dataType: "jsonp",
success: function (response) {
var resp = JSON.parse(response);
alert(resp.status);
},
error: function (xhr, status) {
alert("error"); } });
In chrome, I am getting status 200 OK, and in SAP PO monitoring, I am getting the request and response. But the alert i get is of error function. Where am I going wrong?
Any guidance would be useful.
Thanks
no matter it is odata or not,
any ajax call has to conform to that rule
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ram and Jun, thanks for the comments.
I am using Eclipse NWDS for development, and its on premise. I am sending request from localhost to SAP server on premise.
Its not odata service, I am using Rest API published in SAP PI/PO.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you cannot make it, if your ui5 app and the odata service are not in the same server.
you need web dispatcher to help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.