<?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 Re: SyntaxError in Portal when querying custom GeocodeServer in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/syntaxerror-in-portal-when-querying-custom/m-p/691855#M3365</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jon:&lt;/P&gt;&lt;P&gt;What version is the custom locator and portal you are using?&lt;/P&gt;&lt;P&gt;Which locator style was used to build the locator?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Jan 2019 01:40:24 GMT</pubDate>
    <dc:creator>ShanaBritt</dc:creator>
    <dc:date>2019-01-17T01:40:24Z</dc:date>
    <item>
      <title>SyntaxError in Portal when querying custom GeocodeServer</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/syntaxerror-in-portal-when-querying-custom/m-p/691854#M3364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've created a custom GeocodeServer according to the &lt;A href="https://developers.arcgis.com/rest/services-reference/geocode-service.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;ArcGIS Rest API specification&lt;/A&gt;. To this point, I've implemented the root (GeocodeServer), &lt;A href="https://developers.arcgis.com/rest/services-reference/find-address-candidates.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;findAddressCandidates&lt;/A&gt;, and &lt;A href="https://developers.arcgis.com/rest/services-reference/suggest.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;suggest&lt;/A&gt;, and referenced the custom GeocodeServer as a utility service in Portal for ArcGIS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the Portal map viewer, I've selected the custom GeocodeServer from the Find dropdown list, and enter some text. No suggestions are shown, and, when I press Enter, no candidates are found. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking at the console reveals a SyntaxError for both the &lt;SPAN style="color: #000080;"&gt;&lt;STRONG style="font-family: terminal, monaco, monospace;"&gt;suggest&lt;/STRONG&gt;&lt;/SPAN&gt; and &lt;SPAN style="color: #000080;"&gt;&lt;STRONG style="font-family: terminal, monaco, monospace;"&gt;findAddressCandidates&lt;/STRONG&gt;&lt;/SPAN&gt; requests:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/432513_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking at the response from the custom GeocodeServer for a call to &lt;SPAN style="color: #000080;"&gt;&lt;STRONG style="font-family: terminal, monaco, monospace;"&gt;suggest&lt;/STRONG&gt;&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/432514_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it appears to have the same syntax as the response from the ArcGIS World Geocoding Service:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/432527_pastedImage_15.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same is true for calls to the &lt;SPAN style="color: #000080; font-family: terminal, monaco, monospace;"&gt;&lt;STRONG&gt;findAddressCandidates&lt;/STRONG&gt;&lt;/SPAN&gt; method. For the custom GeocodeServer:&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-4" src="https://community.esri.com/legacyfs/online/432528_pastedImage_19.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and for the ArcGIS World Geocoding Service:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-5 jive-image" src="https://community.esri.com/legacyfs/online/432529_pastedImage_20.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do note, however, that the response headers are somewhat different. For the custom GeocodeServer, a response from suggest has the following response headers:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Transfer-Encoding: chunked
Content-Type: application/json; charset=utf-8
Content-Encoding: gzip
Expires: -1
Vary: Accept-Encoding
Server: Microsoft-IIS/10.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Thu, 03 Jan 2019 14:57:10 GMT&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;whereas from the ArcGIS World Geocoding Service, the response headers are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;HTTP/2.0 200 OK
date: Thu, 03 Jan 2019 14:58:47 GMT
content-type: application/json;charset=UTF-8
content-length: 331
vary: Origin
access-control-allow-origin: https://devweb.tcgis.ca
access-control-allow-credentials: true
cache-control: max-age=0,must-revalidate
server: 
set-cookie: AGS_ROLES="419jqfa+uOZgYod4xPOQ8Q=="; Version=1; Max-Age=60; Expires=Thu, 03-Jan-2019 14:59:47 GMT; Path=/arcgis/rest; HttpOnly
etag: 73d496d8
content-encoding: gzip
X-Firefox-Spdy: h2&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, I'm not exactly sure which, if any of these, would cause the SyntaxError.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:07:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/syntaxerror-in-portal-when-querying-custom/m-p/691854#M3364</guid>
      <dc:creator>JonathanBailey</dc:creator>
      <dc:date>2021-12-12T05:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: SyntaxError in Portal when querying custom GeocodeServer</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/syntaxerror-in-portal-when-querying-custom/m-p/691855#M3365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jon:&lt;/P&gt;&lt;P&gt;What version is the custom locator and portal you are using?&lt;/P&gt;&lt;P&gt;Which locator style was used to build the locator?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2019 01:40:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/syntaxerror-in-portal-when-querying-custom/m-p/691855#M3365</guid>
      <dc:creator>ShanaBritt</dc:creator>
      <dc:date>2019-01-17T01:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: SyntaxError in Portal when querying custom GeocodeServer</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/syntaxerror-in-portal-when-querying-custom/m-p/691856#M3366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shana!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It turns out that there's an "undocumented" "feature" at work here with the REST API. In addition to the documented parameters, there's a `callback` parameter; if the client provides a value for this (which Portal for ArcGIS does), then the service needs to wrap the response in the provided callback. Once I did this, then it worked correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jon.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2019 16:09:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/syntaxerror-in-portal-when-querying-custom/m-p/691856#M3366</guid>
      <dc:creator>JonathanBailey</dc:creator>
      <dc:date>2019-01-30T16:09:02Z</dc:date>
    </item>
  </channel>
</rss>

