Hello,
I've been trying to implement a sample consumer of OData content (using the sample Northwind services) , however, i've run into a peculiar issue with the ODataModel constructor itself.
It would seem that the constructor function for sap.ui.model.odata.ODataModel is sending a "OPTIONS" request type, which is not supported by the consumer.
<!DOCTYPE html>
<html><head>
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
<title>test</title>
<script id='sap-ui-bootstrap' type='text/javascript'
src='/sapui5/resources/sap-ui-core.js'
data-sap-ui-theme='sap_goldreflection'
data-sap-ui-libs='sap.ui.commons,sap.ui.ux3'></script>
<!-- add 'sap.ui.table' and/or other libraries if required -->
<script>
var oModel = new sap.ui.model.odata.ODataModel("http://services.odata.org/v3/odata/odata.svc");
</script>
</head>
<body class='sapUiBody'>
<div id='content'></div>
</body>
</html>
The above code returns a HTTP Error Code 501. Because it is sending a OPTIONS request to http://services.odata.org/v3/odata/odata.svc
I have tried to inittialize the OData model withouth any URL, the call the read function, however, the constructor throws an error "Uncaught TypeError: Cannot call method 'indexOf' of null"
Of course i can use the $format=json flag to retrieve data via an AJAX request, but i should be able to use the regular library.
Please let me know if there is any way of circumventing this request type, I don't see any in the documentation.
Regards, Rafael.