on 10-12-2017 8:33 AM
Step 1: create XS project in HANA Studio
Step 2: copy SAP WEB-IDE sapui5 code(web-content folder) to project.
Step 3: make AJAX POST call as per below
var jData = JSON.stringify({UserName: "manager", Password: "1234", CompanyDB: "XXXX"});
var t;
$.ajax({
// the URL for the request
<strong> url: "<a href="https://192.168.1.156:50000/b1s/v1/Login">https://<Public server IP>:50000/b1s/v1/Login</a>",</strong>
// the data to send (will be converted to a query string)
data: jData,
// whether this is a POST or GET request
type: "POST",
async:false,
//headers: { 'Access-Control-Allow-Origin:': '*' },
// the type of data we expect back
//dataType: "jsonp",
//dataType : "text",
// code to run if the request succeeds;
// the response is passed to the function
success: AjaxSucceeded,
// code to run if the request fails; the raw request and
// status codes are passed to the function
error: AjaxFailed
});
function AjaxSucceeded(result) {
alert("hello"+result);
alert(result.d);
}
function AjaxFailed( XMLHttpRequest, status, errorThrown ) {
$('#connectedError').modal('show');
console.log( "Error: " + errorThrown );
console.log( "Status: " + status );
console.dir( XMLHttpRequest );
}
Step 4: Publish code to HANA XS engine by right click to HANA studio project and inside team --> publish
Step5 : Access project in browser from below URL.
https://<HANA IP>:4300/<project Name>/WebContent/index.html
Step6 : showing error in consoleattachment1.png. But in Network tab its showing 200 ok .Attachment 2.attachment2.png
So AJAX request success function won't call and because of that I unable to get session ID for login request
Did you set
https://blogs.sap.com/2015/07/15/how-to-consume-service-layer-odata-services-from-net-via-wcf/
. Best regards,Duncan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.