SunQuest
 
       BrainDump
  Home arrow BrainDump arrow Page 4 - MapPoint Web Service Find APIs
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
Moblin 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
IBM developerWorks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
BRAINDUMP

MapPoint Web Service Find APIs
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2008-02-07

    Table of Contents:
  • MapPoint Web Service Find APIs
  • The Anatomy of Find Methods
  • Understanding Entities and Entity Relationships
  • Data Sources and Entity Types

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    MapPoint Web Service Find APIs - Data Sources and Entity Types


    (Page 4 of 4 )

    Because entities in MapPoint Web Service are real things, they are contained in corresponding data sources for any given geographic extent. For example, if you consider the North American map data source MapPoint.NA, entities within the United States, Canada, Mexico, and Puerto Rico are contained in this data source. The only way to get to these entities is by knowing which entity types are supported by a particular data source. To find out which entity types are supported by a given data source, use theCommonServiceSoapmethod to get a list of the entity types supported by different data sources.

    Getting all supported entity types within a data source

    You can get a list of entity types supported by a specific data source using the CommonServiceSoap.GetEntityTypes method, which takes the data source name as an input argument and returns an array ofEntityTypeobjects. The following code snippet shows how to get all entity types defined in theMapPoint.NAdata source:

      //Define an instance of CommonServiceSoap class
      CommonServiceSoap commonService = new CommonServiceSoap();
      //Assign credentials
      . . .
      //Define a local entitytypes array
      EntityType[] entityTypes;
      //Datasource in question
      string datasource = "MapPoint.NA";
      //Get all entity types using the GetEntityTypes method
      entityTypes = commonService.GetEntityTypes(datasource);
      //Now loop through each entity display the name, parent
      foreach(EntityType et in entityTypes)
      {
        
    Console.WriteLine(et.Name);
         Console.WriteLine(et.Definition);
         Console.WriteLine(et.ParentName);
      }

    Along the same lines, you can also get all entity type definitions for all data sources in MapPoint Web Service environment:

      //Create an instance of common service soap
      CommonServiceSoap commonService = new CommonServiceSoap();
      //Assign credentials
      . . .
      DataSource[] dataSources;
      dataSources = commonService.GetDataSourceInfo(null);
      foreach (DataSource ds in dataSources)
      {
         String datasource = ds.Name;
         //Now get entity type info for this data source
         //Define a local entitytypes array
         EntityType[] entityTypes;
         //Datasource in question
         //Get all entity types using the GetEntityTypes method
         entityTypes = commonService.GetEntityTypes(datasource);
         //Now loop through each entity display the name, parent
         foreach(EntityType et in entityTypes)
         {
           
    Console.WriteLine(et.Name);
           
    Console.WriteLine(et.Definition);
           
    Console.WriteLine(et.ParentName);
        
    }
      }

    I use theCommonServiceSoap.GetDataSourceInfomethod to get a list of data sources and then theCommonServiceSoap.GetEntityTypesmethod to get a list of entity types defined in each data source.

    Once you know the names of the entity types, you can use the Find APIs, which we will see in detail later in the chapter, to customize the find queries to find only particular entity types.

    Please check back next week for the continuation of this article.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · This article is an excerpt from the book "Programming MapPoint in .NET," published...
     

    Buy this book now. This article is excerpted from chapter six of the book Programming MapPoint in .NET, written by Chandu Thota (O'Reilly; ISBN: 0596009062). Check it out today at your favorite bookstore. Buy this book now.

    BRAINDUMP ARTICLES

    - Making Your First Active X Control in Visual...
    - Codes and Packages in Microsoft Project 2007
    - Windows 7: Rumors and Demos
    - XP SP3 Why Me?
    - Breaking Up Your Work in Microsoft Project
    - Breaking Work into Task-Sized Chunks
    - Putting Microsoft`s Worldwide Telescope Unde...
    - Handling Multiple Contracts with Indigo
    - Cleaning Out Your Data in XP
    - Multiple Service Contracts and Indigo
    - Cleaning Out Your Programs in XP
    - Handling Metadata with Indigo
    - Building Blocks for a WCF Service Web Site
    - Help! I Need Some Remote Assistance
    - Using Service Templates with Indigo





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway