Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jaydata with .net Odata Server

I am working on jaydata as client and .net odata as server but when i request Server it gives me error of 501 not implemented and when i search out for it the issue was CORS [Cross Origion Resouse Sharing] is there any way to enable CORS on odata server or IIS ???

my code is simple just create context with service and fetch entites one solution was to put specail config section in web.config

 <httpProtocol>
     <customHeaders>
      <add name="Access-Control-Allow-Origin" value="*" />
    </customHeaders>
 </httpProtocol>

But this does not solve the issue

My Chrome View During the process

Remember i am using odata [RESTFUL] service and jaydata as client

like image 632
Numan Hanif Avatar asked Nov 05 '13 18:11

Numan Hanif


2 Answers

This is because nothing handles the OPTIONS preflight requests. You'll want to intercept them. See this question on how to do that and a few important notes.

Update: The question I linked assumes a WCF Data Services implementation. If you're using something else, you'll have to edit your question or search for implementation-specific methods yourself.

like image 143
tne Avatar answered Nov 06 '22 19:11

tne


Use chrome dev tools or firebug or fiddler to see what is happening on the wire. Which browser do you use? Old IE can not handle CORS

like image 1
Gabor Dolla Avatar answered Nov 06 '22 19:11

Gabor Dolla