Export Web Map Task: Failed to create layer from WMS service

5291
17
06-13-2018 01:04 PM
jackcrawford
Emerging Contributor

I'm using Export Web Map Task from a Java app. The request includes MapServer layer from my ArcGIS 10.5 server and a WMS layer from another domain. I'm not sure why ArcGIS cannot create a layer for the WMS request.

ArcGIS is logging the following:

<Msg time='2018-06-13T15:45:59,973' type='SEVERE' code='20010' target='Utilities/PrintingTools.GPServer' methodName='GPServerSync.CheckMessages' machine='WTGGIS1' process='19928' thread='23592' user='anonymous' >Error executing tool. Export Web Map Task : Layer "MC image": Failed to create layer from service at http://<some domain>.com:8080/geoserver/wms?&SERVICE=WMS&REQUEST=GetMap&VERSION=1.1.1&LAYERS=Postgres%3Abuildings%2CPostgres%3Aparcels%2CPostgres%3Anonnfhl_floodplain&STYLES=&FORMAT=image%2Fpng&TRANSPARENT=true&HEIGHT=653&WIDTH=1448&SRS=EPSG%3A3857&BBOX=-8279556.363820421,4955018.621996873,-8279124.016879315,4955213.89471751.
Failed to execute (Export Web Map).
Failed to execute (Export Web Map Task).</Msg>

The WMS request itself succeeds when executed from a browser.

Attached is the Export Web Map Task Web_Map_as_json. The request specifies:

f=json

Format=PNG8

Layout_Template=MAP_ONLY

Help! Thanks.

0 Kudos
17 Replies
TanuHoque
Esri Regular Contributor

from your attached json, it looks like the url of the layer basically a GetMap request.

can you pls try with http://<some domain>.com:8080/geoserver/wms ?

0 Kudos
jackcrawford
Emerging Contributor

Thanks for replaying Tanu but I don't understand your post.

The layer that is failing is a WMS GetMap request for a PNG image.

The WMS URL in the Export Web Map Task request successfully returns an image when hit from the browser.

0 Kudos
jackcrawford
Emerging Contributor

The task request includes an operational layer definition as follows:

{
"url" : "http://<some domain>.com:8080/geoserver/wms?&SERVICE=WMS&REQUEST=GetMap&VERSION=1.1.1&LAYERS=Postgres%3Abuildings%2CPostgres%3Aparcels%2CPostgres%3Anonnfhl_floodplain&STYLES=&FORMAT=image%2Fpng&TRANSPARENT=true&HEIGHT=653&WIDTH=1448&SRS=EPSG%3A3857&BBOX=-8279556.363820421,4955018.621996873,-8279124.016879315,4955213.89471751",
"title" : "MC image",
"type" : "wms",
"format" : "png8",
"transparentBackground" : true>,

}

0 Kudos
TanuHoque
Esri Regular Contributor

yep, I have noticed that and that is why i'm asking 'did you use the url exactly as it appears in the task request when you added that to your web map?'

the url in the task request is basically invalid.

all the name-value pairs/parameters showing up after ? in the url are not valid

jackcrawford
Emerging Contributor

I took your answer to mean that layer names need to be coded into the Task request instead? 

I tried submitting using the WMS layer as the only the following operational layer and now I'm seeing:


<Msg time='2018-06-13T17:23:24,668' type='SEVERE' code='103800' target='Utilities/PrintingTools.GPServer' machine='WTGGIS1' process='19928' thread='23592' user='anonymous' >MC image: Failed to open raster dataset</Msg>

This is the request:

{
"mapOptions": {
"showAttribution": false,
"extent": {
"xmin": -8279556.363820421,
"ymin": 4955018.621996873,
"xmax": -8279124.016879315,
"ymax": 4955213.89471751,
"spatialReference": {
"wkid": 102100,
"latestWkid": 3857
}
},
"spatialReference": {
"wkid": 102100,
"latestWkid": 3857
},
"scale": 1128.497176
},
"operationalLayers": [
{
"url" : "http://reports.massivecert.com:8080/geoserver/wms",
"title" : "MC image",
"type" : "wms",
"version":"1.1",
"format" : "png8",
"transparentBackground" : true,
"layers" : [
{ name: "Postgres:buildings"},
{ name: "Postgres:parcels"},
{ name: "Postgres:nonnfhl_floodplain"}
]
},

],
"exportOptions": {
"outputSize": [
1448,
653
],
"dpi": 96
}
}

The response contains a URL to an image file with only a white background.

0 Kudos
TanuHoque
Esri Regular Contributor

thanks... 

can you pls try with the following print service?

http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%2...

also, i have noticed that 'name' properties, in 'layers' element inside the json that you attached, are not within a pair of double quotes. is that just a copy/paste error or that is how it is being generated by JS API/the print task?

also, I tried with the above print service with the following json and it worked for me.

{ "mapOptions": { "showAttribution": false, "extent": { "xmin": -8279556.363820421, "ymin": 4955018.621996873, "xmax": -8279124.016879315, "ymax": 4955213.89471751, "spatialReference": { "wkid": 102100, "latestWkid": 3857 } }, "spatialReference": { "wkid": 102100, "latestWkid": 3857 }, "scale": 1128.497176 }, "operationalLayers": [{ "url": "http://reports.massivecert.com:8080/geoserver/wms", "title": "MC image", "type": "wms", "version": "1.1", "format": "png8", "transparentBackground": true, "layers": [{ "name": "Postgres:buildings" }, { "name": "Postgres:parcels" }, { "name": "Postgres:nonnfhl_floodplain" }] }], "exportOptions": { "outputSize": [1448, 653], "dpi": 96 } }

0 Kudos
jackcrawford
Emerging Contributor

Thanks Tanu.

Your JSON with sampleserver6.arcgisonline.com server works to render a correct image (sometimes).

Your JSON on my server emits a blank image (seemingly consistently).

What's with that?

I don't have an issue at all with my server generating images for web maps that include layers from my GIS server.

My server does not need to go thru a proxy to reach external sites.

Thoughts?

0 Kudos
TanuHoque
Esri Regular Contributor

urgh, that might be a bug. I need to dig in further.

what version of ArcGIS Server are you running?

thanks for confirming that it works for you too with sampleserver6 print service.

0 Kudos
jackcrawford
Emerging Contributor

Tanu we are running 10.5.0 on server and adapter. Thanks.

0 Kudos