Select to view content in your preferred language

GeoDesic Buffers sample code does not work in my local server

1389
5
03-18-2017 01:19 AM
EngrUmair
Deactivated User

Hi,

   I am new to use ArcGis Api for javascript, I am using JS Api 3.20.
   I have been trying for 3 days but it does not work.
   I have taken code from the following link

   Geometry Engine - Geodesic buffers | ArcGIS API for JavaScript 3.20 

   I paste this in My Html file create in VS website for .Net , and setup a local server for my page using IIS server

   I also downloaded proxy from GitHub resource-proxy/DotNet at master · Esri/resource-proxy · GitHub 

   setup it in same application in IIS

   Downloaded excel file added in my application    from https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_week.csv 

   but still I am getting the following error in console using developer mode when set Proxy URL to this

    config.defaults.io.proxyUrl = "/192.168.8.188/Proxy/proxy.ashx";

 

GET http://192.168.8.188:1555/192.168.8.188/Proxy/proxy.ashx?http://earthquake.usgs.gov/earthquakes/feed... 404 (Not Found)

 and when I set proxy url to this 

 config.defaults.io.proxyUrl = "/Proxy/";

then the following error occurs in console

GET http://192.168.8.188:1555/Proxy/?http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_week.c... 403 (Forbidden)

Could you please help me out. I would be thankful in advance.

5 Replies
RobertScheitlin__GISP
MVP Emeritus

Engr,

  Have you tested your proxy?   http://192.168.8.188:1555/Proxy/?ping

0 Kudos
EngrUmair
Deactivated User

I tried it Now, so it was throwing error of host not found

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Engr,


  So that tells you that your proxy is not setup correctly then.


  Have tested your web server on that machine to see if you have it setup correctly and serving HTML file correctly?

0 Kudos
EdwinRoa
Esri Contributor

Hi

  1. Copy the example from Geometry Engine - Geodesic buffers | ArcGIS API for JavaScript 3.20
  2. Create a Folder under WebServer.  For Example in IIS under C:\inetpub\wwwroot (In my Test the folder is C:\inetpub\wwwroot\Geodesic)
  3. Insert de code example in a file C:\inetpub\wwwroot\Geodesic\index.html
  4. Download the proxy from GitHub - Esri/resource-proxy: Proxy files for DotNet, Java and PHP. If the WebServer is IIS create a folder in wwwroot proxy (C:\inetpub\wwwroot\proxy) and put all files from /resource-proxy-master\resource-proxy-master\DotNet
  5. Test the proxy with the next URL http://localhost/proxy/proxy.ashx?ping.  The result must be the follow response: 
  6. Edit the file C:\inetpub\wwwroot\proxy\proxy.config and insert the follow statement

    <?xml version="1.0" encoding="utf-8" ?>
    <ProxyConfig allowedReferers="*"
    mustMatch="true">
    <serverUrls>
    <serverUrl url="http://services.arcgisonline.com"
    matchAll="true"/>
    <serverUrl url="http://earthquake.usgs.gov"
    matchAll="true" />
    </serverUrls>
    </ProxyConfig>

      

5. Edit the file index.html as follow statement

config.defaults.io.proxyUrl = "/proxy/proxy.ashx";

6. Test the example using the url http://localhost/Geodesic/index.html

I hope this can help you.

EngrUmair
Deactivated User

Thanks that worked,

                              I would like to show my own locations added to local csv file rather than usgs server,

                              How to do this could you please help me?

0 Kudos