MaxMind.GeoIP2 : MaxMind.GeoIP2 Namespace

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 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 : IGeoIP2WebServicesClient, IDisposable

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: MaxMind.GeoIP2
Assembly: MaxMind.GeoIP2 (in MaxMind.GeoIP2.dll)
Assembly Versions: 2.6.0.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

City () : MaxMind.GeoIP2.Responses.CityResponse
Returns an MaxMind.GeoIP2.Responses.CityResponse for the requesting IP address.
City (System.Net.IPAddress) : MaxMind.GeoIP2.Responses.CityResponse
Returns an MaxMind.GeoIP2.Responses.CityResponse for the specified IP address.
City (string) : MaxMind.GeoIP2.Responses.CityResponse
Returns an MaxMind.GeoIP2.Responses.CityResponse for the specified IP address.
CityAsync () : System.Threading.Tasks.Task<MaxMind.GeoIP2.Responses.CityResponse>
Asynchronously query the GeoIP2 Precision: City web service for the requesting IP address.
CityAsync (System.Net.IPAddress) : System.Threading.Tasks.Task<MaxMind.GeoIP2.Responses.CityResponse>
Asynchronously query the GeoIP2 Precision: City web service for the specified IP address.
CityAsync (string) : System.Threading.Tasks.Task<MaxMind.GeoIP2.Responses.CityResponse>
Asynchronously query the GeoIP2 Precision: City web service for the specified IP address.
Country () : MaxMind.GeoIP2.Responses.CountryResponse
Returns an MaxMind.GeoIP2.Responses.CountryResponse for the requesting IP address.
Country (System.Net.IPAddress) : MaxMind.GeoIP2.Responses.CountryResponse
Returns an MaxMind.GeoIP2.Responses.CountryResponse for the specified IP address.
Country (string) : MaxMind.GeoIP2.Responses.CountryResponse
Returns an MaxMind.GeoIP2.Responses.CountryResponse for the specified IP address.
CountryAsync () : System.Threading.Tasks.Task<MaxMind.GeoIP2.Responses.CountryResponse>
Asynchronously query the GeoIP2 Precision: Country web service for the requesting IP address.
CountryAsync (System.Net.IPAddress) : System.Threading.Tasks.Task<MaxMind.GeoIP2.Responses.CountryResponse>
Asynchronously query the GeoIP2 Precision: Country web service for the specified IP address.
CountryAsync (string) : System.Threading.Tasks.Task<MaxMind.GeoIP2.Responses.CountryResponse>
Asynchronously query the GeoIP2 Precision: Country web service for the specified IP address.
Dispose ()
Release resources back to the operating system.
Insights () : MaxMind.GeoIP2.Responses.InsightsResponse
Returns an MaxMind.GeoIP2.Responses.InsightsResponse for the requesting IP address.
Insights (System.Net.IPAddress) : MaxMind.GeoIP2.Responses.InsightsResponse
Returns an MaxMind.GeoIP2.Responses.InsightsResponse for the specified IP address.
Insights (string) : MaxMind.GeoIP2.Responses.InsightsResponse
Returns an MaxMind.GeoIP2.Responses.InsightsResponse for the specified IP address.
InsightsAsync () : System.Threading.Tasks.Task<MaxMind.GeoIP2.Responses.InsightsResponse>
Asynchronously query the GeoIP2 Precision: Insights web service for the requesting IP address.
InsightsAsync (System.Net.IPAddress) : System.Threading.Tasks.Task<MaxMind.GeoIP2.Responses.InsightsResponse>
Asynchronously query the GeoIP2 Precision: Insights web service for the specified IP address.
InsightsAsync (string) : System.Threading.Tasks.Task<MaxMind.GeoIP2.Responses.InsightsResponse>
Asynchronously query the GeoIP2 Precision: Insights web service for the specified IP address.

Protected Methods

Dispose (bool)
Release resources back to the operating system.

Member Details

WebServiceClient Constructor

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

Syntax

public WebServiceClient (int userId, string licenseKey, string host, int timeout)

Parameters

userId
Your MaxMind user ID.
licenseKey
Your MaxMind license key.
host
The host 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: 2.6.0.0

WebServiceClient Constructor

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

Syntax

