How do I get AGSOfflineMapTask to make requests to public-facing urls instead of those behind firewall?

894
2
Jump to solution
09-23-2020 04:07 PM
CoryDavis
New Contributor III

I have an iOS Runtime SDK application (v 100.7) to which I recently added an offline mode which allows the user to select an area of interest on the map and a replica is created including all the feature services. I followed the pattern described in this article if you want to see implementation details.

The AGSOfflineMapTask is created from a web map portal item I created on my company's on-premise Portal (enterprise 10.7.1). We use a  reverse proxy server configured like this diagram. Activating offline mode fails and generates the following error for every service contained in the web map: "A server with the specified hostname could not be found", then gives the url of the internal url rather than the public-facing url outside the firewall.

Error -1003: A server with the specified hostname could not be found

I made sure that the url for the web map portal item supplied to the AGSOfflineMapTask uses the public-facing url, but it seems that the call to start() function makes requests to the internal urls and I don't have a way to change that, so the requests are being blocked by the firewall.

I'm currently relying on a workaround by temporarily changing the hosting server for portal to the dmz url and republishing all the services contained in the map which works, but this is not a good solution because it violates our security policy. I could use a suggestion for a better way of downloading a portion of the map for offline use.

0 Kudos
1 Solution

Accepted Solutions
DiveshGoyal
Esri Regular Contributor

When taking the webmap offline, the task inspects the layer URLs embedded in the webmap to start preparing their data. Are you embedding internal URls in the webmap? If so, that might be problem.
Can you try using public URLs when adding layers to the webmap and see if that resolves the problem?

View solution in original post

2 Replies
DiveshGoyal
Esri Regular Contributor

When taking the webmap offline, the task inspects the layer URLs embedded in the webmap to start preparing their data. Are you embedding internal URls in the webmap? If so, that might be problem.
Can you try using public URLs when adding layers to the webmap and see if that resolves the problem?

CoryDavis
New Contributor III

That turned out to be exactly the problem. My feature services were added using the "Search for Layer" and selected from the portal. The services were published using the hosting server which is behind the firewall. Adding them from the web and entering the pubic facing url worked like a charm.

Thanks so much!

0 Kudos