<?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: Problem with API Geocoding - Hana XSJS in ArcGIS Location Service Questions</title>
    <link>https://community.esri.com/t5/arcgis-location-service-questions/problem-with-api-geocoding-hana-xsjs/m-p/1173635#M2</link>
    <description>&lt;P&gt;That's strange,&lt;/P&gt;&lt;P&gt;I just did it as you said (same as the &lt;A href="https://www.postman.com/arcgis-developer/workspace/arcgis-location-services/request/15786767-3c13e739-ad89-496d-9ddd-7746b2335dd0" target="_self"&gt;Postman example&lt;/A&gt;) and it worked:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;curl --location --request GET 'https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?token=MY_API_KEY&amp;amp;f=pjson&amp;amp;singleLine=1600 Pennsylvania Ave NW, DC'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;I got &lt;A href="https://www.postman.com/arcgis-developer/workspace/arcgis-location-services/example/15786767-fc92f59b-8548-442f-861a-0178cc32d27f" target="_self"&gt;this same response.&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;SPAN&gt;but it seems that the request doesn't return anything. Can someone help me?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV&gt;&lt;SPAN&gt;What do you mean by this? can you share the curl and screenshot? (blurring the API key)&lt;/SPAN&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 13 May 2022 11:01:54 GMT</pubDate>
    <dc:creator>Raul_Jimenez</dc:creator>
    <dc:date>2022-05-13T11:01:54Z</dc:date>
    <item>
      <title>Problem with API Geocoding - Hana XSJS</title>
      <link>https://community.esri.com/t5/arcgis-location-service-questions/problem-with-api-geocoding-hana-xsjs/m-p/1173633#M1</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I'm trying to geocode some addresses with API Geocoding, in Hana XSJS.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I made a GET request to&amp;nbsp;geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?&amp;lt;parameters&amp;gt;, where in the paremeters I inserted&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Token: the access token&lt;/LI&gt;&lt;LI&gt;address: an example address ('1600 Pennsylvania Ave NW, DC')&lt;/LI&gt;&lt;LI&gt;pjson as output format&lt;BR /&gt;but it seems that the request doesn't return anything. Can someone help me?&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Fri, 25 Aug 2023 09:48:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-location-service-questions/problem-with-api-geocoding-hana-xsjs/m-p/1173633#M1</guid>
      <dc:creator>LeonardoRomanato</dc:creator>
      <dc:date>2023-08-25T09:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with API Geocoding - Hana XSJS</title>
      <link>https://community.esri.com/t5/arcgis-location-service-questions/problem-with-api-geocoding-hana-xsjs/m-p/1173635#M2</link>
      <description>&lt;P&gt;That's strange,&lt;/P&gt;&lt;P&gt;I just did it as you said (same as the &lt;A href="https://www.postman.com/arcgis-developer/workspace/arcgis-location-services/request/15786767-3c13e739-ad89-496d-9ddd-7746b2335dd0" target="_self"&gt;Postman example&lt;/A&gt;) and it worked:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;curl --location --request GET 'https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?token=MY_API_KEY&amp;amp;f=pjson&amp;amp;singleLine=1600 Pennsylvania Ave NW, DC'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;I got &lt;A href="https://www.postman.com/arcgis-developer/workspace/arcgis-location-services/example/15786767-fc92f59b-8548-442f-861a-0178cc32d27f" target="_self"&gt;this same response.&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;SPAN&gt;but it seems that the request doesn't return anything. Can someone help me?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV&gt;&lt;SPAN&gt;What do you mean by this? can you share the curl and screenshot? (blurring the API key)&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 May 2022 11:01:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-location-service-questions/problem-with-api-geocoding-hana-xsjs/m-p/1173635#M2</guid>
      <dc:creator>Raul_Jimenez</dc:creator>
      <dc:date>2022-05-13T11:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with API Geocoding - Hana XSJS</title>
      <link>https://community.esri.com/t5/arcgis-location-service-questions/problem-with-api-geocoding-hana-xsjs/m-p/1173693#M3</link>
      <description>&lt;P&gt;Hi thanks for the answer.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;req = new $.web.WebRequest($.net.http.GET, "f=pjson&amp;amp;singleLine=" + address +"&amp;amp;token="+access_token);
