FindServiceSoap.FindByID Method

FindServiceSoap.FindByID Method

Finds points of interest based on entity ID. The found results are returned as a FindResults object.


Public Function FindByID_
     (ByVal specification As FindByIDSpecification )_
      As FindResults Member of FindServiceSoap

[C#]

public FindResults FindByID(FindByIDSpecification specification);

Parameters

  • specification
    The specifications of the find by ID request (FindByIDSpecification object), including the data source name, the entity type name and an array of entity IDs to find.

Remarks

  • The results are returned in the same order as the entity IDs are passed unless otherwise specified using the find filter SortProperties property.

  • An array of 500 entity IDs can be passed to this method.

  • Only matching entity IDs are returned; nonmatching and duplicate entity IDs are ignored.

  • The FindByID method is valid only with customer-defined point-of-interest data sources (and the MapPoint.FourthCoffeeSample data sources) that have the find nearby capability. For more information about MapPoint Web Service data sources, see MapPoint Web Service Data Sources and Capabilities.

  • If no results are found, the returned FindResults.NumberFound property value is 0.

Example

[Visual Basic]

Dim findServiceSoap As FindServiceSoap = New FindServiceSoap
findServiceSoap.Credentials = _
   New NetworkCredential(myMapPointUserId, mySecurePassword)

Dim entityPropertyValues As EntityPropertyValue() = New EntityPropertyValue(1) {}
entityPropertyValues(0) = New EntityPropertyValue
entityPropertyValues(0).Name = "PrimaryCity"
entityPropertyValues(0).Value = "Berlin"
entityPropertyValues(1) = New EntityPropertyValue
entityPropertyValues(1).Name = "IsWiFiHotSpot"
entityPropertyValues(1).Value = True
Dim findByPropertySpecification _
   As FindByPropertySpecification = New FindByPropertySpecification
findByPropertySpecification.DataSourceName = "MapPoint.FourthCoffeeSample"
findByPropertySpecification.Filter = New FindFilter
findByPropertySpecification.Filter.EntityTypeName = "FourthCoffeeShops"
findByPropertySpecification.Filter.WhereClause = New WhereClause
findByPropertySpecification.Filter.WhereClause.SearchProperties = entityPropertyValues
findByPropertySpecification.Filter.WhereClause.SearchOperator = SearchOperatorFlag.And
Dim findResults As FindResults = findServiceSoap.FindByProperty(findByPropertySpecification)



[C#]

FindServiceSoap findService = new FindServiceSoap();
findService.Credentials = 
   new System.Net.NetworkCredential(myMapPointUserId, mySecurePassword);

EntityPropertyValue[] mySearchProperties = new EntityPropertyValue[2];
mySearchProperties[0] = new EntityPropertyValue();
mySearchProperties[0].Name = "PrimaryCity";
mySearchProperties[0].Value = "Berlin";

mySearchProperties[1] = new EntityPropertyValue();
mySearchProperties[1].Name = "IsWiFiHotSpot";
mySearchProperties[1].Value = true;


FindByPropertySpecification findbypropspec = 
   new FindByPropertySpecification();

findbypropspec.DataSourceName = "MapPoint.FourthCoffeeSample";
findbypropspec.Filter = new FindFilter();
findbypropspec.Filter.EntityTypeName = "FourthCoffeeShops";

findbypropspec.Filter.WhereClause = new WhereClause();
findbypropspec.Filter.WhereClause.SearchProperties = mySearchProperties;
findbypropspec.Filter.WhereClause.SearchOperator = SearchOperatorFlag.And;

FindResults foundResults;
foundResults = findService.FindByProperty(findbypropspec);


See Also

  FindServiceSoap Class   |   FindResults Class   |   FindByIDSpecification Class   |   EntityType.Definition Property   |   CommonServiceSoap.GetEntityTypes Method