Setting up a proxy for use with esri.utils

Discussion created by Underscore on Mar 7, 2013
I am not a great web programmer, so I am having difficulty understanding the documentation surrounding the esri.request command the need for a proxy page.  I understand the concepts, but please help me out with the implementation.  I am creating this application on localhost first, and then will deploy it to our public web server.

The address of the REST application I'm calling has this pattern:


In the HTML page I'm building, I have a JavaScript function which looks like this:

function callRest(myParam1, myParam2) {
  var geoAddr = esri.request( {
    url: "http://myserver.org/app/myapp.dll/rest/resource",
    content: {
      param1: myParam1,
      param2: myParam2
    handleAs: "json",
    load: handleSuccess,
    error: handleFailure  
  } );

No matter how I try it, the handleFailure function is getting called, and I don't know why.

So, on localhost, I installed the .NET 2.0.50727 part of IIS 7.  I created an application under Default Web Site, and extracted the proxy.config and proxy.ashx there.  I modifed proxy.ashx to include the url of the REST application.  The HTML page is in that application's folder.

Because I'm not a great web programmer, I don't know what to try in order to fix this.  Should I alert() something?  Is there something I have to turn on in IIS?  I'm just lost, and would appreciate any suggestions.