<?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: GetDefinitions() returns nothing for Map Service Geodatabase in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/getdefinitions-returns-nothing-for-map-service/m-p/1020579#M6084</link>
    <description>&lt;P&gt;If you can provide a publicly accessible url, people would find it easier to reproduce the problem.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jan 2021 18:05:19 GMT</pubDate>
    <dc:creator>KirkKuykendall1</dc:creator>
    <dc:date>2021-01-27T18:05:19Z</dc:date>
    <item>
      <title>GetDefinitions() returns nothing for Map Service Geodatabase</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/getdefinitions-returns-nothing-for-map-service/m-p/1020555#M6083</link>
      <description>&lt;P&gt;I am instantiating a Geodatabase using the ServiceConnectionProperties constructor, which contains the url of a map service. If I call GetDefinitions() (for either TableDefinition or FeatureClassDefinition), the method returns an empty list.&lt;/P&gt;&lt;P&gt;However, I am able to access specific tables and their definitions using OpenDataset() and GetDefinition().&lt;/P&gt;&lt;P&gt;Through tinkering in Visual Studio's immediate window, I have found that if I call OpenDataset() on a specific table, then THAT table's definition will appear in the results of GetDefinitions(). For example, I have a map service with 19 feature classes. If I call OpenDataset() on 8 of those feature classes, then those 8 - and only those 8 - will appear in the results of GetDefinitions().&lt;/P&gt;&lt;P&gt;I was hoping to use the workflow described in other threads related to fetching data from map services: I have a string that likely matches an alias of one of the map service's feature classes or tables. I call GetDefinitions() to get all of the table definitions, and then call GetAlias() for each of those definitions, so that I can match the alias. This is still technically possible with a workaround (call GetDefinition("0"), GetDefinition("1"), etc. until I either find a match or until that causes an Exception), but it'd be nice to actually get all of the definitions off the bat.&lt;/P&gt;&lt;P&gt;Is this a bug? Something potentially wrong with the way the Map Service is set up? I would assume the latter isn't the case, as I've been testing using the ESRI World_Imagery service.&lt;/P&gt;&lt;P&gt;Edit - here is the Map Service I'm using to test:&amp;nbsp;&lt;A href="https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer" target="_blank"&gt;https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 18:19:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/getdefinitions-returns-nothing-for-map-service/m-p/1020555#M6083</guid>
      <dc:creator>DavidLaMartina</dc:creator>
      <dc:date>2021-01-27T18:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: GetDefinitions() returns nothing for Map Service Geodatabase</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/getdefinitions-returns-nothing-for-map-service/m-p/1020579#M6084</link>
      <description>&lt;P&gt;If you can provide a publicly accessible url, people would find it easier to reproduce the problem.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 18:05:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/getdefinitions-returns-nothing-for-map-service/m-p/1020579#M6084</guid>
      <dc:creator>KirkKuykendall1</dc:creator>
      <dc:date>2021-01-27T18:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: GetDefinitions() returns nothing for Map Service Geodatabase</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/getdefinitions-returns-nothing-for-map-service/m-p/1020608#M6086</link>
      <description>&lt;P&gt;I think the mapservice needs to be published with "&lt;A href="https://desktop.arcgis.com/en/arcmap/latest/map/publish-map-services/setting-map-service-properties.htm#ESRI_SECTION1_36B90DE5C96D430FBC9F4E7B338ACC9D" target="_self"&gt;feature access&lt;/A&gt;" enabled.&lt;/P&gt;&lt;P&gt;When that is done, there should be a url with FeatureServer in it.&lt;/P&gt;&lt;P&gt;The code below works for me with &lt;A href="https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer" target="_self"&gt;Naperville sample data&lt;/A&gt;:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private void ListDefs()
{
    var url = @"https://sampleserver7.arcgisonline.com/arcgis/rest/services/UtilityNetwork/NapervilleElectric/FeatureServer";
    QueuedTask.Run(() =&amp;gt;
    {
        var scp = new ServiceConnectionProperties(new Uri(url));
        var geodb = new Geodatabase(scp);
        var defs = geodb.GetDefinitions&amp;lt;FeatureClassDefinition&amp;gt;();
        foreach (var def in defs)
            Debug.Print($"{def.GetName()} {def.GetAliasName()}");
    });
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 19:00:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/getdefinitions-returns-nothing-for-map-service/m-p/1020608#M6086</guid>
      <dc:creator>KirkKuykendall1</dc:creator>
      <dc:date>2021-01-27T19:00:13Z</dc:date>
    </item>
  </channel>
</rss>

