Forum Post: RE: My rest service url's are not working in page load and any other events.

Status
Not open for further replies.
W

wood

Guest
It may help for you to explain our environment more fully. The answers to this thread are saying that this looks like a CORS issue. CORS (or Cross-Origin Resource Sharing) is a common issue (see Wikipedia ) where modern browsers have added 'security' features to prevent security intrusion attacks via web pages. The short summary is that if the 'main' page in a web app comes from one URL, then the JavaScript run on that page can't point to resources loaded from another URL (You can't unintensionally have a page at one ORIGIN getting resources CROSS-reference RESOURCES from another URL/a second "ORIGIN"). There are three ways to solve this: 1. You can disable the CORS checks in your browser, but while that may work for one client, it does not help you build a web application that anyone can use. 2. You can add a proxy (pass-through) on the application web server that takes all the requests and then on the server side calls the REST service as a server-server interaction. 3. MOST COMMONLY, you can tell the Web Server serviing up the web application to inform the browser that it is OK to go to particular known cross-origin resources. (This is what the previous post was suggesting). It would be useful to know: - where (what web server) is serving up the Web Application (the HTML and JavaScript files that compose the main app).... I am assuming that this is a Tomcat running in your PDSOE environment. - where the REST services are running (normally, for OE Services, these deploy the .paar file on the same server, but you are talking about -- I assume these are your .net REST services.

Continue reading...
 
Status
Not open for further replies.
Top