Matchcode

 

Example Name:                              xml_js.htm

 

Language:                                       HTML & Java Script

 

API type:                                           JavaScript/ActiveX

 

API component filename:            mcxquery.exe

 

Environment:                                  Web Browser

 

 

What does it do?

 

Demonstrates calling the XML version of the CGI client and processing the resulting XML.

 

This example is designed to work with the UK PAF file.

 

 

Could be used as a starting point for:

 

The address verification section of an online order form.  The use of XML means this could be part of an AJAX solution.

 

 

Where to find the example code:

 

After running the setup from the Matchcode CD to install the client APIs you will find these examples installed (by default) in:

 

C:\Program Files\Capscan\SDK\Matchcode Client API\CGI\XML\Examples

 

If you have installed to another location you will need to change the path where necessary.

 

 

What each file does:

 

File name                                         What does it do?

 

Xml_js.htm                                           Passes address details from the script to mcxquery.exe to complete the address and return the postcode.   It also captures non-address information for addition to a customer database.

 

Example1.xml                                     Sample of XML output from mcxquery.exe

 

Example2.xml                                     Sample of XML output from mcxquery.exe

 

 

 


 

Preparing to run the example:

 

Please make sure that you have installed the Capscan Pool Manager and that it is up and running.

 

 

Running the example:

 

1.       Make sure mcxquery.exe is in cgi-bin.

 

2.       Make sure the PAF pool is set in the local spider.ini file.

 

3.       Copy xml_js.htm to the document root folder of the web server (wwwroot in IIS).

 

4.       Open Internet Explorer and enter HTTP://themachinename/xml_js.htm.  Where “themachinename” is the name of the machine that has the HTML page in its document root.

 

 

Trouble-shooting and hints:

 

1.       If you are running on a LAN make sure that the Capscan Pool Manager is running correctly.  To do this you can use the PoolMan Admin application that is installed along with the Capscan Pool Manager.

 

2.       If you are using a firewall make sure that it is not blocking this example or the Capscan Pool Manager.  By default the Capscan Client/Server uses port 27920 for sending and receiving data.

 

3.       Try installing and running the Matchcode DC application to test that the Capscan Pool Manger is working correctly.  The installation for Matchcode DC can be found on the CD under:

 

Api\mcd_cs\win32\client\dc.

 

4.       For more hints and tips please see the SDK bookshelf documentation.