Just to add to what Michael said at post #15:I think the service name is simply fetched with the name property...but 1st you have to make sure it is service - I think at 10.1, more direct access was provided for that property, meaning you don't have to get it from the serviceProperties dictionary; it is simply isServiceLayer (and of course, if true then get the name).This is a little testing on one of my 10.0 map services, and I think you'll get the picture:
>>> if mapServiceGrp0.supports("SERVICEPROPERTIES"):
... for i, j in mapServiceGrp0.serviceProperties.iteritems():
... print "{0}: {1}".format(i, j)
...
UserName:
ServiceType: MapServer
Connectionfile: C:\Documents and Settings\whitley-wayne\Application Data\ESRI\Desktop10.0\ArcCatalog\mc-gisappserver (admin).ags
URL:
Managerurl: http://mc-gisapperver/arcgis/services
Server: mc-gisappserver
Allowinsecuretokenurl: 0
I could have looked up the ServiceType key directly and identified it as a MapServer...but I need the name, so this:
>>> # This 1st one is an SDE 'service' - have to distinguish between SDE and other supporting service layer...
>>> mm = mapLyrs[0]
>>> mm.name
u'MonroeGISData.DBO.BM_MileMarkers'
>>> # so I could have queried a bit further to get type 'SDE' above...but with DBO in the name I already know.
>>> # This 2nd layer is the map service from 1st code section above - I need the name.
>>> mapServiceGrp0 = mapLyrs[1]
>>> mapServiceGrp0.name
u'MonroeCountySDE_Environmental_Layout'
It should be that simple -- just with 10.1 and above you can readily identify whether a service (and serviceProperties yields more details about that service).Hope that helps,WaynePS- If it shows better what I mean about 'SDE service' vs for example a 'Map Service', see this where I use an identical technique looping through the serviceProperties dictionary:http://forums.arcgis.com/threads/94600-PLEASE-HELP!-Features-do-not-get-updated-in-Geoprocessing-Ser...