Developers Cookbook

Free Trial

Register now for a free 30 day (or 300 hits) trial of BankVal.


This example shows how all of BankVal UK's methods can be accessed from a .NET application. To use BankVal International, please see the notes at the end of this example.

This example also shows how to incorporate the backup services for seamless continuity of service.

1 Add a web reference to your project. To do this, go to Project -> Add Web Reference. Key in the WSDL file name ( as shown below and click 'Go'.

.NET step 1 - Web Reference

2 You will see that 1 service has been found - BankValukall2 - and all of its methods have been listed. Click 'Add Reference'. A reference to the service will appear in the Solution Explorer pane:

.NET step 2 - Solution Explorer

3 Now, repeat steps 1 and 2, this time using the WSDL file for the BankVal UK services on the backup server. (

.NET step 3 - Web Reference

As you can see, the service name and method names are identical to those deployed on the primary server. Click 'Add Reference' and you will end up with a second web reference in the Solution Explorer pane:

.NET step 4 - Solution Explorer

4 Now you need to access these services from your code. At the appropriate point in your project, insert the following:

Dim paramstring As String
paramstring = userid.Text & "|" & pin.Text & "|" & sortcode.Text &  _
              "|" & account.Text
Dim bv1 As New
result.Text = bv1.bankvalidate(paramstring)

If Err.Number <> 0 Then
    Dim bv2 As New
    result.Text = bv2.bankvalidate(paramstring)
End If

Where userid.Text, pin.Text, sortcode.Text and account.Text are taken from the input form in this example.

If you wish to use any of BankVal UK's other methods, it is simply a matter of changing the method name in the code shown at step 4. Bear in mind, however, that the parameter string for getbranchdetails and cardvalidate differs slightly from this example. In the case of getbranchdetails, the parameter string is 'userid|PIN|sortcode' and for cardvalidate, the string is 'userid|PIN|cardnumber'. Please see Technical details for further information if required.

To access BankVal International, follow the procedure described in steps 1 to 4, using the WSDL files as the primary service and as the backup.

Note that for BankVal International's swiftvalidate and ibanvalidate methods the parameter strings are 'userid|PIN|swiftbic' and 'userid|PIN|iban' respectively. For further information please see Technical details.

Our customers