cancel
Showing results for 
Search instead for 
Did you mean: 

CORS on SAP MII

Former Member
0 Kudos

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=69765F6D6F6465...

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,

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Naresh, u meanwhile found a solution? I would also be intereset very much in knowing how to do this...

I got a SAPUI5 frontend located on a server and would like to call MII Webservice what is a different server...

Greetings, Marco

Former Member
0 Kudos

Hello Marcos,

SAP has provided additonal parameters to enable CORS in MII 14.0 SP6 .Please check .

Thanks

,Naresh