laptop and a wrench

Bug

The ConvertWebMapToMapDocument function fails to authenticate via a server connection file for certain service types.

Last Published: November 13, 2019 ArcGIS GIS Server
Bug ID Number BUG-000126389
SubmittedOctober 29, 2019
Last ModifiedJune 5, 2024
Applies toArcGIS GIS Server
Version found10.6.1
StatusWill Not Be Addressed

Additional Information

It is strongly recommended to move to a ArcGIS Pro based print service.

Workaround

For secured services, generate a token to supply within the Web Map json. For example:

def get_token(portal, username, password):

  token_url = '%s/sharing/rest/generateToken/' % portal

  params = {'f': 'json', 'username': username, 'password': password, 'client' : 'referer','referer': portal}

  req = urllib2.Request(token_url, urllib.urlencode(params))

  try:

    response = urllib2.urlopen(req)

  except:

    context = ssl._create_unverified_context()

    response = urllib2.urlopen(req, context=context)

  token = str(json.load(response)['token'])

  return token

username = "siteadmin"

password = "siteadmin"

portal = "https://earl.esri.com/portal"

token = get_token(portal, username, password)

webmap_json = str({"mapOptions":{"showAttribution":False,"extent":{"xmin":-13528474.13135027,"ymin":4075245.077838606,"xmax":-13076884.168241667,"ymax":4219558.18724095,"spatialReference":{"wkid":102100,"latestWkid":3857}},"spatialReference":{"wkid":102100,"latestWkid":3857},"scale":1155581.108577},"operationalLayers":[{"id":"asterPrint_9733","title":"asterPrint_9733","opacity":1,"minScale":0,"maxScale":0,"url":"https://emedina1.esri.com/image/rest/services/asterPrint/ImageServer", "token":token}],"exportOptions":{"outputSize":[746,575],"dpi":96}})

Steps to Reproduce

Bug ID: BUG-000126389

Software:

  • ArcGIS GIS Server

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options