Click or drag to resize

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 .

Inheritance Hierarchy
SystemObject
  MaxMind.GeoIP2WebServiceClient

Namespace:  MaxMind.GeoIP2
Assembly:  MaxMind.GeoIP2 (in MaxMind.GeoIP2.dll) Version: 3.0.0
Syntax
public class WebServiceClient : IGeoIP2WebServicesClient, 
	IGeoIP2Provider, IDisposable

The WebServiceClient type exposes the following members.

Constructors
  NameDescription
Public methodWebServiceClient
Initializes a new instance of the WebServiceClient class.
Top
Methods
  NameDescription
Public methodCity
Returns an CityResponse for the requesting IP address.
Public methodCity(IPAddress)
Returns an CityResponse for the specified IP address.
Public methodCity(String)
Returns an CityResponse for the specified IP address.
Public methodCityAsync
Asynchronously query the GeoIP2 Precision: City web service for the requesting IP address.
Public methodCityAsync(IPAddress)
Asynchronously query the GeoIP2 Precision: City web service for the specified IP address.
Public methodCityAsync(String)
Asynchronously query the GeoIP2 Precision: City web service for the specified IP address.
Public methodCountry
Returns an CountryResponse for the requesting IP address.
Public methodCountry(IPAddress)
Returns an CountryResponse for the specified IP address.
Public methodCountry(String)
Returns an CountryResponse for the specified IP address.
Public methodCountryAsync
Asynchronously query the GeoIP2 Precision: Country web service for the requesting IP address.
Public methodCountryAsync(IPAddress)
Asynchronously query the GeoIP2 Precision: Country web service for the specified IP address.
Public methodCountryAsync(String)
Asynchronously query the GeoIP2 Precision: Country web service for the specified IP address.
Public methodDispose
Release resources back to the operating system.
Protected methodDispose(Boolean)
Release resources back to the operating system.
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodInsights
Returns an InsightsResponse for the requesting IP address.
Public methodInsights(IPAddress)
Returns an InsightsResponse for the specified IP address.
Public methodInsights(String)
Returns an InsightsResponse for the specified IP address.
Public methodInsightsAsync
Asynchronously query the GeoIP2 Precision: Insights web service for the requesting IP address.
Public methodInsightsAsync(IPAddress)
Asynchronously query the GeoIP2 Precision: Insights web service for the specified IP address.
Public methodInsightsAsync(String)
Asynchronously query the GeoIP2 Precision: Insights web service for the specified IP address.
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Top
See Also