laptop and a wrench

Bogue

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

Dernière publication: November 13, 2019 ArcGIS GIS Server
Numéro d’ID de bogue BUG-000126389
EnvoiOctober 29, 2019
Dernière modificationJune 5, 2024
S’applique àArcGIS GIS Server
Version trouvée10.6.1
StatutWill Not Be Addressed

Informations supplémentaires

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

Solution de contournement

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}})

Étapes pour reproduire

ID de bogue: BUG-000126389

Logiciel:

  • ArcGIS GIS Server

Recevoir une notification lorsque le statut d’un bogue change

Télécharger l’application Esri Support

En savoir plus sur ce sujet

Obtenir de l’aide auprès des experts ArcGIS

Contacter le support technique

Télécharger l’application Esri Support

Accéder aux options de téléchargement