response = client.getResponse()');
response = client.request(req, dest).getResponse();
jresponse = JSON.parse(response.body.asString());&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in the 4th row of code I parse the the string into json, but while I access to the response object the code crashes.&lt;BR /&gt;&lt;BR /&gt;It seems like the response is an empty object, maybe because of the wrong request&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 14:06:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-location-service-questions/problem-with-api-geocoding-hana-xsjs/m-p/1173693#M3</guid>
      <dc:creator>LeonardoRomanato</dc:creator>
      <dc:date>2022-05-13T14:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with API Geocoding - Hana XSJS</title>
      <link>https://community.esri.com/t5/arcgis-location-service-questions/problem-with-api-geocoding-hana-xsjs/m-p/1173718#M4</link>
      <description>&lt;P&gt;Have you tried:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;try{
   // ...
}catch(e){
   console.log("Error: ", e);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;It might be an HTML been responded by the API?&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 14:46:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-location-service-questions/problem-with-api-geocoding-hana-xsjs/m-p/1173718#M4</guid>
      <dc:creator>Raul_Jimenez</dc:creator>
      <dc:date>2022-05-13T14:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with API Geocoding - Hana XSJS</title>
      <link>https://community.esri.com/t5/arcgis-location-service-questions/problem-with-api-geocoding-hana-xsjs/m-p/1173732#M5</link>
      <description>&lt;P&gt;sadly the language is not javascript but XSJS (SAP Hana Javscript Language) so I can't print with console.log().&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LeonardoRomanato_0-1652454756437.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/41320i80A3E70F7CA1A495/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LeonardoRomanato_0-1652454756437.png" alt="LeonardoRomanato_0-1652454756437.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway I have a function to write into a SQL table to log in wich point my code stop, that's why I know that's somethig wrong when I access to response object.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;For example the code crashes even in this snippet:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;req = new $.web.WebRequest($.net.http.GET, "f=pjson&amp;amp;singleLine=" + address +"&amp;amp;token="+access_token);
response = client.getResponse()');
response = client.request(req, dest).getResponse();
printInLogDB(idStep,'X',response.body.asString());&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 15:12:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-location-service-questions/problem-with-api-geocoding-hana-xsjs/m-p/1173732#M5</guid>
      <dc:creator>LeonardoRomanato</dc:creator>
      <dc:date>2022-05-13T15:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with API Geocoding - Hana XSJS</title>
      <link>https://community.esri.com/t5/arcgis-location-service-questions/problem-with-api-geocoding-hana-xsjs/m-p/1173952#M6</link>
      <description>&lt;P&gt;The basic operation appears to be correct. Using your exact parameters in a web browser you can see it works (you need to replace your token)&lt;/P&gt;&lt;P&gt;&lt;A href="https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?f=pjson&amp;amp;singleLine=1600+Pennsylvania+Ave+NW,+DC&amp;amp;token=YOUR_TOKEN" target="_blank"&gt;https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?f=pjson&amp;amp;singleLine=1600+Pennsylvania+Ave+NW,+DC&amp;amp;token=YOUR_TOKEN&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Response:&lt;/P&gt;&lt;PRE&gt;{
 "spatialReference": {
  "wkid": 4326,
  "latestWkid": 4326
 },
 "candidates": [
  {
   "address": "1600 Pennsylvania Ave NW, Washington, District of Columbia, 20500",
   "location": {
    "x": -77.036546998208649,
    "y": 38.897675107651253
   },
   "score": 100,
   "attributes": {
    
   },
   "extent": {
    "xmin": -77.037546998208654,
    "ymin": 38.896675107651255,
    "xmax": -77.035546998208645,
    "ymax": 38.89867510765125
   }
  }
 ]
}&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. verify your URL is correct?&lt;/P&gt;&lt;P&gt;2. verify you are URL encoding the address string?&lt;/P&gt;&lt;P&gt;3. verify your token is correct?&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 22:32:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-location-service-questions/problem-with-api-geocoding-hana-xsjs/m-p/1173952#M6</guid>
      <dc:creator>John-Foster</dc:creator>
      <dc:date>2022-05-13T22:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with API Geocoding - Hana XSJS</title>
      <link>https://community.esri.com/t5/arcgis-location-service-questions/problem-with-api-geocoding-hana-xsjs/m-p/1173953#M7</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/31267"&gt;@LeonardoRomanato&lt;/a&gt;&amp;nbsp;are you certain line 2 is correct?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;response = client.getResponse()');
response = client.request(req, dest).getResponse();&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 22:36:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-location-service-questions/problem-with-api-geocoding-hana-xsjs/m-p/1173953#M7</guid>
      <dc:creator>John-Foster</dc:creator>
      <dc:date>2022-05-13T22:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with API Geocoding - Hana XSJS</title>
      <link>https://community.esri.com/t5/arcgis-location-service-questions/problem-with-api-geocoding-hana-xsjs/m-p/1173984#M8</link>
      <description>&lt;P&gt;As John highlighted, my two cents would go for the encoding of the address. You can avoid encoding it if you uses a POST request instead.&lt;/P&gt;</description>
      <pubDate>Sat, 14 May 2022 06:34:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-location-service-questions/problem-with-api-geocoding-hana-xsjs/m-p/1173984#M8</guid>
      <dc:creator>Raul_Jimenez</dc:creator>
      <dc:date>2022-05-14T06:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with API Geocoding - Hana XSJS</title>
      <link>https://community.esri.com/t5/arcgis-location-service-questions/problem-with-api-geocoding-hana-xsjs/m-p/1174075#M9</link>
      <description>&lt;P&gt;Since XSJS is a service itself, you can forward the error message as part of the service response and then analyze it in the debug console of your browser. Just checked one of my xsjs project and found this sample code.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function doGet() {  
    try{  
              $.response.contentType = "application/json";  
              $.response.setBody(JSON.stringify(getProperties()));  
    }  
    catch(err){  
              $.response.contentType = "text/plain";  
              $.response.setBody("Error while executing query: [" + err.message + "]");  
              $.response.returnCode = 200;  
    }  
} &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2022 06:40:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-location-service-questions/problem-with-api-geocoding-hana-xsjs/m-p/1174075#M9</guid>
      <dc:creator>MathiasKemeter</dc:creator>
      <dc:date>2022-05-16T06:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with API Geocoding - Hana XSJS</title>
      <link>https://community.esri.com/t5/arcgis-location-service-questions/problem-with-api-geocoding-hana-xsjs/m-p/1178498#M10</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/31267"&gt;@LeonardoRomanato&lt;/a&gt;&amp;nbsp;were you able to fix this?&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 10:41:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-location-service-questions/problem-with-api-geocoding-hana-xsjs/m-p/1178498#M10</guid>
      <dc:creator>Raul_Jimenez</dc:creator>
      <dc:date>2022-05-31T10:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with API Geocoding - Hana XSJS</title>
      <link>https://community.esri.com/t5/arcgis-location-service-questions/problem-with-api-geocoding-hana-xsjs/m-p/1181390#M11</link>
      <description>&lt;P&gt;I solved by myself because the problem was in the Hana Trust Score, I had to create a new trust score and link the configuration file .xshttpdest to make the request.&lt;BR /&gt;&lt;BR /&gt;Thanks to everyone!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 09:16:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-location-service-questions/problem-with-api-geocoding-hana-xsjs/m-p/1181390#M11</guid>
      <dc:creator>LeonardoRomanato</dc:creator>
      <dc:date>2022-06-09T09:16:00Z</dc:date>
    </item>
  </channel>
</rss>

