Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

ConvertWebMapToMapDocument Python Script With Secure Map Services

$
0
0
I've developed a python script for use in a web application, which works fine for public services, but does not work with secure services. I've setup some code in the script to hopefully handle secure services:

serverConnection is a variable, which holds the path to a user connection to the arcgis server
Code:

server = {}
server['SERVER_CONNECTION_FILE'] = serverConnection
result = arcpy.mapping.ConvertWebMapToMapDocument(webmapJSON, templateMxd, extra_conversion_options=server)

So I can publish it to server and print public map services, but secure services come back with this:

Unable to connect to map server at ..."},{"type":"esriJobMessageTypeInformative","description":"Layer \"Licences\": Unable to connect to map server at http://gis.mstn.govt.nz/arcgis/rest/services/RegulatoryAndInspection/Licences/MapServer?token=I-eon3AsL00-hfH4H74iiWQ1t25ARRnpJrofyxvdiaG3ozl_ZXVwc9wBPozzFply8bS9AXyCFrikUZQ6nWW5_w..."},{"


S
o I've setup the tokens to pass in a flex app and the tokens are HTTP Referrer (in fact I've tried lots of different token options but nothing works!). Why does it have this error?

Viewing all articles
Browse latest Browse all 2485

Latest Images

Trending Articles



Latest Images