Hello everyone, I recently publish my site and it was working fine until today. I got this message:
http://screencast.com/t/BdTyk4X7
Do you know what it is? How can I fix this? When I run the same code locally, it is working fine.
Thanks
Owen, I inspected element using google chrom and here is the error:
XMLHttpRequest cannot load http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geomet…43794057776715%2C%22spatialReference%22%3A%7B%22wkid%22%3A4326%7D%7D%5D%7D. The 'Access-Control-Allow-Origin' header has a value 'http://localhost:6179' that is not equal to the supplied origin. Origin 'http://example.com' is therefore not allowed access.
The message seems to refer to localhost. Where can I change that?
Ryan,
Sure here is the documentation link for starting the geometry service from Desktop on your ArcGIS Server: http://resources.arcgis.com/en/help/main/10.1/index.html#//0154000004zs000000
and this one is for doing the same using ArcGIS Server Manager:
http://resources.arcgis.com/en/help/main/10.1/index.html#/Starting_the_geometry_service_in_Manager/0154000004zq000000/
The Using the proxy | Guide | ArcGIS API for JavaScript page describes the cases in which you may require a proxy. However, having a proxy configured doesn't change the way that you create and use the geometry service in your code.
I would start by using some debugging tools to determine exactly why the request is failing. Can you post the URL to the published site?
Thanks Robert. That's what I figure. Could you share with me some articles on how I can set this up? I am new to this.
Thanks Owen for the reply. I am new to arcgis. I saw the sample code and here is how it uses the service:
geometryService = new GeometryService("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer");
I am wondering what you mean by using proxy? Does it mean I can't use the url that way? If so could you point me to the right place?
Thanks.
Another bit of advice is that esri sample servers are NOT meant to be used in production environments. You should always change to use your own servers geometry service.
Sample Services: Licensee may use these services for internal evaluation and development purposes only. All licenses for ArcGIS Online Services are subject to these terms of use and any additional restrictions or requirements identified in the Documentation
Sample Services:
Licensee may use these services for internal evaluation and development purposes only. All licenses for ArcGIS Online Services are subject to these terms of use and any additional restrictions or requirements identified in the Documentation
Hi Ryan,
You can try using Chrome Developer Tools or IE debugging to get more information about errors.
One thing with geometry services is that they often require a proxy to be configured.
Owen
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.