<?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 problems with using the proxy.php for edits in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problems-with-using-the-proxy-php-for-edits/m-p/452960#M41878</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I thought I would post this to the forums since it took me hours to solve. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I could not get the proxy.php page to work on my setup (WAMP server).&amp;nbsp; The request fired from the Attribute Inspector or Editor would simply time out.&amp;nbsp; Firebug gave an error of "XML Parsing Error: no element found Location: moz-nullprincipal:{78a64f8b-a468-4122-8af0-356a8e931a72} Line Number 1, Column 1:"&amp;nbsp; Which is just a default Mozilla error meaning the request timed out.&amp;nbsp;&amp;nbsp; I read a number of old esri forums post that said things like your application had to be on the same machine as your ArcGIS server&amp;nbsp; (not true, you dont need a proxy in that situation.&amp;nbsp; Your application and your proxy.php have to be on the same server, but they can/will be on a different server than your ArcGIS Server).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The solution for me ended up being a firewall issue where proxy requests had to be made to the ArcGIS server's externally facing IP address.&amp;nbsp;&amp;nbsp; Its host name would not work. nor would its internally facing IP.&amp;nbsp; So I created a function to place in the proxy.php which solved the problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;nbsp; // this function replaces the domain in serverURL's with the IP if it is defined.&amp;nbsp; this way we dont have to expose our IP in our webpages featureLayer definition
&amp;nbsp; $replacementIP = $serverUrls[$pos]['ip'];
&amp;nbsp; if ($replacementIP) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $host = parse_url($targetUrl, PHP_URL_HOST);&amp;nbsp;&amp;nbsp;&amp;nbsp; //parse out the host or domain from url
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $targetUrl = str_replace($host,$replacementIP,$targetUrl); //replace host with ip in url string
&amp;nbsp; }
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I placed this function directly below the following function&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;nbsp; // add token (if any) to the url
&amp;nbsp; $token = $serverUrls[$pos]['token'];
&amp;nbsp; if ($token) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; $targetUrl .= (stripos($targetUrl, "?") !== false ? '&amp;amp;' : '?').'token='.$token;
&amp;nbsp; }
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You then must add a 'ip' variable in the $serverUrls Array.&amp;nbsp;&amp;nbsp; for example&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt; array( 'url' =&amp;gt; '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://myArcServerDomain.com/ArcGIS/rest/services/" rel="nofollow" target="_blank"&gt;http://myArcServerDomain.com/ArcGIS/rest/services/&lt;/A&gt;&lt;SPAN&gt;', 'ip' =&amp;gt; '192.168.1.3', 'matchAll' =&amp;gt; true, 'token' =&amp;gt; '' )&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Works like a charm&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hope that helps someone&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Apr 2012 20:35:05 GMT</pubDate>
    <dc:creator>lanceweaver</dc:creator>
    <dc:date>2012-04-11T20:35:05Z</dc:date>
    <item>
      <title>problems with using the proxy.php for edits</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problems-with-using-the-proxy-php-for-edits/m-p/452960#M41878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I thought I would post this to the forums since it took me hours to solve. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I could not get the proxy.php page to work on my setup (WAMP server).&amp;nbsp; The request fired from the Attribute Inspector or Editor would simply time out.&amp;nbsp; Firebug gave an error of "XML Parsing Error: no element found Location: moz-nullprincipal:{78a64f8b-a468-4122-8af0-356a8e931a72} Line Number 1, Column 1:"&amp;nbsp; Which is just a default Mozilla error meaning the request timed out.&amp;nbsp;&amp;nbsp; I read a number of old esri forums post that said things like your application had to be on the same machine as your ArcGIS server&amp;nbsp; (not true, you dont need a proxy in that situation.&amp;nbsp; Your application and your proxy.php have to be on the same server, but they can/will be on a different server than your ArcGIS Server).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The solution for me ended up being a firewall issue where proxy requests had to be made to the ArcGIS server's externally facing IP address.&amp;nbsp;&amp;nbsp; Its host name would not work. nor would its internally facing IP.&amp;nbsp; So I created a function to place in the proxy.php which solved the problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;nbsp; // this function replaces the domain in serverURL's with the IP if it is defined.&amp;nbsp; this way we dont have to expose our IP in our webpages featureLayer definition
&amp;nbsp; $replacementIP = $serverUrls[$pos]['ip'];
&amp;nbsp; if ($replacementIP) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $host = parse_url($targetUrl, PHP_URL_HOST);&amp;nbsp;&amp;nbsp;&amp;nbsp; //parse out the host or domain from url
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $targetUrl = str_replace($host,$replacementIP,$targetUrl); //replace host with ip in url string
&amp;nbsp; }
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I placed this function directly below the following function&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;nbsp; // add token (if any) to the url
&amp;nbsp; $token = $serverUrls[$pos]['token'];
&amp;nbsp; if ($token) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; $targetUrl .= (stripos($targetUrl, "?") !== false ? '&amp;amp;' : '?').'token='.$token;
&amp;nbsp; }
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You then must add a 'ip' variable in the $serverUrls Array.&amp;nbsp;&amp;nbsp; for example&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt; array( 'url' =&amp;gt; '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://myArcServerDomain.com/ArcGIS/rest/services/" rel="nofollow" target="_blank"&gt;http://myArcServerDomain.com/ArcGIS/rest/services/&lt;/A&gt;&lt;SPAN&gt;', 'ip' =&amp;gt; '192.168.1.3', 'matchAll' =&amp;gt; true, 'token' =&amp;gt; '' )&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Works like a charm&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hope that helps someone&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 20:35:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/problems-with-using-the-proxy-php-for-edits/m-p/452960#M41878</guid>
      <dc:creator>lanceweaver</dc:creator>
      <dc:date>2012-04-11T20:35:05Z</dc:date>
    </item>
  </channel>
</rss>

