Select to view content in your preferred language

Did Esri change their Print Service Specifications in 10.6 / the ArcGIS Online Update?

2617
5
Jump to solution
04-18-2018 04:52 AM
by Anonymous User
Not applicable

This is more rhetorical than anything else I suppose, but it looks like something changed in the Export Web Map task within Print Services. After April 11th, when AGOL was updated, my jobs that called the utility print service that AGOL uses stopped working.

While the specifications between one of the older releases (10.1 (ArcGIS Help 10.1) and the recent most (10.6 (ExportWebMap specification—Documentation (10.5) | ArcGIS Enterprise) look identical, I've noticed some of my custom Export Web Map tasks that construct the JSON are now failing against AGOL's print service. I also tried this against 10.6 (Task: Export Web Map Task (and AGOL's URL, for anyone interested is here: Execute Task (Export Web Map Task)).

I've attached my constructed JSON that's being passed.

This JSON continues to function against older releases: Execute Task (Export Web Map Task) -10.3.

Anyone else seeing this? Or potentially I'm missing something.

{
  "mapOptions": {
    "showAttribution": false,
    "extent": {
      "xmin": -8996499.567087685,
      "ymin": 4168376.3988337093,
      "xmax": -8994399.937466921,
      "ymax": 4170069.9567416976,
      "spatialReference": { "wkid": 102100 }
    },
    "spatialReference": { "wkid": 102100 },
    "scale": 9027.977411002823
  },
  "operationalLayers": [
    {
      "id": "defaultBasemap",
      "title": "defaultBasemap",
      "opacity": 1,
      "minScale": 1155581.108577,
      "maxScale": 282.124294,
      "url": "http://maps.ci.charlotte.nc.us/arcgis/rest/services/WEB/BaseMap/MapServer"
    },
    {
      "id": "StreetClosuresNianweiTest_4411",
      "title": "StreetClosuresNianweiTest_4411",
      "opacity": 1,
      "minScale": 0,
      "maxScale": 0,
      "layerDefinition": {
        "drawingInfo": {
          "renderer": {
            "type": "uniqueValue",
            "field1": "FULLCLOSE",
            "field2": null,
            "field3": null,
            "fieldDelimiter": ", ",
            "defaultSymbol": null,
            "defaultLabel": null,
            "uniqueValueInfos": [
              {
                "symbol": {
                  "color": [ 255, 0, 0, 255 ],
                  "width": 3,
                  "type": "esriSLS",
                  "style": "esriSLSSolid"
                },
                "value": "Yes",
                "label": "Full Closure",
                "description": ""
              },
              {
                "symbol": {
                  "color": [ 169, 0, 230, 255 ],
                  "width": 2,
                  "type": "esriSLS",
                  "style": "esriSLSSolid"
                },
                "value": "No",
                "label": "Lane Closure",
                "description": ""
              }
            ]
          }
        }
      },
      "url": "http://services.arcgis.com/9Nl857LBlQVyzq54/ArcGIS/rest/services/StreetClosuresAndDetours/FeatureSer..."
    },
    {
      "id": "map_graphics",
      "opacity": 1,
      "minScale": 0,
      "maxScale": 0,
      "featureCollection": { "layers": [ ] }
    }
  ],
  "exportOptions": {
    "outputSize": [ 670, 500 ],
    "dpi": 96
  }
}
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

Kelly Hutchins‌, Daniel Urbach‌, Derek Law‌ (cc'd in case this is relevant to y'all)

Found the issue: apparently, starting in 10.6, print services can't accept formatted JSON anymore.

Using the AGOL print utility (https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%...) to print one of the default Esri basemaps (https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer), I've detailed the steps to reproduce.

If you input the following for the following fields manually (or just use this GET URL (https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%... 😞

 

 Web Map as JSON: 

{"mapOptions":{"showAttribution":false,"extent":{"xmin":-9188433.447264595,"ymin":4078001.238695625,"xmax":-8736843.484155992,"ymax":4346753.830146175,"spatialReference":{"wkid":102100,"latestWkid":3857}},"spatialReference":{"wkid":102100,"latestWkid":3857},"scale":1155581.108577},"operationalLayers":[{"id":"World_Street_Map_417","title":"World_Street_Map_417","opacity":1,"minScale":0,"maxScale":0,"url":"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"}],"exportOptions":{"outputSize":[946,575],"dpi":96}} 

Format:

png32

Layout Template:

map_only

The print job works like a charm with the unformatted / blocked JSON, however, if you format the JSON, the job will fail with an "invalid JSON" error. :

Web Map as JSON:

{
   "mapOptions":{
      "showAttribution":false,
      "extent":{
         "xmin":-9188433.447264595,
         "ymin":4078001.238695625,
         "xmax":-8736843.484155992,
         "ymax":4346753.830146175,
         "spatialReference":{
            "wkid":102100,
            "latestWkid":3857
         }
      },
      "spatialReference":{
       "wkid":102100,
       "latestWkid":3857
      },
      "scale":1155581.108577
   },
   "operationalLayers":[
      {
         "id":"World_Street_Map_417",
         "title":"World_Street_Map_417",
         "opacity":1,
         "minScale":0,
         "maxScale":0,
         "url":"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
      }
   ],
   "exportOptions":{
   "outputSize":[
      946,
      575
      ],
      "dpi":96
   }
}

Format:

png32

Layout Template:

map_only

Same behavior exists against sampleserver6 :

Execute Task (Export Web Map Task) <-- fails 

Execute Task (Export Web Map Task)  <-- works 

Even using the single-tab format shown on the Esri Documentation Site fails: 

Execute Task (Export Web Map Task)  

Can anyone confirm that formatting JSON yields an "invalid JSON" error at 10.6 for them as well? Seems like a pretty significant problem.

Also, here is the formatted request successfully processed against:

10.5.1 

 https://wildfire.cr.usgs.gov/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Ma...  

View solution in original post

5 Replies
by Anonymous User
Not applicable

khutchins-esristaff‌ , https://community.esri.com/community/developers/web-developers/arcgis-api-for-javascript‌ -- any insight on if/how the specifications have changed?

Thanks in advance!

0 Kudos
by Anonymous User
Not applicable

Kelly Hutchins‌, Daniel Urbach‌, Derek Law‌ (cc'd in case this is relevant to y'all)

Found the issue: apparently, starting in 10.6, print services can't accept formatted JSON anymore.

Using the AGOL print utility (https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%...) to print one of the default Esri basemaps (https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer), I've detailed the steps to reproduce.

If you input the following for the following fields manually (or just use this GET URL (https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%... 😞

 

 Web Map as JSON: 

{"mapOptions":{"showAttribution":false,"extent":{"xmin":-9188433.447264595,"ymin":4078001.238695625,"xmax":-8736843.484155992,"ymax":4346753.830146175,"spatialReference":{"wkid":102100,"latestWkid":3857}},"spatialReference":{"wkid":102100,"latestWkid":3857},"scale":1155581.108577},"operationalLayers":[{"id":"World_Street_Map_417","title":"World_Street_Map_417","opacity":1,"minScale":0,"maxScale":0,"url":"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"}],"exportOptions":{"outputSize":[946,575],"dpi":96}} 

Format:

png32

Layout Template:

map_only

The print job works like a charm with the unformatted / blocked JSON, however, if you format the JSON, the job will fail with an "invalid JSON" error. :

Web Map as JSON:

{
   "mapOptions":{
      "showAttribution":false,
      "extent":{
         "xmin":-9188433.447264595,
         "ymin":4078001.238695625,
         "xmax":-8736843.484155992,
         "ymax":4346753.830146175,
         "spatialReference":{
            "wkid":102100,
            "latestWkid":3857
         }
      },
      "spatialReference":{
       "wkid":102100,
       "latestWkid":3857
      },
      "scale":1155581.108577
   },
   "operationalLayers":[
      {
         "id":"World_Street_Map_417",
         "title":"World_Street_Map_417",
         "opacity":1,
         "minScale":0,
         "maxScale":0,
         "url":"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
      }
   ],
   "exportOptions":{
   "outputSize":[
      946,
      575
      ],
      "dpi":96
   }
}

Format:

png32

Layout Template:

map_only

Same behavior exists against sampleserver6 :

Execute Task (Export Web Map Task) <-- fails 

Execute Task (Export Web Map Task)  <-- works 

Even using the single-tab format shown on the Esri Documentation Site fails: 

Execute Task (Export Web Map Task)  

Can anyone confirm that formatting JSON yields an "invalid JSON" error at 10.6 for them as well? Seems like a pretty significant problem.

Also, here is the formatted request successfully processed against:

10.5.1 

 https://wildfire.cr.usgs.gov/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Ma...  

TanuHoque
Esri Regular Contributor

Unfortunately this is a known limit that we are aware of.

ArcGIS client APIs such JS API or client like Web App Builder sends unformatted jsons to print services -- therefore you'll not run into this issue when you use those clients.

0 Kudos
by Anonymous User
Not applicable

Unfortunately for many of us, we construct our own JSON from derived inputs as formatted -- sending block makes the code a lot less user-friendly. Esri Support is logging a bug for this now -- hopefully it can be addressed quickly, as this will keep us at an earlier version given the number of custom apps we have deployed

0 Kudos
by Anonymous User
Not applicable

BUG-000113849 : The Export Web Map task within Print Service fails if the JSON is formatted.

Feel free to open cases up and attach yourself to the problem so that this can get prioritized accordingly!

0 Kudos