Web Service
There are two ways we can suggest to connect to the Web Service with VB.NET. The first, using Visual Studio
is straight forward. Right-click your project and select ‘Add a web reference’. If when right-clicking you don't have an option to "Add Web Reference..." you will need to click "Add Service Reference..." then the "Advanced..." button followed by the "Add Web Reference..." button. Into the URL field enter
https://www.textapp.net/webservice/service.asmx?wsdl, and then click the ‘Go’ button. You should see the Service page, if so,
click ‘Add Reference’. If you do not see the Service page you should check your Internet Explorer proxy settings
or speak to your network administrator.
Assuming you did not change the contents of the ‘Web Reference Name’ field, you would be able to send a message:
Dim mySms = New net.textapp.www.Service
Dim result = mySms.sendSMS(false, "myExternalLogin", "myPassword", "clientBillingReference", _
"clientMessageReference", "+447923456789", "+447923456789", _
"hello world", 72, 2, 4, "", "")
You can call any of the other Web Service methods in a similar manner. In most cases,
Visual Studio will bring up a list of available methods when you type ‘mySms.’. If you need to specify proxy settings, you can set
the properties of the Service object (REQUIRES imports System.Net):
Dim proxyObject = New WebProxy("proxy_server", 8080)
proxyObject.Credentials = New NetworkCredential("username", "password")
mySms.Proxy = proxyObject
If you cannot use Visual Studio, it is still possible to use the wsdl.exe command line utility to generate the Service
object code. The utility is part of the 2.0 .NET framework SDK. You can download this from Microsoft.
To create the object code you would navigate to the ‘Bin’ folder of the SDK and execute the following command:
This will produce a file called Service.vb in the SDK ‘Bin’ folder. You can incorporate this file into your
project, and then use the Service object from within your own code:
Dim mySms = New Service()
Dim result = mySms.sendSMS(false, "myExternalLogin", "myPassword", "clientBillingReference", _
"clientMessageReference", "+447923456789", "+447923456789", _
"hello world", 72, 2, 4, "", "")
If you need to specify proxy details you can do so as required (REQUIRES imports System.Net):
Dim proxyObject = New WebProxy("proxy_server", 8080)
proxyObject.Credentials = New NetworkCredential("username", "password")
mySms.Proxy = proxyObject