<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Setting up a proxy for use with esri.utils in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-up-a-proxy-for-use-with-esri-utils/m-p/72554#M6553</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;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.&amp;nbsp; I understand the concepts, but please help me out with the implementation.&amp;nbsp; I am creating this application on localhost first, and then will deploy it to our public web server.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The address of the REST application I'm calling has this &lt;/SPAN&gt;&lt;STRONG&gt;pattern&lt;/STRONG&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://myserver.org/app/myapp.dll/rest/resource/?param1=value1&amp;amp;param2=value2" rel="nofollow noopener noreferrer" target="_blank"&gt;http://myserver.org/app/myapp.dll/rest/resource/?param1=value1&amp;amp;param2=value2&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the HTML page I'm building, I have a JavaScript function which looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
function callRest(myParam1, myParam2) {
&amp;nbsp; var geoAddr = esri.request( {
&amp;nbsp;&amp;nbsp;&amp;nbsp; url: "http://myserver.org/app/myapp.dll/rest/resource",
&amp;nbsp;&amp;nbsp;&amp;nbsp; content: {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param1: myParam1,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param2: myParam2
&amp;nbsp;&amp;nbsp;&amp;nbsp; },
&amp;nbsp;&amp;nbsp;&amp;nbsp; handleAs: "json",
&amp;nbsp;&amp;nbsp;&amp;nbsp; load: handleSuccess,
&amp;nbsp;&amp;nbsp;&amp;nbsp; error: handleFailure&amp;nbsp; 
&amp;nbsp; } );
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No matter how I try it, the handleFailure function is getting called, and I don't know why.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, on localhost, I installed the .NET 2.0.50727 part of IIS 7.&amp;nbsp; I created an application under Default Web Site, and extracted the proxy.config and proxy.ashx there.&amp;nbsp; I modifed proxy.ashx to include the url of the REST application.&amp;nbsp; The HTML page is in that application's folder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Because I'm not a great web programmer, I don't know what to try in order to fix this.&amp;nbsp; Should I alert() something?&amp;nbsp; Is there something I have to turn on in IIS?&amp;nbsp; I'm just lost, and would appreciate any suggestions.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 22:48:59 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-12-10T22:48:59Z</dc:date>
    <item>
      <title>Setting up a proxy for use with esri.utils</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-up-a-proxy-for-use-with-esri-utils/m-p/72554#M6553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;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.&amp;nbsp; I understand the concepts, but please help me out with the implementation.&amp;nbsp; I am creating this application on localhost first, and then will deploy it to our public web server.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The address of the REST application I'm calling has this &lt;/SPAN&gt;&lt;STRONG&gt;pattern&lt;/STRONG&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://myserver.org/app/myapp.dll/rest/resource/?param1=value1&amp;amp;param2=value2" rel="nofollow noopener noreferrer" target="_blank"&gt;http://myserver.org/app/myapp.dll/rest/resource/?param1=value1&amp;amp;param2=value2&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the HTML page I'm building, I have a JavaScript function which looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
function callRest(myParam1, myParam2) {
&amp;nbsp; var geoAddr = esri.request( {
&amp;nbsp;&amp;nbsp;&amp;nbsp; url: "http://myserver.org/app/myapp.dll/rest/resource",
&amp;nbsp;&amp;nbsp;&amp;nbsp; content: {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param1: myParam1,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param2: myParam2
&amp;nbsp;&amp;nbsp;&amp;nbsp; },
&amp;nbsp;&amp;nbsp;&amp;nbsp; handleAs: "json",
&amp;nbsp;&amp;nbsp;&amp;nbsp; load: handleSuccess,
&amp;nbsp;&amp;nbsp;&amp;nbsp; error: handleFailure&amp;nbsp; 
&amp;nbsp; } );
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No matter how I try it, the handleFailure function is getting called, and I don't know why.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, on localhost, I installed the .NET 2.0.50727 part of IIS 7.&amp;nbsp; I created an application under Default Web Site, and extracted the proxy.config and proxy.ashx there.&amp;nbsp; I modifed proxy.ashx to include the url of the REST application.&amp;nbsp; The HTML page is in that application's folder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Because I'm not a great web programmer, I don't know what to try in order to fix this.&amp;nbsp; Should I alert() something?&amp;nbsp; Is there something I have to turn on in IIS?&amp;nbsp; I'm just lost, and would appreciate any suggestions.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:48:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-up-a-proxy-for-use-with-esri-utils/m-p/72554#M6553</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-10T22:48:59Z</dc:date>
    </item>
  </channel>
</rss>

