Unified Software
DEVELOPERS

Overview
How BankVal Works
Technical Details

Cookbook

.NET
VB 5/6
VBA
Java
Perl
PHP
Javascript
SAP

Service Information
F.A.Q.s

 

Free Trial Register now for a free 30 day (or 300 hits) trial of BankVal.
<< Click Here >>

<< Why register? >>
 Javascript

This example calls the BankValPlus service.


function fncCallBankVal() {
var strXML;
var oXmlHttp = new ActiveXObject("MSXML2.XMLHTTP");
// Call the service on the primary server first.
// If there is a problem, call the backup.
try {
// Primary
oXmlHttp.open(
"POST",
"https://www.unifiedsoftware.co.uk/cgi-bin/bankvalSOAP.cgi",
false
);
strXML = '<SOAP-ENV:Envelope ' +
'xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" ' +
'xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" ' +
'xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" ' +
'xmlns:xsd="http://www.w3.org/1999/XMLSchema" ' +
'SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> ' + '<SOAP-ENV:Body><namesp1:bankvalplus ' +
'xmlns:namesp1="http://www.unifiedsoftware.co.uk/BankValSOAP"><params ' + 'xsi:type="xsd:string">' +
document.validatefrm.userid.value + '|' + document.validatefrm.PIN.value +
'|' + document.validatefrm.sortcode.value + '|' +
document.validatefrm.account.value +
'</params>' +
'</namesp1:bankvalplus></SOAP-ENV:Body></SOAP-ENV:Envelope>';

oXmlHttp.setRequestHeader("Content-Type", "text/xml");
oXmlHttp.setRequestHeader("SOAPAction", +
"http://www.unifiedsoftware.co.uk/BankValSOAP#bankvalplus");
oXmlHttp.send(strXML);
// extract the result from the returned SOAP message
alert(oXmlHttp.responseXML.selectSingleNode("//ValidateResult").text);
}
catch (e) {
// Backup
oXmlHttp.open(
"POST",
"https://www.unifiedservices.co.uk/cgi-bin/bankvalSOAP.cgi",
false
);
strXML = '<SOAP-ENV:Envelope ' +
'xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" ' +
'xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" ' +
'xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" ' +
'xmlns:xsd="http://www.w3.org/1999/XMLSchema" ' +
'SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> ' +
'<SOAP-ENV:Body><namesp1:bankvalplus ' +
'xmlns:namesp1="http://www.unifiedservices.co.uk/BankValSOAP"><params ' +
'xsi:type="xsd:string">' +
document.validatefrm.userid.value + '|' + document.validatefrm.PIN.value +
'|' + document.validatefrm.sortcode.value + '|' +
document.validatefrm.account.value +
'</params>' +
'</namesp1:bankvalplus></SOAP-ENV:Body></SOAP-ENV:Envelope>';

oXmlHttp.setRequestHeader("Content-Type", "text/xml");
oXmlHttp.setRequestHeader("SOAPAction",
"http://www.unifiedservices.co.uk/BankValSOAP#bankvalplus");
oXmlHttp.send(strXML);
// extract the result from the returned SOAP message
alert(oXmlHttp.responseXML.selectSingleNode("//ValidateResult").text);
}

} // end of fncCallBankVal


<< back to top >>
©2003 - 2007 UNIFIED SOFTWARE LIMITED - ALL RIGHTS RESERVED
The BIC information is published with permission of SWIFT SCRL. Database Rights Reserved. 2007.
Unified Software Limited is a VOCA Authorised ISCD Distributor.