I have listed the layers for a map service using the "layers" property on an ArcGISMapService object.
elif lyr.layerType == 'ArcGISMapServiceLayer':
if 'layers' in lyr:
for l2 in lyr.layers:
# print(str(len(lyr.layers)))
print(" >>> "+str(l2.id))
I only get information for 2 layers out of 24. I'm sure this is the right map service, and the 2 layers that I get information for have the same id as they do in the full list I get when I directly check the map service in the portal. I've checked the json directly - only 2 layers are in it.
Obviously, I could be making an error that I can't expect anyone here to diagnose, but I think there is something unusual going on here that someone might recognize as a common newbie mistake? Is this a common problem? Might the map service be corrupted? How would I check that? When I check the map service in the portal, I see all layers listed, and it works fine when it is loaded into a web map.
Bit of a Hail Mary here. Thank you for any help you may be able to provide.
Randy McGregor