Hello Everyone,
I wanted to check if you came across the situation where you have to make a call to MII service from the server hosted on other server . I am getting the issue when a .Net developer is trying to call MII service from his local environment using Ajax call .
I tried between two MII servers and it doenst work .
Failed to load resource: No'Access-Control-Allow-Origin' header is present on the requested resource.
I saw lot of blogs on this issue but I don’t see any clear answer in case of MII – Netweaver server . Any idea of what I have to change on Netweaver to make CORS enable .
I changed the crossdomain.xml as the below note but still I see the same issue.
Here is my Sample HTML page and the Ajax Call . Still getting the same error . It works fine in IE though but Chrome is having issues .
<!DOCTYPE html>
<html ng-app="Demo">
<head>
<title>Test CORS</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv='cache-control' content='no-cache'>
<meta http-equiv='expires' content='0'>
<meta http-equiv='pragma' content='no-cache'>
<script src="script/jquery-2.1.3.js?v=0.0.5"></script>
<script src="script/angular-1.3.14.js?v=0.0.5"></script>
</head>
<body ng-controller="DemoController">
<script type="text/javascript">
$.ajax({
url: 'http://<HOSTNAME>:50000/XMII/Runner',
type: "GET",
data: {
'Content-Type': 'text/html',
'OutputParameter': 'OutputJSON',
'Transaction': 'Transactions/Test'
},
async: false,
crossDomain: true,
xhrFields: { withCredentials: true },
success: function (r) {
alert(r);
dfd.resolve(r);
},
error: function (a, b, c) { alert(b); }
});
</script>
</body>
</html>
Thanks,