<?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: Loading a map layer behind corporate proxy using ArcGIS Maps .Net for Android / MAUI / .Net 6.0 in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/loading-a-map-layer-behind-corporate-proxy-using/m-p/1277244#M11770</link>
    <description>&lt;P&gt;I've attached an example project which replicates the issue (and also shows .Net's HttpClient functioning).&lt;/P&gt;&lt;P&gt;To replicate:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; Configure a corporate proxy&lt;BR /&gt;2.&amp;nbsp; Open the solution and select Windows as a launch target&lt;BR /&gt;3.&amp;nbsp; Click the button.&amp;nbsp; You will get a popup which has the first 100 characters from the services JSON.&lt;BR /&gt;4.&amp;nbsp; The map layer loads fine&lt;BR /&gt;5.&amp;nbsp; Switch to Android as the launch target.&lt;BR /&gt;6.&amp;nbsp; Click the button.&amp;nbsp; You will get a popup which has the first 100 characters from the services JSON.&lt;BR /&gt;7.&amp;nbsp; This time the map layer will not load, and instead you'll get an exception displayed on screen.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Running the same code without a corporate proxy in place has no issue at all.&amp;nbsp; The exception only happens when behind a proxy and executing on Android.&amp;nbsp; Just to reiterate, I have configured the AndroidWifi to use the proxy; Chrome or Youtube pull data fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how we are creating our HttpClient instance:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;System.Net.Http.HttpClient HttpClientInstance;&lt;BR /&gt;HttpClientHandler handler = new HttpClientHandler();&lt;BR /&gt;handler.ClientCertificateOptions = ClientCertificateOption.Manual;&lt;BR /&gt;// Ignore certificate issues for the moment&lt;BR /&gt;handler.ServerCertificateCustomValidationCallback = (httpRequestMessage, cert, cetChain, policyErrors) =&amp;gt; { return true; };&lt;BR /&gt;HttpClientInstance = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) };&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And this is how we fetch data using the HttpClient:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;HttpResponseMessage response = await HttpClientInstance.GetAsync(servicesURL + "?f=pjson");&lt;BR /&gt;rawData = await response.Content.ReadAsByteArrayAsync();&lt;BR /&gt;encoding = System.Text.Encoding.UTF8;&lt;BR /&gt;string mapServerJSON = encoding.GetString(rawData);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Tue, 11 Apr 2023 12:28:36 GMT</pubDate>
    <dc:creator>SnailsPace</dc:creator>
    <dc:date>2023-04-11T12:28:36Z</dc:date>
    <item>
      <title>Loading a map layer behind corporate proxy using ArcGIS Maps .Net for Android / MAUI / .Net 6.0</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/loading-a-map-layer-behind-corporate-proxy-using/m-p/1273248#M11758</link>
      <description>&lt;P&gt;I am unable to load a map layer using ArcGIS Map 200.0 for MAUI under Android, while behind a corporate proxy.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have configured AndroidWifi to use the proxy, and verified it works by using Chrome to load a remote website.&amp;nbsp; Additionally, I can fetch the services json using .Net's HttpClient without issue (ie: &lt;A href="https://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer?f=pjson" target="_blank" rel="noopener"&gt;https://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer?f=pjson&lt;/A&gt;).&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, attempting to load a layer will throw an exception:&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;System.Net.Sockets.SocketException (0xFFFDFFFF): hostname nor servname provided, or not known&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;This exception does not occur if I run the same code (and connect to the same service) when NOT behind a proxy.&amp;nbsp; The layer will load without issue.&lt;/P&gt;&lt;P&gt;Even though it appears that .Net works with the configured proxy settings, my assumption is that I am not configuring ArcGIS Maps to use the proxy somehow.&lt;/P&gt;&lt;P&gt;Could someone enlighten me on how to do this?&amp;nbsp; I have searched the documentation, but appear to be missing it entirely.&lt;/P&gt;&lt;P&gt;(Interestingly, I do not have this issue using ArcGIS Maps with .Net 6.0 under Windows and WPF.)&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 19:56:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/loading-a-map-layer-behind-corporate-proxy-using/m-p/1273248#M11758</guid>
      <dc:creator>SnailsPace</dc:creator>
      <dc:date>2023-03-29T19:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Loading a map layer behind corporate proxy using ArcGIS Maps .Net for Android / MAUI / .Net 6.0</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/loading-a-map-layer-behind-corporate-proxy-using/m-p/1276962#M11768</link>
      <description>&lt;P&gt;&amp;gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;Additionally, I can fetch the services json using .Net's HttpClient without issue (ie:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Could you share the specific code you use to do that? It might give us some hints what is different between the Maps SDK's web stack and yours.&lt;/P&gt;&lt;P&gt;.NET 6 is using the SocketsHttpHandler, so try also with a few clients configured like this:&lt;BR /&gt;var client1 = new HttpClient(new SocketsHttpHandler());&lt;BR /&gt;or&lt;BR /&gt;var client2 = new HttpClient(new Esri.ArcGISRuntime.Http.ArcGISHttpMessageHandler());&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2023 15:39:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/loading-a-map-layer-behind-corporate-proxy-using/m-p/1276962#M11768</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2023-04-10T15:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: Loading a map layer behind corporate proxy using ArcGIS Maps .Net for Android / MAUI / .Net 6.0</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/loading-a-map-layer-behind-corporate-proxy-using/m-p/1277244#M11770</link>
      <description>&lt;P&gt;I've attached an example project which replicates the issue (and also shows .Net's HttpClient functioning).&lt;/P&gt;&lt;P&gt;To replicate:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; Configure a corporate proxy&lt;BR /&gt;2.&amp;nbsp; Open the solution and select Windows as a launch target&lt;BR /&gt;3.&amp;nbsp; Click the button.&amp;nbsp; You will get a popup which has the first 100 characters from the services JSON.&lt;BR /&gt;4.&amp;nbsp; The map layer loads fine&lt;BR /&gt;5.&amp;nbsp; Switch to Android as the launch target.&lt;BR /&gt;6.&amp;nbsp; Click the button.&amp;nbsp; You will get a popup which has the first 100 characters from the services JSON.&lt;BR /&gt;7.&amp;nbsp; This time the map layer will not load, and instead you'll get an exception displayed on screen.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Running the same code without a corporate proxy in place has no issue at all.&amp;nbsp; The exception only happens when behind a proxy and executing on Android.&amp;nbsp; Just to reiterate, I have configured the AndroidWifi to use the proxy; Chrome or Youtube pull data fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how we are creating our HttpClient instance:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;System.Net.Http.HttpClient HttpClientInstance;&lt;BR /&gt;HttpClientHandler handler = new HttpClientHandler();&lt;BR /&gt;handler.ClientCertificateOptions = ClientCertificateOption.Manual;&lt;BR /&gt;// Ignore certificate issues for the moment&lt;BR /&gt;handler.ServerCertificateCustomValidationCallback = (httpRequestMessage, cert, cetChain, policyErrors) =&amp;gt; { return true; };&lt;BR /&gt;HttpClientInstance = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) };&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And this is how we fetch data using the HttpClient:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;HttpResponseMessage response = await HttpClientInstance.GetAsync(servicesURL + "?f=pjson");&lt;BR /&gt;rawData = await response.Content.ReadAsByteArrayAsync();&lt;BR /&gt;encoding = System.Text.Encoding.UTF8;&lt;BR /&gt;string mapServerJSON = encoding.GetString(rawData);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 11 Apr 2023 12:28:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/loading-a-map-layer-behind-corporate-proxy-using/m-p/1277244#M11770</guid>
      <dc:creator>SnailsPace</dc:creator>
      <dc:date>2023-04-11T12:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: Loading a map layer behind corporate proxy using ArcGIS Maps .Net for Android / MAUI / .Net 6.0</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/loading-a-map-layer-behind-corporate-proxy-using/m-p/1277287#M11772</link>
      <description>&lt;P&gt;Just tested SocketsHttpHandler and ArcGISHttpMessageHandler (instead of HttpClientHandler)...&amp;nbsp; Both of those fail on Android while behind a corporate proxy (but work fine when not behind the proxy).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 13:55:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/loading-a-map-layer-behind-corporate-proxy-using/m-p/1277287#M11772</guid>
      <dc:creator>SnailsPace</dc:creator>
      <dc:date>2023-04-11T13:55:15Z</dc:date>
    </item>
  </channel>
</rss>

