How can I access premium services in Web app Builder (for public access) ?

2709
9
10-25-2016 10:59 AM
MuhammadAlmas1
New Contributor II

Web app builder shows premium content access option in "Attribute" tab, with custom URLs that are used in widgets. I want to use create watershed analysis service and let public use certain limit of credits that I have available to my organizational account. 

I have tried different settings here, but nothing seems to be working. I public view of this web app, when ever user clicks on widget for running analysis, ArcGIS Online takes the user to sign in page for my organization.

Has anyone else solved this issue?

Thanks,

Muhammad Almas

0 Kudos
9 Replies
RobertScheitlin__GISP
MVP Emeritus

Muhammad,

   I have not experience using premium content but it just sounds like you have to setup a proxy for your app to use to access your premium content (just like you would for secured service access).

0 Kudos
MuhammadAlmas1
New Contributor II

Hi Robert,

Thanks for you reply. I think you do not need to create proxy for web app builder if you are using it through ArcGISOnline with the hosted services.

Actually when I  add the above mentioned custom URL (GP Service for creating watershed )

(http://analysis7.arcgis.com/arcgis/rest/services/tasks/GPServer/CreateWatersheds/submitJob) (Got link of this url through fiddler), I get this error message, which clearly explains that If failed to create proxy , which means that  AGOL is trying to create proxy.

However if I use this url for Custom urls:

(http://hydro.arcgis.com/arcgis/rest/services/Tools/Hydrology/GPServer/Watershed/submitJob)

AGOL has no issues in creating proxy, but it does not works as expected i.e. do not give

credentials page for public user, and use Organizational credits.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Muhammad,

   Sorry if you do not specify you are using AGOL version I tend to assume you are using Developer version.

Maybe dlaw-esristaff‌ can shed some light on this then.

0 Kudos
MuhammadAlmas1
New Contributor II

Sorry for that misunderstanding.

Since this is relatively new functionality so I wanted to try it first on AGOL, and then with web developer tools.

Thanks.

Sent from my iPhone

0 Kudos
DerekLaw
Esri Esteemed Contributor

Hi Muhammad,

> I want to use create watershed analysis service and let public use certain limit of credits that I have available to my organizational account. 

Yes, this is possible. You will need to add the Premium Service as a new item in your ArcGIS Online organization and save credentials with it. Then share it with everyone. Then copy the item's REST URL (this is located in the lower right corner of the Item Details page, Overview tab) and reference this URL in the Premium content access panel (in your original post screenshot) in Web AppBuilder, as well as the widget that will be using the Premium service.

Help topic: Configure Premium Service 

Once this is enabled, when you share your app - your end users will not be prompted for a login when they attempt to execute the widget.

Hope this helps,

MuhammadAlmas1
New Contributor II

Hi Derek

Thanks for you very informative reply. I have been trying to use it, however I am getting stuck at few issues.

First of all I created the wrapper service just like you said for this ESRI's premium service and set its sharing option to public:

http://hydro.arcgis.com/arcgis/rest/services/Tools/Hydrology/GPServer/Watershed

The wrapper url comes out to be:

https://utility.arcgis.com/usrsvcs/servers/d3ddd7c7271646a180d68af1dcb6bbea/rest/services/Tools/Hydr...

Now in Web app builder (AGSOL), I added a new geoprocessing widget:

And in the url I entered the wrapper url.

Then I selected the option of "interactively drawing on the map" for InputPoints. I left the rest of options as default.

Now When I run this widget I get the dialog and I click on the map and run the execute button.

I may get the result once, but later all I get is this error result, which I have not been able to figure out why it is happening.

I will really appreciate your help in this regard.

I have tried two other methods too, but they also resulted in same error message.

One method was to add url in "Attribute" tab of Web app builder, which actually creates the AGOL hosted proxy service. I tried to use that proxy url in the add widget button, but got the same error window as above.

Second method that I tried was quite similar, but this time instead of adding private content url in "Attribute" tab of Web appbuilder, I directly created the service proxy in ArcGIS for developers page. From the configure new service proxy I selected "hydrology" option and used this proxy url in web app, but unfortunately it also resulted in same error.

Thanks,

Muhammad Almas

0 Kudos
DerekLaw
Esri Esteemed Contributor

Hi Muhammad,

Apologies for the oversight, but I just realized that the Watershed Analysis service you want to add:

http://hydro.arcgis.com/arcgis/rest/services/Tools/Hydrology/GPServer/Watershed

is actually already part of the Analysis widget in Web AppBuilder,

Analysis widget—Web AppBuilder for ArcGIS | ArcGIS 

So you don't have to add/enable it in the Geoprocessing widget, simply select this functionality when you configure the Analysis widget.

Also, since the analysis services in the Analysis widget are creating new data content (behind the scenes when you run the tools), I don't believe you can enable this functionality for public (e.g., anonymous) access. ArcGIS Online requires a specific named account to run these tools so the new data created will be owned by the account that is running the tool. I am checking into this to confirm.

Hope this helps,

0 Kudos
DerekLaw
Esri Esteemed Contributor

Hi Muhammad,

I've gotten confirmation that the analysis services (from ArcGIS Online) in the Analysis widget must be run with a logged in ArcGIS account and cannot be enabled for public access.

Hope this helps,

0 Kudos
MuhammadAlmas1
New Contributor II

Thanks Derek

0 Kudos