Select to view content in your preferred language

Why does browser download proxy.ashx file?

1956
5
Jump to solution
08-20-2018 09:35 AM
ElizabethMiller
New Contributor III

I have a Web Appbuilder app (developer edition) using a custom widget that makes a call to another server to get a json response. I am using esriConfig.defaults.io.proxyUrl in my code and I am referencing my proxy/proxy.ashx file. This has been working fine up to now! But now it has suddenly stopped working. The browser now seems to be reading the proxy.ashx file as an html file instead of forwarding the request and returning a json response.

When I copy the request url and paste it in the browser, the proxy.ashx file is downloaded instead of returning json. When I test the proxy alone without the full request ("http:myurl\apps\2\proxy\proxy.ashx?"), the same thing happens. I have tried this in Chrome, IE, and Firefox. Is there a setting that could have caused this? Has anyone had this problem and fixed it?

Thanks!

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

I am not sure why that would have ever worked... In the WAB builder environment you do not need a proxy as WAB has a built in proxy.js file that runns in NodeJS.

View solution in original post

5 Replies
RobertScheitlin__GISP
MVP Emeritus

Is your proxy.ashx folder setup as an application in IIS?

0 Kudos
ElizabethMiller
New Contributor III

I am just working out of the web appbuilder development environment using node.js. Up until now it has worked fine to just place the proxy folder in the app folder.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

I am not sure why that would have ever worked... In the WAB builder environment you do not need a proxy as WAB has a built in proxy.js file that runns in NodeJS.

ElizabethMiller
New Contributor III

Problem solved!

I know you are correct, as I didn't need it initially. Then I started including these elements because I wanted them in place when I deploy the app to a different IIS server (where they have worked fine too).

The problem was that my server app widget code had gotten out of sync with the client/stemapp/widget code. I got them back in sync and pointed my app's config.json httpPorxy url back to "/proxy.js" and all is working now.

In the future I will wait and make the changes only on the IIS server version when I deploy.

Thank you for your help!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Don't forget to mark this question as answered by clicking on the "Mark Correct" link on the reply that answered your question.