Zapcode

 

Example Name:                              ZapCS

 

Language:                                       Java

 

API type:                                           Java

 

API component filename:            capscan.jar

 

Environment:                                  Java 1.4 or higher

 

 

What does it do?

 

Demonstrates the use of, communicating with the Capscan Pool Manager, searching, and working with ambiguity lists and additional data sets.

 

 

Could be used as a starting point for:

 

Creating an application to capture or verify an address using a postcode.   

 

Where to find the example code:

 

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

 

C:\Program Files\Capscan\SDK\Zapcode Client API\Java\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?

 

ZapCS.java                                           Source code for the example.

 

spider.ini                                               A sample configuration file for the server.

 

 


 

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.       Open a Command Prompt.

                                                                                                                      

2.       cd "c:\Program Files\Capscan\SDK\Zapcode Client\Java\Examples"

 

3.       Make sure capscan.jar and the example directory is in the CLASSPATH.

 

4.       javac ZapCS.java

 

5.       java ZapCS hostname poolname

 

6.       Once you have connected to the Capscan Pool Manager you will presented with prompt where you can enter a search to run.

 

7.       The "help" command displays a list of commands. When followed by a command name it displays a description of that command.

 

8.       The "columns" command displays a list of available fields.

 

9.       The "select" command runs a search. Below is an example of a select command.

 

SELECT addr,listcount,ambiglist,searchstatus FROM psearchex WHERE postcode="nw1"

 

10.    This search will produce an ambiguity list. To select an item from the list run the following search:

 

SELECT addr,listcount,ambiglist,searchstatus FROM select WHERE searchstatus="r:POSTCODE=NW1",listitem="9"

 

A second select is needed to choose a complete address:

 

SELECT addr,listcount,ambiglist,searchstatus FROM select WHERE searchstatus="R:POSTCODE=NW1$s:9:POS",listitem="20"

 

11.    To exit use the command "exit". 

 

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 Zapcode application to test that the Capscan Pool Manger is working correctly.  The installation for Zapcode can be found on the CD under:

 

                Api\zcd_cs\win32\client\zapcode

 

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