<?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: How do I call my SOE using the JS API? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-call-my-soe-using-the-js-api/m-p/25090#M2194</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Yes a query task is not the right class to use. You need to use esriRequest.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html"&gt;request | ArcGIS API for JavaScript 4.15&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/sample-code/request/index.html" title="https://developers.arcgis.com/javascript/latest/sample-code/request/index.html"&gt;Request data from a remote server | ArcGIS API for JavaScript 4.15&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Jul 2020 16:43:58 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2020-07-09T16:43:58Z</dc:date>
    <item>
      <title>How do I call my SOE using the JS API?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-call-my-soe-using-the-js-api/m-p/25089#M2193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an SOE deployed and can call it fine using a browser using the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://10.43.14.44:6443/arcgis/rest/services/Testing/All_Sites_By_DisciplineGeochemistry/MapServer/exts/FeatureCountSOE/findNearbyFeatures?layerId=0&amp;amp;location=%7B%22x%22%3A0%2C%22y%22%3A0%2C%22spatialReference%22%3A%7B%22wkid%22%3A3857%7D%7D&amp;amp;distance=0&amp;amp;f=html"&gt;https://server/arcgis/rest/services/Testing/TestLayer/MapServer/exts/FeatureCountSOE/findNearbyFeatures?layerId=0&amp;amp;location=%7B%22x%22%3A0%2C%22y%22%3A0%2C%22spatialReference%22%3A%7B%22wkid%22%3A3857%7D%7D&amp;amp;distance=10000&amp;amp;f=json&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That works fine and sends a json response with the feature count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I need is to replicate the call above but using the JS API, I have tried a few things but none seem to pass append the REST endpoint with the required parameters (layerId, location and distance), here's what I tried&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;var queryTask = new QueryTask({&lt;BR /&gt;&amp;nbsp; &amp;nbsp; url: &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;"https://server/arcgis/rest/services/Testing/TestLayer/MapServer/exts/FeatureCountSOE/findNearbyFeatures",&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;layerId: 0,&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;distance: 10000,&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;location: "{'x':0,'y':0,'spatialReference':{'wkid':3857}}",&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;f: "json"&lt;BR /&gt; });&lt;BR /&gt; &lt;BR /&gt; var query = new Query();&lt;BR /&gt; query.outFields = ["*"];&lt;BR /&gt; queryTask.execute(query).then(function(results){&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;alert(results);&lt;BR /&gt; });&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Am I way off the mark?&amp;nbsp; Feels like it &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2020 16:39:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-call-my-soe-using-the-js-api/m-p/25089#M2193</guid>
      <dc:creator>chrisweaves</dc:creator>
      <dc:date>2020-07-09T16:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I call my SOE using the JS API?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-call-my-soe-using-the-js-api/m-p/25090#M2194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Yes a query task is not the right class to use. You need to use esriRequest.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html"&gt;request | ArcGIS API for JavaScript 4.15&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/sample-code/request/index.html" title="https://developers.arcgis.com/javascript/latest/sample-code/request/index.html"&gt;Request data from a remote server | ArcGIS API for JavaScript 4.15&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2020 16:43:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-call-my-soe-using-the-js-api/m-p/25090#M2194</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-07-09T16:43:58Z</dc:date>
    </item>
  </channel>
</rss>

