Developer forum

Forum » Integration » Cross Origin Server issue

Cross Origin Server issue

John Andersen
Reply

Hi forum

We are using DW9 to provide a JSON feed with ECOM data. The feed is made and shows the JSON as needed, however we are then trying to access this from an external website using Angular / Javascript but we are getting Cross Origin Server error.  How to avoid this?

Best regards

John 


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

You need enable CORS on your server. Depending on what you're doing and how  there are different ways to do it.Here are some useful links:

https://stackoverflow.com/questions/29970793/enabling-cors-through-web-config-vs-webapiconfig-and-controller-attributes

https://docs.microsoft.com/en-us/iis/extensions/cors-module/cors-module-configuration-reference#cors-configuration

https://stackoverflow.com/questions/6516591/how-to-implement-access-control-allow-origin-header-in-asp-net

https://www.google.com/search?ei=F56CWs9Kzt3BAvKPnsAB&q=enable+cors+asp.net&oq=enable+cors+asp.net&gs_l=psy-ab.3..0l6.909340.913180.0.913291.19.19.0.0.0.0.96.978.19.19.0....0...1.1.64.psy-ab..0.19.976...0i67k1j0i10k1.0.-f4WIMxA3nE

Hope this helps

Imar

 
John Andersen
Reply

Thanks. Will go through the different solutions and see if we can make it work.

 

You must be logged in to post in the forum