<?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: Can´t load data from feature-service in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/can-t-load-data-from-feature-service/m-p/174280#M2000</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm guessing you're using an HTTPS connection to a server with an invalid SSL certificate. You'd need to either fix the certificate, or move to non-https.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Mar 2018 15:53:31 GMT</pubDate>
    <dc:creator>dotMorten_esri</dc:creator>
    <dc:date>2018-03-15T15:53:31Z</dc:date>
    <item>
      <title>Can´t load data from feature-service</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/can-t-load-data-from-feature-service/m-p/174277#M1997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I followed the samples from ESRI (e.g. &lt;A href="https://github.com/Esri/arcgis-runtime-samples-dotnet/blob/master/src/WPF/ArcGISRuntime.WPF.Samples/Samples/Layers/FeatureCollectionLayerFromQuery/FeatureCollectionLayerFromQuery.xaml.cs" rel="nofollow noopener noreferrer" target="_blank"&gt;this one from GitHub&lt;/A&gt;) to enable feature-access to my service and everything worked fine. Next I changed the URL into&amp;nbsp;my own feature-service and provided my crendetials to access that service.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I ended up with the following code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;&lt;SPAN&gt;//var serviceUrl = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fsampleserver6.arcgisonline.com%2Farcgis%2Frest%2Fservices%2FDamageAssessment%2FFeatureServer%2F0" target="_blank"&gt;http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0&lt;/A&gt;&lt;SPAN&gt;";&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; serviceUrl &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fmyhost%2Farcgis%2Frest%2Fservices%2FMyService%2FFeatureServer%2F0" target="_blank"&gt;https://myhost/arcgis/rest/services/MyService/FeatureServer/0&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
ServerInfo serverInfo &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;ServerInfo&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ServerUri &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Uri&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;serviceUrl&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TokenAuthenticationType &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; TokenAuthenticationType&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ArcGISToken&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TokenServiceUri &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Uri&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fmyhost%2Farcgis%2Fadmin%2FgenerateToken" target="_blank"&gt;https://myhost/arcgis/admin/generateToken&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
AuthenticationManager&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Current&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;RegisterServer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;serverInfo&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
AuthenticationManager&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Current&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ChallengeHandler &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;ChallengeHandler&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;async&lt;/SPAN&gt; info &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; AuthenticationManager&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Current&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GenerateCredentialAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;info&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ServiceUri&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; user&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; password&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; info&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GenerateTokenOptions&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; featureTableUri &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;System&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Uri&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;serviceUrl&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; table &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;ServiceFeatureTable&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;featureTableUri&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; queryParameters &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;QueryParameters&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; WhereClause &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"1 = 1"&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
FeatureQueryResult features &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; table&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;QueryFeaturesAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;queryParameters&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/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;When I execute this code I get the&amp;nbsp;following exception on the last line, which doesn´t seem very meaningful to me:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Exception thrown&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'System.InvalidOperationException'&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; mscorlib&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dll
Additional information&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; Cannot call &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt; method &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt; context&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; Object failed to load&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; unable to execute task&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;
‍‍&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I set a breakpoint on the&amp;nbsp;GenerateCredentialAsync-line (line 12) I also notice it´s never hit. So I wonder if the challengehandler is even registered correctly and fires the challenge-event appropriately.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:00:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/can-t-load-data-from-feature-service/m-p/174277#M1997</guid>
      <dc:creator>CarstenSchumann</dc:creator>
      <dc:date>2021-12-11T09:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can´t load data from feature-service</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/can-t-load-data-from-feature-service/m-p/174278#M1998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try calling "await table.LoadAsync()" before you perform your query.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2018 17:28:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/can-t-load-data-from-feature-service/m-p/174278#M1998</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2018-03-14T17:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can´t load data from feature-service</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/can-t-load-data-from-feature-service/m-p/174279#M1999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This seems to push some light into the aactual problem, as I now get a HttpRequestException "The remote certificate is invalid according to the validation process."&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2018 11:22:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/can-t-load-data-from-feature-service/m-p/174279#M1999</guid>
      <dc:creator>CarstenSchumann</dc:creator>
      <dc:date>2018-03-15T11:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Can´t load data from feature-service</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/can-t-load-data-from-feature-service/m-p/174280#M2000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm guessing you're using an HTTPS connection to a server with an invalid SSL certificate. You'd need to either fix the certificate, or move to non-https.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2018 15:53:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/can-t-load-data-from-feature-service/m-p/174280#M2000</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2018-03-15T15:53:31Z</dc:date>
    </item>
  </channel>
</rss>

