PrintTask Error with FeatureLayer selection

3283
13
09-10-2012 07:45 PM
ScottDavis3
New Contributor II
Using ArcServer 10.1 and JSAPI 3.1. Printtask works when selection of a featurelayer under a feature service is empty. After a selection is made the follow error occurs:

Layer "graphicsLayer0": Failed to create layer from service at http://darkside:6080/arcgis/rest/services/TheAddresser/YorkCounty_SDE/FeatureServer/0. Failed to execute (ExportWebMap). Failed to execute (Export Web Map).

This feature service is secured. Anyone have any ideas? Sample code below.

        var printTask = new esri.tasks.PrintTask(url);
        var templateP = new esri.tasks.PrintTemplate();
        templateP.format = "PDF";
        templateP.layout = "85x11";
        templateP.preserveScale = true;
        template.layoutOptions = { titleText: '', authorText: "ME", scalebarUnit: 'Feet', legendLayers: [] };
        var params = new esri.tasks.PrintParameters();
        params.outSpatialReference = map.spatialReference;
        params.map = map;
        params.template = templateP;
        printTask.execute(params, function (result) {
            window.open(result.url);
            hideWorking();
        }, function (err) {
            errorWin(err, 'printMap');
        });
0 Kudos
13 Replies
DonCaviness
New Contributor III
I don't see how this sample will help since none of the services in it use a token? I can get non secure services to work, with a selection or not.
0 Kudos
JohnGravois
Frequent Contributor
i was suggesting that you test using our own sample secured service first.  in this application the token is not stored in the application or in a proxy, but rather allows you to authenticate onLoad of the application by passing the credentials user1/user1.

first try printing our sample service, then switch to your own secure service (and after that, your own print service)
0 Kudos
DonCaviness
New Contributor III
Having to sign in will not work in a production environment (tokens are a necessity), but apparently there is an issue with the authentication service running in my instance of ArcGIS Server 10.1.  Up until now I haven't had any issues using secure services.  I will case that error down and see if that resolves the issue.
0 Kudos
CarlosKrefft
Occasional Contributor

Apparently using printing IWA secured services is no longer supported in 10.4.x because of a vulnerability that existed. So instead of fixing the vulnerability the capability was removed. Wonderful.

0 Kudos