Developers Cookbook

VB 5/6

A. VB MSSOAP

B. VB COM

C. VB MSXML

A VB MSSOAP



BankValidate Client example

  1. Download and install Microsoft MSSOAP toolkit, version 3.0 from the microsoft download centre
  2. Use the following code in your VB program.
  3. Build variable paramstring, substituting for:

    userid - your user id string
    PIN - your security PIN number string
    sortcode - 6 digit sort code string
    account - account number string
Dim paramstring As String
Dim soapClient

Set soapClient = CreateObject("MSSOAP.SoapClient30")

On Error Resume Next
soapClient.ClientProperty("ServerHTTPRequest") = True
Call soapClient.MSSoapInit _
("http://www.unifiedsoftware.co.uk/BankValukall2.wsdl")
		
If Err <> 0 Then
Call soapClient.MSSoapInit _
("http://www.unifiedservices.co.uk/BankValukall2.wsdl")
If Err <> 0 Then
status.Text = Err.Description
End If
End If
		
paramstring = userid.Text & "|" & PIN.Text & "|" & sortcode.Text & _ "|" & account.Text
result.Text = soapClient.bankvalidate(paramstring)

BankValPlus2 Client example

  1. Download and install Microsoft MSSOAP toolkit, version 3.0 from the microsoft download centre
  2. Use the following code in your VB program.
  3. Build variable paramstring, substituting for:

    userid - your user id string
    PIN - your security PIN number string
    sortcode - 6 digit sort code string
    account - account number string
Dim paramstring As String
Dim soapClient

Set soapClient = CreateObject("MSSOAP.SoapClient30")

On Error Resume Next
soapClient.ClientProperty("ServerHTTPRequest") = True
Call soapClient.MSSoapInit _
("http://www.unifiedsoftware.co.uk/BankValukall2.wsdl")

If Err <> 0 Then
  Call soapClient.MSSoapInit _
("http://www.unifiedservices.co.uk/BankValukall2.wsdl")
  If Err <> 0 Then
    status.Text = Err.Description
  End If
End If

paramstring = userid.Text & "|" & PIN.Text & "|" & sortcode.Text & _
"|" & account.Text
result.Text = soapClient.bankvalplus2(paramstring)

B VB COM



BankValidate Client example

  1. Requires Perl 5.6 or higher.
  2. Requires Perl SOAP::Lite module, available from Perl Package Manager http://aspn.activestate.com/ASPN/Downloads/ActivePerl/PPM/, CPAN http://www.cpan.org/.
  3. Requires Perl Crypt::SSLeay module, availability from Perl Package Manager http://aspn.activestate.com/ASPN/Downloads/ActivePerl/PPM/ or CPAN http://www.cpan.org/.
  4. Requires SOAP Lite COM Typelib

    (a) Download Lite.dll from http://www.soaplite.com
    (b) Register Lite.dll
    (c) Include as a reference in your project
  5. WSDL ensures that SSL (https) is used for the SOAP call.
  6. Insert the code below into your program, substituting for:

    userid - your user id string
    PIN - your security PIN number string
    sortcode - 6 digit sort code string and
    account - account number string.
MsgBox CreateObject("SOAP.Lite").new _ .service("http://www.unifiedsoftware.co.uk/BankVal.wsdl") _
.bankvalidate("userid|PIN|sortcode|account")

C VB MSXML



Client examples

  1. Include the MSXML reference in your project.
  2. Use the following code in your VB program.
  3. Build variable paramstring, substituting for:

    userid - your user id string
    PIN - your security PIN number string
    sortcode - 6 digit sort code string
    account - account number string.

BankValidate

Dim objReturn As New MSXML2.DOMDocument30
Dim strQuery As String

'Create the SOAP Envelope
strEnvelope =  _
   "<SOAP:Envelope xmlns:SOAP=""http://schemas.xmlsoap.org/soap/envelope/"">" & _
   "<SOAP:Body>" & _ 
   "<m:bankvalidate xmlns:m=""http://www.unifiedsoftware.co.uk/BankValSOAP"">" & _
   "<params>userid|PIN|sortcode|account</params>" & _
   "</m:bankvalidate>" & _
   "</SOAP:Body>" & _
   "</SOAP:Envelope>"

objHTTP.open "post", "https://www.unifiedsoftware.co.uk/cgi-bin/bankvalSOAP.cgi", False

'Set a standard SOAP/ XML header for the content-type
objHTTP.setRequestHeader "Content-Type", "text/xml"

'Set a header for the method to be called
objHTTP.setRequestHeader "SOAPAction", _
"http://www.unifiedsoftware.co.uk/BankValSOAP#bankvalidate"

'Make the SOAP call
objHTTP.send strEnvelope

'Get the return envelope
strReturn = objHTTP.responseText

'Load the return envelope into a DOM
objReturn.loadXML strReturn

'Query the return envelope
strQuery = "//ValidateResult"
result.Text = objReturn.selectSingleNode(strQuery).Text

GetBranchDetails2

Dim objHTTP As New MSXML2.XMLHTTP30
Dim strEnvelope As String
Dim strReturn As String
Dim objReturn As New MSXML2.DOMDocument30
Dim strQuery As String

'Create the SOAP Envelope
strEnvelope = _
   "<SOAP:Envelope xmlns:SOAP=""http://schemas.xmlsoap.org/soap/envelope/"">" & _
   "<SOAP:Body>" & _
   "<m:getbranchdetails2 xmlns:m=""http://www.unifiedsoftware.co.uk/BankValSOAP"">" & _
   "<params>userid|PIN|sortcode</params>" & _
   "</m:getbranchdetails2>" & _
   "</SOAP:Body>" & _
   "</SOAP:Envelope>"
   
objHTTP.open "post", "https://www.unifiedsoftware.co.uk/cgi-bin/bankvalSOAP.cgi", False

'Set a standard SOAP/ XML header for the content-type
objHTTP.setRequestHeader "Content-Type", "text/xml"

'Set a header for the method to be called
objHTTP.setRequestHeader "SOAPAction", _
   "http://www.unifiedsoftware.co.uk/BankValSOAP#getbranchdetails2"

'Make the SOAP call
objHTTP.send strEnvelope

'Get the return envelope
strReturn = objHTTP.responseText

'Load the return envelope into a DOM
objReturn.loadXML strReturn

'Query the return envelope
strQuery = "//GetBranchDetailOutput"
result.Text = objReturn.selectSingleNode(strQuery).Text							

Our customers