Adding Map Service to WAB

8960
35
03-05-2015 02:33 PM
StevenCathcart
New Contributor

I published a map service from ArcMap to my company's Server. I added this service to AGOL account. Next, I created a web map in AGOL that displays the symbolized map service. However, when I choose this web map in the App Builder, it does not display. The App Builder will load for a few seconds, then display only the basemap.

I've been able to successfully use a feature service in this way (add it to a Web Map and reference the web map in the App Builder), but I can't seem to do this for a map service. Is this possible with Map Services, or is this only for feature services?

0 Kudos
35 Replies
MichaelRobb
Occasional Contributor III

this is very bizarre.  I decided to step back and break it all down and just make it work...

why cant I even add this to ArcGIS Online Web Map (below)?  Add >> Add layer from Web >>

http://xxxxxxxxx:6080/arcgis/rest/services/SampleWorldCities/MapServer

wow, I must be too tired to see what Im missing...

0 Kudos
JunshanLiu
Occasional Contributor III

Because your organization SSL only is checked, but this http://gis.arrayis.ca:6080/arcgis/rest/services/SampleWorldCities/MapServer service doesn't support HTTPS, so it can't be added into map. You can try to open https://gis.arrayis.ca:6080/arcgis/rest/services/SampleWorldCities/MapServer you'll get en error.

JunshanLiu
Occasional Contributor III

HTTP request is not allowed in a HTTPS page.

MichaelRobb
Occasional Contributor III

yes, that is correct.. Organizational setting was HTTPS only.  So yea, that is why I could not add the service.

I have definitely been up too long. lol.

Yes I understand 6080 is not HTTPS supported... that 6443 is.

All this ^^ is really not my main concern (only been up for 20 hrs doesnt help), my main issue was the prompt not showing up in WAB and the large post someone has yet to answer

0 Kudos
JunshanLiu
Occasional Contributor III

Could you switch to JavaScript API 3.14 to have a try? Because I found an issue, which has been fixed in 3.14, it's very similar to yours, and this issue is cause by JavaScript API. The issue is:

BUG-000087135 Web AppBuilder applications fail to load secured services in web maps that do not have credentials stored. No prompt is given for credentials, simply the layer fails to load and a HTTP 498 response is returned from the request for the layer.

0 Kudos
MichaelRobb
Occasional Contributor III

Hi,

how does one 'switch' to using JavaScript API via Web App builder? or are you suggesting to write up a web application from scratch using JavaScript?

Do you perhaps have the official NIMBUS (NIM) number for this bug OR a link ? I am unable to find BUG-000087135.

0 Kudos
JunshanLiu
Occasional Contributor III

There is a variable in env.js in you app folder, called "apiUrl", make this variable points to "//js.arcgis.com/3.14"

MichaelRobb
Occasional Contributor III

Okay, thank you!  I will give that a try but I have my doubts changing to JS3.14 will work considering it didn't work using Online, I suspect Online is already using 3.14 but will verify again.

I had stated in an earlier post "What is Interesting is that I am not able to add a secure service to ArcGIS Online Web Map either", not until i opened up a separate tab in the browser and manually obtained a token from server.

I still am thinking there is either a) something wrong with the setup I have b) there is a bug c) someone should tell me, 'if I want to use secure services and require Identity popup to appear that I have to ADD a bunch of code to the app'.

have you validated what I am failing to get? Have you yourself tried to add a secure service and see the prompt as shown in earlier screen shots?

I am not using Developer Edition yet, but after reading the documentation there, this is mentioned:

Change URL of ArcGIS API for JavaScript—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for D...

0 Kudos
MichaelRobb
Occasional Contributor III

Ok, some progress.

I managed to get it working without changing the apiUrl, what I believe is happening is that there is some disconnect when https was enabled somewhere in this IT structure....   I have everything HTTP and it now works with secure services.

I did look in the env.js file and saw this:

...pathname,l={version:"3.13",_appBaseUrl:f.protocol+"//"+f.host+l.substr...

so i guess I have version 3.13 on my local machine. I will now point to ESRI 3.14.

I did notice also the apiUrl was pointing to HTTP, that may be the issue as well when using HTTPS .. so i have also made sure to use https://js.arcgis.com/3.14/init.js

0 Kudos
MichaelRobb
Occasional Contributor III

Unfortunately... back to the same situation!!

SSL - https - unable to add layers ... ERROR. I DO NOT GET THE PROMPT as I would when using HTTP.

Simply receive an error 'cannot be added to the map'.   Using HTTPS for portal, having https port 6443 on server...

thoughts?

0 Kudos