<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: arcpy Service Layer doesn't support Service Properties in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-service-layer-doesn-t-support-service/m-p/62422#M5039</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;BTW, for your records, the tracking number for the aforementioned bug is NIM092553.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Jun 2013 17:27:46 GMT</pubDate>
    <dc:creator>JeffMoulds</dc:creator>
    <dc:date>2013-06-20T17:27:46Z</dc:date>
    <item>
      <title>arcpy Service Layer doesn't support Service Properties</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-service-layer-doesn-t-support-service/m-p/62419#M5036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've got a mxd that only contains ArcGIS MapServices :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I'm like :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
for myLyr in arcpy.mapping.ListLayers(mxd):
&amp;nbsp;&amp;nbsp;&amp;nbsp; print ("Is this service layer ? : " + str(myLyr.isServiceLayer))
&amp;nbsp;&amp;nbsp;&amp;nbsp; print ("Does it support service properties ? : " + str(myLyr.supports("SERVICEPROPERTIES")))
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then I get :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;Is this service layer ? : True&lt;BR /&gt;Does it support service properties ? : False&lt;BR /&gt;Is this service layer ? : True&lt;BR /&gt;Does it support service properties ? : False&lt;BR /&gt;Is this service layer ? : True&lt;BR /&gt;Does it support service properties ? : False&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In ArcGIS help center, from the Layer class,&amp;nbsp; I read :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;serviceProperties &lt;/STRONG&gt;&lt;SPAN&gt;: "Provides access to connection information for ArcSDE and web service layers. etc"&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;isServiceLayer &lt;/STRONG&gt;&lt;SPAN&gt;: "Returns True if a layer is a GIS service layer. GIS services are automated geographic information services that are published and accessed over the web using standard technologies and protocols."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can someone highlight me about this flagrant contradiction ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 07:39:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-service-layer-doesn-t-support-service/m-p/62419#M5036</guid>
      <dc:creator>SchoppMatthieu</dc:creator>
      <dc:date>2013-06-20T07:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy Service Layer doesn't support Service Properties</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-service-layer-doesn-t-support-service/m-p/62420#M5037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I didn't explain the whole context :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to get the service layer properties from a map document created from the "ConvertWebMapToMapDocument" function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I manually had a service layer into a map document and then run the script above, then it works. The top node of the serviceLayer supports "serviceProperties"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However if I run the same script against a mxd that have been generated from the "ConvertWebMapToMapDocument" then the top node of the serviceLayer doesn't seem to be recognized as the ServiceLayer root and doesn't supports "serviceProperties".&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 11:09:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-service-layer-doesn-t-support-service/m-p/62420#M5037</guid>
      <dc:creator>SchoppMatthieu</dc:creator>
      <dc:date>2013-06-20T11:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy Service Layer doesn't support Service Properties</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-service-layer-doesn-t-support-service/m-p/62421#M5038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We have a bug with Layer.supports("SERVICEPROPERTIES") not working for all types of service layers, and this is what you are hitting.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When searching for service layers in a map document returned from ConvertWebMapToMapDocument, use Layer.isServiceLayer, like in this &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/#/Tutorial_Basic_high_quality_web_map_printing_exporting_using_arcpy_mapping/0057000000mr000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;tutorial&lt;/A&gt;&lt;SPAN&gt;. For example:&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
import os
import uuid

# Input WebMap json
Web_Map_as_JSON = arcpy.GetParameterAsText(0)

# The template location in the server data store
templateMxd = '//MyComputer/MyDataStore/BasicTutorial/LG_062912_10.1/LG_062912_10.1/LGIM_World_Topo_Map_v1.5.mxd'
&amp;nbsp;&amp;nbsp; 
# Convert the WebMap to a map document
result = arcpy.mapping.ConvertWebMapToMapDocument(Web_Map_as_JSON, templateMxd)
mxd = result.mapDocument

# Reference the data frame that contains the webmap
# Note: ConvertWebMapToMapDocument renames the active dataframe in the template_mxd to "Webmap"
df = arcpy.mapping.ListDataFrames(mxd, 'Webmap')[0]

# Remove the service layer
# This will just leave the vector layers from the template
for lyr in arcpy.mapping.ListLayers(mxd, data_frame=df):
&amp;nbsp;&amp;nbsp;&amp;nbsp; if lyr.isServiceLayer:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.RemoveLayer(df, lyr)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
# Use the uuid module to generate a GUID as part of the output name
# This will ensure a unique output name
output = 'WebMap_{}.pdf'.format(str(uuid.uuid1()))
Output_File = os.path.join(arcpy.env.scratchFolder, output)

# Export the WebMap
arcpy.mapping.ExportToPDF(mxd, Output_File) 

# Set the output parameter to be the output file of the server job
arcpy.SetParameterAsText(1, Output_File)

# Clean up - delete the map document reference
filePath = mxd.filePath
del mxd, result
os.remove(filePath)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:23:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-service-layer-doesn-t-support-service/m-p/62421#M5038</guid>
      <dc:creator>JeffMoulds</dc:creator>
      <dc:date>2021-12-10T22:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy Service Layer doesn't support Service Properties</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-service-layer-doesn-t-support-service/m-p/62422#M5039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;BTW, for your records, the tracking number for the aforementioned bug is NIM092553.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 17:27:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-service-layer-doesn-t-support-service/m-p/62422#M5039</guid>
      <dc:creator>JeffMoulds</dc:creator>
      <dc:date>2013-06-20T17:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy Service Layer doesn't support Service Properties</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-service-layer-doesn-t-support-service/m-p/62423#M5040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, thank you for your answer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jun 2013 12:44:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-service-layer-doesn-t-support-service/m-p/62423#M5040</guid>
      <dc:creator>SchoppMatthieu</dc:creator>
      <dc:date>2013-06-21T12:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy Service Layer doesn't support Service Properties</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-service-layer-doesn-t-support-service/m-p/62424#M5041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I can not find these NIM in the issues list for 10.2.1. (&lt;/SPAN&gt;&lt;A href="http://downloads.esri.com/support/downloads/other_/1021-IssuesAddressedList.pdf"&gt;http://downloads.esri.com/support/downloads/other_/1021-IssuesAddressedList.pdf&lt;/A&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there another way to query mapservice Information using arcpy? I need to find out the URL of a arcgis server layer inside a mxd.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2013 04:47:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-service-layer-doesn-t-support-service/m-p/62424#M5041</guid>
      <dc:creator>MarkusSchenardi</dc:creator>
      <dc:date>2013-12-17T04:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy Service Layer doesn't support Service Properties</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-service-layer-doesn-t-support-service/m-p/62425#M5042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm looking for a workaround for this, too. Given the MXD that was created from the webmap json, how can I get the URL for a service layer? It seems so simple, but I'm so stuck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 19:09:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-service-layer-doesn-t-support-service/m-p/62425#M5042</guid>
      <dc:creator>deleted-user-Jie3eyjOl9XM</dc:creator>
      <dc:date>2014-09-04T19:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy Service Layer doesn't support Service Properties</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-service-layer-doesn-t-support-service/m-p/62426#M5043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We used the following workaround:&lt;/P&gt;&lt;P&gt;1) in the webapplication, extend the printtask and set layername or id = service-URL.&lt;/P&gt;&lt;P&gt;2) in the pythonscript: take the serviceurl from the name attribute&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2014 11:02:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-service-layer-doesn-t-support-service/m-p/62426#M5043</guid>
      <dc:creator>MarkusSchenardi</dc:creator>
      <dc:date>2014-09-05T11:02:30Z</dc:date>
    </item>
  </channel>
</rss>

