WebServiceClient Class |
This class provides a client API for all the GeoIP2 Precision web service end points. The end points are Country, City, and Insights. Each end point returns a different set of data about an IP address, with Country returning the least data and Insights the most.
Each web service end point is represented by a different model class which contains data about the IP address.
If the web service does not return a particular piece of data for an IP address, the associated property is not populated.
The web service may not return any information for an entire record, in which case all of the properties for that model class will be empty.
Usage
The basic API for this class is the same for all of the web service end points. First you create a web service object with your MaxMind accountId and licenseKey, then you call the method corresponding to a specific end point, passing it the IP address you want to look up.
If the request succeeds, the method call will return a model class for the end point you called. This model in turn contains multiple record classes, each of which represents part of the data returned by the web service.
If the request fails, the client class throws an exception.
Exceptions
For details on the possible errors returned by the web service itself, see the GeoIP2 web service documentation .
Namespace: MaxMind.GeoIP2
The WebServiceClient type exposes the following members.
Name | Description | |
---|---|---|
WebServiceClient |
Initializes a new instance of the WebServiceClient class.
|
Name | Description | |
---|---|---|
City |
Returns an CityResponse for the requesting IP address.
| |
City(IPAddress) |
Returns an CityResponse for the specified IP address.
| |
City(String) |
Returns an CityResponse for the specified IP address.
| |
CityAsync |
Asynchronously query the GeoIP2 Precision: City web service for the requesting IP address.
| |
CityAsync(IPAddress) |
Asynchronously query the GeoIP2 Precision: City web service for the specified IP address.
| |
CityAsync(String) |
Asynchronously query the GeoIP2 Precision: City web service for the specified IP address.
| |
Country |
Returns an CountryResponse for the requesting IP address.
| |
Country(IPAddress) |
Returns an CountryResponse for the specified IP address.
| |
Country(String) |
Returns an CountryResponse for the specified IP address.
| |
CountryAsync |
Asynchronously query the GeoIP2 Precision: Country web service for the requesting IP address.
| |
CountryAsync(IPAddress) |
Asynchronously query the GeoIP2 Precision: Country web service for the specified IP address.
| |
CountryAsync(String) |
Asynchronously query the GeoIP2 Precision: Country web service for the specified IP address.
| |
Dispose |
Release resources back to the operating system.
| |
Dispose(Boolean) |
Release resources back to the operating system.
| |
Equals | (Inherited from Object.) | |
Finalize | (Inherited from Object.) | |
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
Insights |
Returns an InsightsResponse for the requesting IP address.
| |
Insights(IPAddress) |
Returns an InsightsResponse for the specified IP address.
| |
Insights(String) |
Returns an InsightsResponse for the specified IP address.
| |
InsightsAsync |
Asynchronously query the GeoIP2 Precision: Insights web service for the requesting IP address.
| |
InsightsAsync(IPAddress) |
Asynchronously query the GeoIP2 Precision: Insights web service for the specified IP address.
| |
InsightsAsync(String) |
Asynchronously query the GeoIP2 Precision: Insights web service for the specified IP address.
| |
MemberwiseClone | (Inherited from Object.) | |
ToString | (Inherited from Object.) |