Access a webmap with HTTP

438
10
09-10-2018 01:01 PM
JamesSamek
Occasional Contributor

I am trying to access a webmap published by a client and shared to everyone. The data in the webmap is from ArcGIS Server 10.2 and is only available through HTTP. When I use the JavaScript API to load the web map using the portal item id, the call is made using HTTPS. This fails to load the layers, as they cannot be served via HTTPS. Is there any way to make sure the call to load the web map through the JavaScript API uses HTTP and not HTTPS?

10 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

James,

  Change all the JS API urls from https to http in your code.

0 Kudos
JamesSamek
Occasional Contributor

I've confirmed all protocols are HTTP in the API calls. The error is coming back from the webmap, and the calls to load the ArcGIS Server layers are happening over HTTPS.

0 Kudos
KenBuja
MVP Honored Contributor

Is this an organizational account? Configure security settings—ArcGIS Online Help | ArcGIS 

Allow access to the organization through HTTPS onlyHTTPS is enabled by default. Keep this box checked to ensure that your organization's data as well as any temporary identification tokens that allow access to your data are encrypted during communications over the Internet. Uncheck the box to turn off HTTPS.

JamesSamek
Occasional Contributor

It is an organization account. I am not an administrator and I couldn't find anything in the AGO or Portal help regarding this. Would you happen to know where the switch is located?

0 Kudos
KenBuja
MVP Honored Contributor

I'm not an administrator on our account either, so I don't know where the switch is.

0 Kudos
SteveCole
Frequent Contributor

I think the switch you're looking for is under the organization's settings tab as shown below in AGOL. I think you would need to be administrator to change it.

CesarRevilla
New Contributor III

Hi have the same problem. With jsapi version 3.10 works. service info is asked automatically over http. The new versions of the jsapi can only retrieve the layer info over HTTPS.

The server is a public server without HTTPS. I cant change it.

Its possible to force the new JSAPI 3 to retrieve the date over HTTP and no more over HTTPS?

Best Regards,

Cesar Revilla

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Cesar,

   I have not seen this issue in the 3.x API. In 4.x this is a known feature when using the 4.8 API and using a url for your app that has localhost of file:///, intead you have t use IP address or machine name.

CesarRevilla
New Contributor III

Hi Robert, 

please, try to use this service as FeatureLayer with the last 3.x API 

http://geo.serfor.gob.pe:80/geoservicios/rest/services/Prueba/MapServer/4

Im loading an very easy webpage only with a Map and one Service. If a load the page from localhost or from LAN-IP make not a difference.

I would be happy with a client side solution for this issue.

Best Regards,

Cesar Revilla

Update: Thank you Robert, it was the same behavior as in 4.x API. (I think it had another problem with my test with the LAN-IP).
With an IP or with mache name works perfect. From Localhost or from 127.0.0.1 (Localhost-IP) uses the API HTTPS instead HTTP.

solved!

0 Kudos