MaxMind.GeoIP2 : MaxMind.GeoIP2 Namespace

WebServiceClient Class

This class provides a client API for all the GeoIP2 web service's end points. The end points are Country, City, City/ISP/Org, and Omni. Each end point returns a different set of data about an IP address, with Country returning the least data and Omni 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 userID 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.

Syntax

public class WebServiceClient : IGeoIP2Provider

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: MaxMind.GeoIP2
Assembly: MaxMind.GeoIP2 (in MaxMind.GeoIP2.dll)
Assembly Versions: 0.3.2.0

Members

See Also: Inherited members from object.

Public Constructors

Initializes a new instance of the MaxMind.GeoIP2.WebServiceClient class.
Initializes a new instance of the MaxMind.GeoIP2.WebServiceClient class.

Public Methods

Member Details

WebServiceClient Constructor

Initializes a new instance of the MaxMind.GeoIP2.WebServiceClient class.

Syntax

public WebServiceClient (int userID, string licenseKey, string baseUrl, int timeout)

Parameters

userID
Your MaxMind user ID.
licenseKey
Your MaxMind license key.
baseUrl
The base url to use when accessing the service
timeout
Timeout in milliseconds for connection to web service. The default is 3000.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: MaxMind.GeoIP2
Assembly: MaxMind.GeoIP2 (in MaxMind.GeoIP2.dll)
Assembly Versions: 0.3.2.0

WebServiceClient Constructor

Initializes a new instance of the MaxMind.GeoIP2.WebServiceClient class.

Syntax

public WebServiceClient (int userID, string licenseKey, List<string> locales, string host, int timeout)

Parameters

userID
The user unique identifier.
licenseKey
The license key.
locales
List of locale codes to use in name property from most preferred to least preferred.
host
The base url to use when accessing the service
timeout
Timeout in milliseconds for connection to web service. The default is 3000.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: MaxMind.GeoIP2
Assembly: MaxMind.GeoIP2 (in MaxMind.GeoIP2.dll)
Assembly Versions: 0.3.2.0

City Method

Returns an MaxMind.GeoIP2.Responses.CityResponse for the specified ip address.

Syntax

Parameters

ipAddress
The ip address.

Returns

An MaxMind.GeoIP2.Responses.CityResponse

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: MaxMind.GeoIP2
Assembly: MaxMind.GeoIP2 (in MaxMind.GeoIP2.dll)
Assembly Versions: 0.3.2.0

CityIspOrg Method

Returns an MaxMind.GeoIP2.Responses.CityIspOrgResponse for the specified ip address.

Syntax

Parameters

ipAddress
The ip address.

Returns

An MaxMind.GeoIP2.Responses.CityIspOrgResponse

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: MaxMind.GeoIP2
Assembly: MaxMind.GeoIP2 (in MaxMind.GeoIP2.dll)
Assembly Versions: 0.3.2.0

Country Method

Returns an MaxMind.GeoIP2.Responses.CountryResponse for the specified ip address.

Syntax

Parameters

ipAddress
The ip address.

Returns

An MaxMind.GeoIP2.Responses.CountryResponse

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: MaxMind.GeoIP2
Assembly: MaxMind.GeoIP2 (in MaxMind.GeoIP2.dll)
Assembly Versions: 0.3.2.0

Omni Method

Returns an MaxMind.GeoIP2.Responses.OmniResponse for the specified ip address.

Syntax

Parameters

ipAddress
The ip address.

Returns

An MaxMind.GeoIP2.Responses.OmniResponse

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: MaxMind.GeoIP2
Assembly: MaxMind.GeoIP2 (in MaxMind.GeoIP2.dll)
Assembly Versions: 0.3.2.0