Documentation

.NET Developers and the SOAP API


.NET developers using Visual Studio should create a web reference using https://api.t2a.io/soap

In the examples below, our web reference is named t2a. The class containing the methods is named t2a.T2A, and the result classes are also in the t2a namespace.

This is a C# illustration of the use of the ip_location method:-

// create a web reference using https://api.t2a.io/soap
//
// the reference here is named t2a, and the class is called T2A
//
// create an instance of t2a.T2A
t2a.T2A myclass = new t2a.T2A();
// the result class is also in t2a
//
t2a.ip_location_res res = myclass.ip_location(api_key, null, ip_address);
// check the status, if ok, display results, otherwise display the error
if (res.status.CompareTo("ok") == 0)
	

This is a Visual Basic illustration of the use of ip_location:-

' execute the method
' replace with your own API key
Dim api_key As String = "---"
' create a web reference using https://api.t2a.io/soap
' the reference here is named t2a, and the class is called T2A
' create an instance of t2a.T2A
Dim myclass2 As New t2a.T2A()
' the result class is also in t2a
Dim res As t2a.ip_location_res = myclass2.ip_location(api_key, "",
ip_address)
' check the status, if ok, display results, otherwise display the error
If (res.status = "ok") Then	
	

Next: Result Page Caching