Reputation: 51
I developed RESTFull Post Web Service. Test this service via Chrome Extension, all OK. Now I want to call this service from ajax or Angular JS. Exactly want angular js.
I know need to enable CROS on server side. I have practive JAX-RS 2 enable on server.
For WCF I read http://enable-cors.org/server_wcf.html forum and done step by step. Then I tested service via Chrome Extension, noticed that header are changed.
But from angular js the same error. which is disallowed for cross-origin requests that require preflight.
Do you have any IDEA?
Upvotes: 0
Views: 68
Reputation: 609
There are some manuals like
http://enable-cors.org/server_wcf.html http://blogs.msdn.com/b/carlosfigueira/archive/2012/05/15/implementing-cors-support-in-wcf.aspx
But the easiest way is to use Web API 2 instead WCF with CORS Library (easiest for developing, but you have to use .NET4.5)
http://enable-cors.org/server_aspnet.html
Upvotes: 1