For the past few days I've been trying to figure out how to get this to work. I've tried pretty much all of the examples listed in previous threads on this forum as well as the blog posts on Brock Allen's site and Matlus.com but I'm getting the same result
when I run the project to consume the service: "XMLHttpRequest cannot load http://myserviceurl. Origin http://mysiteurl is not allowed by Access-Control-Allow-Origin". My question is: Is there a way to implement this
purely in code without having to monkey with settings in IIS or having to shut off moules on the server?
I'm using Chrome to test. The link you gave me solved the issue for GET requests and POST, PUT and DELETE requests on my local IIS but on the test server I'm publishing it to I'm getting the same error for all verbs except for GET. At least it's progress.
After spending far too much time trying to get even the simplest example of this working, I decided to put a hold on implementing this for the time being. There's some IIS configuration somewhere preventing the requests from getting through. I've advised
my team to wait until it's less experimental.
xalres
Member
28 Points
15 Posts
Cross domain Web API
Dec 07, 2012 04:21 PM|LINK
For the past few days I've been trying to figure out how to get this to work. I've tried pretty much all of the examples listed in previous threads on this forum as well as the blog posts on Brock Allen's site and Matlus.com but I'm getting the same result when I run the project to consume the service: "XMLHttpRequest cannot load http://myserviceurl. Origin http://mysiteurl is not allowed by Access-Control-Allow-Origin". My question is: Is there a way to implement this purely in code without having to monkey with settings in IIS or having to shut off moules on the server?
BrockAllen
All-Star
27574 Points
4912 Posts
MVP
Re: Cross domain Web API
Dec 07, 2012 04:57 PM|LINK
Which browser are you using? Also, here are some common issues:
http://brockallen.com/2012/10/18/cors-iis-and-webdav/
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
xalres
Member
28 Points
15 Posts
Re: Cross domain Web API
Dec 07, 2012 06:11 PM|LINK
I'm using Chrome to test. The link you gave me solved the issue for GET requests and POST, PUT and DELETE requests on my local IIS but on the test server I'm publishing it to I'm getting the same error for all verbs except for GET. At least it's progress.
BrockAllen
All-Star
27574 Points
4912 Posts
MVP
Re: Cross domain Web API
Dec 07, 2012 06:27 PM|LINK
The last resort is to enable FREB in IIS and find out where the request is being handled.
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
xalres
Member
28 Points
15 Posts
Re: Cross domain Web API
Dec 17, 2012 08:25 PM|LINK
After spending far too much time trying to get even the simplest example of this working, I decided to put a hold on implementing this for the time being. There's some IIS configuration somewhere preventing the requests from getting through. I've advised my team to wait until it's less experimental.