Quantcast
Channel: SCN: Message List - SAP Manufacturing Integration and Intelligence (SAP MII)
Viewing all articles
Browse latest Browse all 4841

CORS on SAP MII

$
0
0

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.

 

https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3138333834363526

 

 

 

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,


Viewing all articles
Browse latest Browse all 4841

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>