<?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: Geocoding Api only fails in Java code in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/geocoding-api-only-fails-in-java-code/m-p/303113#M1502</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Brandon! Yes so I finally figured that we failed the api call also because of encoding issue. We have to manually encode the double quote sign \" to '%22', Java won't do this for us while Postman and Browser do. That's similar to your scenario of bracket characters. It's working now. Cheers&amp;nbsp; &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Jul 2019 06:46:41 GMT</pubDate>
    <dc:creator>LeiQin</dc:creator>
    <dc:date>2019-07-08T06:46:41Z</dc:date>
    <item>
      <title>Geocoding Api only fails in Java code</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/geocoding-api-only-fails-in-java-code/m-p/303110#M1499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #505050; background-color: #ffffff; font-weight: normal; font-size: 12px;"&gt;The Rest URL I'm using is "http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/geocodeAddresses?addresses=%7B"records":%5B%7B"attributes":%7B"OBJECTID":1,"SingleLine":"27488 Stanford Ave, Bowden, North Dakota"%7D%7D%5D%7D&amp;amp;sourceCountry=USA&amp;amp;f=pjson&amp;amp;token=&amp;lt;myToken&amp;gt;". It works perfect in browser and Postman. However while I tried it in Java code, it always give me HTTP 400 code, without any additional information. I've checked request HTTP headers and compared, I don't see anything wrong in Java.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #505050; background-color: #ffffff; font-weight: normal; font-size: 12px;"&gt;Does anybody&amp;nbsp;used this Api in Java and has some&amp;nbsp;idea&amp;nbsp;about it?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #505050; background-color: #ffffff; font-weight: normal; font-size: 12px;"&gt;Thank you,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #505050; background-color: #ffffff; font-weight: normal; font-size: 12px;"&gt;Lei&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2019 10:45:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/geocoding-api-only-fails-in-java-code/m-p/303110#M1499</guid>
      <dc:creator>LeiQin</dc:creator>
      <dc:date>2019-06-27T10:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: Geocoding Api only fails in Java code</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/geocoding-api-only-fails-in-java-code/m-p/303111#M1500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lei,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't have a solution to offer.&amp;nbsp; However, I did want to let you know that I've started seeing a 400 error reported back when calling the ESRI API.&amp;nbsp; I can't even get it to work in my browser.&amp;nbsp; This error just started happening sometime on June 27 or 28. We normally see usage logged on the graph on the ESRI dashboard almost every day (except the weekends) and I'm not seeing any usage logged for Friday the 28th, Monday 7/1, or Today 7/2.&amp;nbsp; So, this has me wondering if there is a problem with the REST API on the ESRI side of things.&amp;nbsp; Here's an example query that is not working for us:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;A class="unlinked"&gt;https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/geocodeAddresses?addresses={"records":[{"attributes":{"OBJECTID":1,"SingleLine":"661%20E%20Davis%20ST%2036323"}}]}&amp;amp;sourceCountry=USA&amp;amp;category=Street%20Address&amp;amp;f=pjson&amp;amp;forStorage=true&amp;amp;token=&amp;lt;mytoken&amp;gt;&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;And here's the error response:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;H1 style="color: white; background-color: #525d76; font-size: 22px;"&gt;Error occurred while processing request&lt;/H1&gt;&lt;HR noshade="noshade" size="1" style="color: #525d76; font-size: medium;" /&gt;&lt;P style="color: #000000; background: #ffffff; font-size: 12px;"&gt;&lt;STRONG style="color: white; background-color: #525d76;"&gt;Type:&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Exception Report&lt;/P&gt;&lt;P style="color: #000000; background: #ffffff; font-size: 12px;"&gt;&lt;STRONG style="color: white; background-color: #525d76;"&gt;Message:&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #000000; background: #ffffff; font-size: 12px;"&gt;&lt;STRONG style="color: white; background-color: #525d76;"&gt;Description:&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="text-decoration: underline;"&gt;http.400:&lt;/SPAN&gt;&lt;/P&gt;&lt;HR noshade="noshade" size="1" style="color: #525d76; font-size: medium;" /&gt;&lt;H3 style="color: white; background-color: #525d76; font-size: 14px;"&gt;ArcGIS Server&lt;/H3&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I'm posting here as I don't think we have any tech support since we are on the "pay as you go" plan.&amp;nbsp; &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you find a solution to this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Brandon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jul 2019 20:32:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/geocoding-api-only-fails-in-java-code/m-p/303111#M1500</guid>
      <dc:creator>BrandonRichards</dc:creator>
      <dc:date>2019-07-02T20:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Geocoding Api only fails in Java code</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/geocoding-api-only-fails-in-java-code/m-p/303112#M1501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lei,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just figured out that in our case (in C#) I needed to call&amp;nbsp;Uri.EscapeDataString(jsonRequestString); on our JSON addresses object so that the square bracket characters ( [ and ] ) would be Uri data encoded.&amp;nbsp; It has been working fine for a very long time without doing this, so something must have changed on the ESRI side a few days ago that has started requiring us to put the JSON in the escaped format.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Brandon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2019 16:39:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/geocoding-api-only-fails-in-java-code/m-p/303112#M1501</guid>
      <dc:creator>BrandonRichards</dc:creator>
      <dc:date>2019-07-03T16:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: Geocoding Api only fails in Java code</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/geocoding-api-only-fails-in-java-code/m-p/303113#M1502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Brandon! Yes so I finally figured that we failed the api call also because of encoding issue. We have to manually encode the double quote sign \" to '%22', Java won't do this for us while Postman and Browser do. That's similar to your scenario of bracket characters. It's working now. Cheers&amp;nbsp; &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2019 06:46:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/geocoding-api-only-fails-in-java-code/m-p/303113#M1502</guid>
      <dc:creator>LeiQin</dc:creator>
      <dc:date>2019-07-08T06:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: Geocoding Api only fails in Java code</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/geocoding-api-only-fails-in-java-code/m-p/303114#M1503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Brandon and Lei,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked with the geocoding team and found that the world geocoding service was updated to ArcGIS Server 10.7 in late June and because of security improvements, non-encoded special characters that may have worked before are no longer supported.&amp;nbsp; We apologize for any trouble that this caused&amp;nbsp;to your workflows and will make an effort to provide better preemptive messaging when such changes are put in place in the future.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2019 22:55:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/geocoding-api-only-fails-in-java-code/m-p/303114#M1503</guid>
      <dc:creator>KoryKramer</dc:creator>
      <dc:date>2019-08-12T22:55:07Z</dc:date>
    </item>
  </channel>
</rss>

