cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

HTTP Request failed error in Netweaver Gateway using HTML5

Former Member
0 Likes
1,945

Hi All,

This is the error i'm getting when i tried in the browser. I was trying to access the index.html page created.

The Odata service has one parameter. Kindly help me with this issue.

Chrome Stats using F12

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

What also might be the issue, I see you are using Chrome. When your OData service is on your server, and your front end code is on your localhost (you have to use a localhost if you are going to develop locally on your computer first), then you have to open chrome in a different mode.

Close all your open chrome windows. Create a shortcut on your desktop, right click and choose 'properties' At the 'target', add --disable-web-security.

Open your shortcut, chrome will give you a warning but you can ignore that. By default chrome blocks cross origin requests and this causes issues when you want to call your service from your localhost. By opening chrome with the web security disable, you can make cross origin requests.

Answers (2)

Answers (2)

Former Member
0 Likes

Have you tried something like this:

DATA : http_client TYPE REF TO IF_HTTP_CLIENT.

CALL METHOD http_client->request->set_header_field

  EXPORTING

    name  = 'Access-Control-Allow-Origin'

    value = '*'.

Former Member
0 Likes

HI Karthik,

Did you test odata service in gateway client.

Former Member
0 Likes

Hi Ravi,

Ya using Tcode    /IWFND/GW_CLIENT    i tested the odata service its working fine. But im not able to consume in the browser.

Former Member
0 Likes

when you click on response in browser it is opening in xml page or not ?

Former Member
0 Likes

Hi Ravi,

Its opening the XMl i think the error is with Cross Origin not enabled in Gateway Server.?? Can you help me regarding this. Please find the attachment . It is showing null. Can you make this one true

Former Member
0 Likes

please see below post it may helpful

http://scn.sap.com/thread/1947809

Former Member
0 Likes

Hi Ravi,

Sry it didnt helped us.