Hello, I'm attempting to get the Print Widget functioning with some secured layers hosted on AGOL but am running into some difficulty getting this to work. We have several feature layers that we've created (a mix of both points and polygons) and if any of them are turned on, the print widget fails:
{ "error": { "code": 400, "extendedCode": -2147467261, "message": "Unable to complete operation.", "details": ["Error executing tool. Export Web Map Task : Failed to create layer from service at https://services8.arcgis.com/redacted/arcgis/rest/services/redacted/FeatureServer/0.\nFailed to execute (Export Web Map).\nFailed to execute (Export Web Map Task)."] } }
The strange this is that the print widget DOES work as expected with various Esri provided "premium" layers such as Tapestry Segmentation, Population Density, etc.
It seems like it should be possible to get this print service to work with AGOL secured services, since it works withe the Esri premium layers but this one has me baffled. If anybody has any insight into this, it'd be appreciated.
Thanks.
Relavent code snippets:
Print Widget
const print = new Print({
view: this.view,
printServiceUrl: 'https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export Web Map Task',
});
this.view.ui.add(print, 'top-right');
Feature Layer
import FeatureLayer from 'esri/layers/FeatureLayer';
import popupTemplate from '../../helpers/redacted';
const fLayer = new FeatureLayer({
url: 'https://services8.arcgis.com/redacted/arcgis/rest/services/redacted/FeatureServer/0',
outFields: ['*'],
title: 'redacted',
opacity: 1.0,
visible: false,
popupTemplate: popupTemplate
});
export default fLayer;
This is observed in MacOS, Chrome 67. I'm using the Esri js cli version 4.7 and Typescript.
Hi Todd,
Is the print widget you are working with the default print service available with ArcGIS Online? If so, you may need to setup your own print service from an on premise ArcGIS Server. To determine the service used go to Organization > Settings > Utility Services. If the Print widget displays "default". Then you are using the default AGOL print service. Next would be a quick test to confirm if this issue is related to your secured data.Try printing content from your org that is public. If that succeeds then it is safe to say that the default print service cannot access your secure data. In which case using an on premise ArcGIS Server custom print service would be the work around. Documentation for doing so is located here: Configure utility services—ArcGIS Online Help | ArcGIS .
Yes it is using the default print service. Unfortunately there is no ArcGIS Server instance available that we could use for a custom print service.
I was under the impression that if the various secured Esri premium layers worked with the widget then our own layers would work as well. In fact, I can setup an app using the web app builder in AGOL and the print widget works as expected with our secured layers so it seems like I'm missing something here in the config.