public WebServiceClient (int userId, string licenseKey, IEnumerable<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 host 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: 2.6.0.0

City Method

Returns an MaxMind.GeoIP2.Responses.CityResponse for the requesting IP address.

Syntax

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: 2.6.0.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: 2.6.0.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: 2.6.0.0

CityAsync Method

Asynchronously query the GeoIP2 Precision: City web service for the requesting IP address.

Syntax

[System.Runtime.CompilerServices.AsyncStateMachine(typeof(MaxMind.GeoIP2.WebServiceClient/<CityAsync>d__16))]
public System.Threading.Tasks.Task<MaxMind.GeoIP2.Responses.CityResponse> CityAsync ()

Returns

Task that produces an object modeling the City response

Remarks

Documentation for this section has not yet been entered.

Requirements

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

CityAsync Method

Asynchronously query the GeoIP2 Precision: City web service for the specified IP address.

Syntax

[System.Runtime.CompilerServices.AsyncStateMachine(typeof(MaxMind.GeoIP2.WebServiceClient/<CityAsync>d__15))]
public System.Threading.Tasks.Task<MaxMind.GeoIP2.Responses.CityResponse> CityAsync (System.Net.IPAddress ipAddress)

Parameters

ipAddress
The IP address.

Returns

Task that produces an object modeling the City response

Remarks

Documentation for this section has not yet been entered.

Requirements

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

CityAsync Method

Asynchronously query the GeoIP2 Precision: City web service for the specified IP address.

Syntax

[System.Runtime.CompilerServices.AsyncStateMachine(typeof(MaxMind.GeoIP2.WebServiceClient/<CityAsync>d__14))]
public System.Threading.Tasks.Task<MaxMind.GeoIP2.Responses.CityResponse> CityAsync (string ipAddress)

Parameters

ipAddress
The IP address.

Returns

Task that produces an object modeling the City response

Remarks

Documentation for this section has not yet been entered.

Requirements

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

Country Method

Returns an MaxMind.GeoIP2.Responses.CountryResponse for the requesting IP address.

Syntax

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: 2.6.0.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: 2.6.0.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: 2.6.0.0

CountryAsync Method

Asynchronously query the GeoIP2 Precision: Country web service for the requesting IP address.

Syntax

[System.Runtime.CompilerServices.AsyncStateMachine(typeof(MaxMind.GeoIP2.WebServiceClient/<CountryAsync>d__13))]
public System.Threading.Tasks.Task<MaxMind.GeoIP2.Responses.CountryResponse> CountryAsync ()

Returns

Task that produces an object modeling the Country response

Remarks

Documentation for this section has not yet been entered.

Requirements

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

CountryAsync Method

Asynchronously query the GeoIP2 Precision: Country web service for the specified IP address.

Syntax

[System.Runtime.CompilerServices.AsyncStateMachine(typeof(MaxMind.GeoIP2.WebServiceClient/<CountryAsync>d__12))]
public System.Threading.Tasks.Task<MaxMind.GeoIP2.Responses.CountryResponse> CountryAsync (System.Net.IPAddress ipAddress)

Parameters

ipAddress
The IP address.

Returns

Task that produces an object modeling the Country response

Remarks

Documentation for this section has not yet been entered.

Requirements

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

CountryAsync Method

Asynchronously query the GeoIP2 Precision: Country web service for the specified IP address.

Syntax

[System.Runtime.CompilerServices.AsyncStateMachine(typeof(MaxMind.GeoIP2.WebServiceClient/<CountryAsync>d__11))]
public System.Threading.Tasks.Task<MaxMind.GeoIP2.Responses.CountryResponse> CountryAsync (string ipAddress)

Parameters

ipAddress
The IP address.

Returns

Task that produces an object modeling the Country response

Remarks

Documentation for this section has not yet been entered.

Requirements

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

Dispose Method

Release resources back to the operating system.

Syntax

public void Dispose ()

Remarks

Documentation for this section has not yet been entered.

Requirements

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

Dispose Method

Release resources back to the operating system.

Syntax

protected virtual void Dispose (bool disposing)

Parameters

disposing

Remarks

Documentation for this section has not yet been entered.

Requirements

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

Insights Method

Returns an MaxMind.GeoIP2.Responses.InsightsResponse for the requesting IP address.

Syntax

Returns

An MaxMind.GeoIP2.Responses.InsightsResponse

Remarks

Documentation for this section has not yet been entered.

Requirements

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

Insights Method

Returns an MaxMind.GeoIP2.Responses.InsightsResponse for the specified IP address.

Syntax

Parameters

ipAddress
The IP address.

Returns

An MaxMind.GeoIP2.Responses.InsightsResponse

Remarks

Documentation for this section has not yet been entered.

Requirements

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

Insights Method

Returns an MaxMind.GeoIP2.Responses.InsightsResponse for the specified IP address.

Syntax

Parameters

ipAddress
The IP address.

Returns

An MaxMind.GeoIP2.Responses.InsightsResponse

Remarks

Documentation for this section has not yet been entered.

Requirements

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

InsightsAsync Method

Asynchronously query the GeoIP2 Precision: Insights web service for the requesting IP address.

Syntax

[System.Runtime.CompilerServices.AsyncStateMachine(typeof(MaxMind.GeoIP2.WebServiceClient/<InsightsAsync>d__19))]
public System.Threading.Tasks.Task<MaxMind.GeoIP2.Responses.InsightsResponse> InsightsAsync ()

Returns

Task that produces an object modeling the Insights response

Remarks

Documentation for this section has not yet been entered.

Requirements

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

InsightsAsync Method

Asynchronously query the GeoIP2 Precision: Insights web service for the specified IP address.

Syntax

[System.Runtime.CompilerServices.AsyncStateMachine(typeof(MaxMind.GeoIP2.WebServiceClient/<InsightsAsync>d__18))]
public System.Threading.Tasks.Task<MaxMind.GeoIP2.Responses.InsightsResponse> InsightsAsync (System.Net.IPAddress ipAddress)

Parameters

ipAddress
The IP address.

Returns

Task that produces an object modeling the Insights response

Remarks

Documentation for this section has not yet been entered.

Requirements

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

InsightsAsync Method

Asynchronously query the GeoIP2 Precision: Insights web service for the specified IP address.

Syntax

[System.Runtime.CompilerServices.AsyncStateMachine(typeof(MaxMind.GeoIP2.WebServiceClient/<InsightsAsync>d__17))]
public System.Threading.Tasks.Task<MaxMind.GeoIP2.Responses.InsightsResponse> InsightsAsync (string ipAddress)

Parameters

ipAddress
The IP address.

Returns

Task that produces an object modeling the Insights response

Remarks

Documentation for this section has not yet been entered.

Requirements

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