<?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 Could not load service: MapServer in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/could-not-load-service-mapserver/m-p/1569953#M10978</link>
    <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I'm trying to get a list of fields from all the services inside a folder in ArcGIS Server using Python API.&lt;/P&gt;&lt;P&gt;But when I want to list my services, all the MapServer gives &lt;FONT color="#FF0000"&gt;Could not load service: &amp;lt;serviceURL&amp;gt;/MapServer&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;This is the code I'm using with a ServicesDirectory Object.&lt;/FONT&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;server_url = "https://&amp;lt;webadaptorserver&amp;gt;"
portal_url = "https://&amp;lt;webadaptorportal&amp;gt;"
usuario = "admin"
contraseña = "password"
gis = GIS(portal_url, usuario, contraseña)

gisSD= server.catalog.ServicesDirectory(url=server_url,tokenurl=gis._con.token)

servfolder="MYFOLDER"
servicios=gisSD.list(folder=servfolder)
for s in servicios:
    print (s)
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Dec 2024 20:25:07 GMT</pubDate>
    <dc:creator>Leandro-Zamudio</dc:creator>
    <dc:date>2024-12-18T20:25:07Z</dc:date>
    <item>
      <title>Could not load service: MapServer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/could-not-load-service-mapserver/m-p/1569953#M10978</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I'm trying to get a list of fields from all the services inside a folder in ArcGIS Server using Python API.&lt;/P&gt;&lt;P&gt;But when I want to list my services, all the MapServer gives &lt;FONT color="#FF0000"&gt;Could not load service: &amp;lt;serviceURL&amp;gt;/MapServer&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;This is the code I'm using with a ServicesDirectory Object.&lt;/FONT&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;server_url = "https://&amp;lt;webadaptorserver&amp;gt;"
portal_url = "https://&amp;lt;webadaptorportal&amp;gt;"
usuario = "admin"
contraseña = "password"
gis = GIS(portal_url, usuario, contraseña)

gisSD= server.catalog.ServicesDirectory(url=server_url,tokenurl=gis._con.token)

servfolder="MYFOLDER"
servicios=gisSD.list(folder=servfolder)
for s in servicios:
    print (s)
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 20:25:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/could-not-load-service-mapserver/m-p/1569953#M10978</guid>
      <dc:creator>Leandro-Zamudio</dc:creator>
      <dc:date>2024-12-18T20:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: Could not load service: MapServer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/could-not-load-service-mapserver/m-p/1570384#M10979</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/192881"&gt;@Leandro-Zamudio&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Try the following:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import server

# Variables
agsURL = 'dsn.domain.com/webadaptor'    # ArcGIS Server URL
username = 'portaladmin'    # Portal credentials if federated
password = '**********'
folder = 'Public'   # name of ArcGIS Server folder

# Connect to ArcGIS Server
agsServer = server.Server(url=f"https://{agsURL}", username=username, password=password)

# Iterate through services
for service in agsServer.services.list(folder):
    print(service)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 19 Dec 2024 21:21:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/could-not-load-service-mapserver/m-p/1570384#M10979</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2024-12-19T21:21:34Z</dc:date>
    </item>
  </channel>
</rss>

