2

I have a SAP Gateway system where I create OData services which I consume in a jQuery HTML5 page.

When doing the HTML page, I always used Firefox to run it. Now I want the users to test the application and SAP automatically uses IE (I have IE 10 installed).

The exact same request, send through OData.read function (datajs library), does not give me any results in IE but in Firefox it does. I reach the success callback function but there is also no result. That's anyhow for one of the services. Another service that I call simunltaneously does give me back results just like Firefox does. Strange thing is that in the success callback function the header (object) in IE is empty but when debugging with IE I do have a response header.

The way I tested was using eclipse and localhost. Firefox works, IE doesn't.

I really have no idea how to fix this and appreciate any help!

My request JS:

var request = {
    headers: {
        'DataServiceVersion': '2.0',
        'X-CSRF-Token': 'Fetch' // needed for update requests
    },
    recognizeDates: true,
    enableJsonpCallback: true,  // didn't have it for Firefox, added for IE but didn't help
    requestUri: requestURL      // URL is definatelly correct and works in the 2nd request
};
OData.read(request, successCallback, displayError);

Request headers according to Firefox:

Accept             application/atomsvc+xml;q=0.8, application/json;odata=fullmetadata;q=0.7, application/json;q=0.5, */*;q=0.1
Accept-Encoding        gzip, deflate
Accept-Language        en-gb,en;q=0.5
Cookie             SAP_SESSIONID_IED_200=FHWa0fH1IhO_B_UPFMroJmIzPRjDxhHjtXgAUFa_cwE%3d; sap-usercontext=sap-client=200
DataServiceVersion     2.0
Host               localhost:51407
MaxDataServiceVersion  3.0
Referer            http://localhost:51407/Tool/index.html
User-Agent             Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0
X-CSRF-Token       Fetch
sap-client             200

Request header according to IE

Accept                  application/atomsvc+xml;q=0.8, application/json;odata=fullmetadata;q=0.7, application/json;q=0.5, */*;q=0.1
DataServiceVersion  2.0
X-CSRF-Token            Fetch
sap-client          200
MaxDataServiceVersion   3.0
Referer                 http://localhost:51407/Tool/index.html
Accept-Language         sv-SE
Accept-Encoding         gzip, deflate
User-Agent          Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)
Host                    localhost:51407
DNT                 1
Connection          Keep-Alive
Cookie                  sap-usercontext=sap-client=200; SAP_SESSIONID_IED_200=jrJj5t5Qqs7_mTj01OyqJx3cKhbDxxHjtXgAUFa_cwE%3d

Response header in IE debugger:

Content-Type                 application/json; charset=utf-8
Content-Length               20
Response                 HTTP/1.1 200 OK
Server                       Jetty(8.1.3.v20120522)
server                       SAP NetWeaver Application Server / ABAP 731
sap-metadata-last-modified   Sun, 13 Apr 2014 12:02:23 GMT
dataserviceversion       2.0
x-csrf-token                 Yc7gWOCfweJbnQHVyp-xxx==

But the object is empty:

JS

executeRead(url, function (resData, response) {
  // trying to get x-csrf-token but the whole response.header is empty
  cCSRF = response.headers['x-csrf-token'];
  ...
}

response Object

{
 [prototype] : {...},
body : "{"d":{"results":[]}}",
data : {...},
headers : [],
requestUri : "proxy/sap/opu/odata/sap/SERVICE/EntitySet?$filter=Field eq true",
statusCode : 200,
statusText : "OK"
}
  • You can try to catch the requests and responses with Fiddler to see what is the diff between using IE and FireFox. – Tan Jinfu Apr 14 '14 at 23:45
  • possible duplicate of [encoding of query string parameters in IE10](http://stackoverflow.com/questions/18220057/encoding-of-query-string-parameters-in-ie10) – Paul Sweatte Apr 23 '14 at 19:00

0 Answers0