problems setting up my proxy pages on my server

1436
8
Jump to solution
11-19-2012 12:41 PM
TracySchloss
Frequent Contributor
I have followed the instructions on how to set up proxy pages and I'm running out of ideas of why my application is completely ignoring my proxy set up.

I downloaded the configuration files using the ASP.NET option. 
I created a folder on my server under inetpub/wwwroot and called it proxy and put proxy.config and proxy.ashx in it.
I edited proxy.config file to contain the paths to my local services as well as the ESRI online services (I am generating a buffer as well as trying to build routes with a route task).
I went into IIS Manager and create an application from this directory.

I modified my code to have the path in my code:
  esri.config.defaults.io.proxyUrl = "proxy/proxy.ashx";


I keep my projects in another directory, not wwwroot, but have set a virtual directory to the location of where the files reside.  My file opens just fine.

When I look at Firebug, on the Net tab to watch the traffic, I never see any POST entries, only GET, so none of my requests are going through the proxy.  There are no errors, it's just not using it.

When I an defining my proxyUrl, should I be using this type of relative path name?  I tried a complete URL to the location of the proxy.ashx, but that didn't help.  It seems like if it couldn't find the proxy file, I would at least get an error telling me it couldn't find it???
0 Kudos
1 Solution

Accepted Solutions
TracySchloss
Frequent Contributor
The state is still on IE 8.  I found the problem!  It had to do with the mobile components, that aren't well supported in in that browser.

I was adding a few attributes to my start and end points and the start point was supposed to have the name of the address by finding the content of a mobile item.  Instead it was coming back as undefined.  I didn't think much of it, but instead of being "blank", it must have had something very wierd as the name attribute and it was confusing the whole thing.  I didn't really have to have the attribute and took it out - problem solved!

View solution in original post

0 Kudos
8 Replies
__Rich_
Occasional Contributor III
From the documentation:


esri.config.defaults.io.alwaysUseProxy = true;

     
If the alwaysUseProxy property is false (the default), then the proxy page will be used automatically if the proxy property is set and the request exceeds 2000 characters.


In other words if you want to force the API to use the proxy for ALL requests then set the value to true.
0 Kudos
TracySchloss
Frequent Contributor
I would think you would take an performance hit for that and somewhere else I read that you shouldn't  set that to true except when you are using the proxy for security reasons.  I'm not.   I need it because I'm using a geometryService and a routeTask and both routinely exceed the max # of characters.

I already tried adding that line BTW and it didn't make any difference.
0 Kudos
__Rich_
Occasional Contributor III
I would think you would take an performance hit for that

Yes, but not really a significant hit...unless your proxy is poorly implemented.
and somewhere else I read that you shouldn't  set that to true except when you are using the proxy for security reasons.

Security is not the only reason; but the logic here is 'don't set up a proxy unless you have at least one reason', obviously!
I need it because I'm using a geometryService and a routeTask and both routinely exceed the max # of characters.

Indeed.
I already tried adding that line BTW and it didn't make any difference.

Then you've got something wrong somewhere else <- rocket science 😉

Don't suppose any of your stuff (just the app will do) is publicly accessible?  (or perhaps you could hack a quick page together that exhibits your issue?)
0 Kudos
TracySchloss
Frequent Contributor
This works in Firefox and Chrome, but not in IE.  I don't feel very proficient using the IE debugging tools.  But since there are no errors in Firebug, I had to look into other debugging options. 

I also turned on Fiddler to monitor my traffic. I turned "always use proxy" back on again and now in Fiddler I see an error that the stops I have defined for the routetask are invalid.  I think this is curious because it works in other browsers.  So I will be pursuing that instead (and have a thread about it as well).

This is available at http://wwwgis.dhss.mo.gov/Website/mobileWIC/WIC.html Since it's based on geoLocation, it's not going to work for you (unless you happen to be in Missouri).  It has an option to "Enter my starting address" that will search by geocode instead.  I'm using the World Locator, so you can just enter any Missouri town.  I've been using Holt, MO for no other reason except that it is short and easy to type.
0 Kudos
__Rich_
Occasional Contributor III
Works for me in FF, Chrome, IE9 so far i.e. I see it's using the proxy that you've set.

edit: and IE8 and IE7...
0 Kudos
TracySchloss
Frequent Contributor
The state is still on IE 8.  I found the problem!  It had to do with the mobile components, that aren't well supported in in that browser.

I was adding a few attributes to my start and end points and the start point was supposed to have the name of the address by finding the content of a mobile item.  Instead it was coming back as undefined.  I didn't think much of it, but instead of being "blank", it must have had something very wierd as the name attribute and it was confusing the whole thing.  I didn't really have to have the attribute and took it out - problem solved!
0 Kudos
__Rich_
Occasional Contributor III
^ and this was affecting the proxy usage?  (or is this the answer to your other thread, rather than this one?)
0 Kudos
TracySchloss
Frequent Contributor
I thought it was my proxy because it was 'failing' on the request I thought was the biggest one I was trying to process.  In the end I had two problems, one with my proxy and one with routeTask.
0 Kudos