Address Verification (On-Premises)
- Address Verification (On-Premises) 5.11.0
- All Products
private static AddressObject m_oAO; public static void main(String[] args) { int iLastError = 0; String sResultXML = ""; try { AddressDoctor.initialize( "<?xml version='1.0' encoding='UTF-16' ?>"+ "<!DOCTYPE SetConfig SYSTEM 'SetConfig.dtd'>"+ "<SetConfig><General WriteXMLEncoding='UTF-16' />"+ " <UnlockCode></UnlockCode>"+ " <DataBase CountryISO3='ALL' Type='BATCH_INTERACTIVE'"+ " Path='/ADDB' PreloadingType='NONE' />"+ "</SetConfig>", null, "<?xml version='1.0' encoding='UTF-16' ?>"+ "<!DOCTYPE SetConfig SYSTEM 'Parameters.dtd'>"+ "<Parameters WriteXMLEncoding='UTF-16'>"+ " <Input Encoding='UTF-16' />"+ " <Result Encoding='UTF-16' />"+ "</Parameters>", null); iLastError = AddressDoctor.getLastError(); System.out.println("Using AddressDoctor version: " + AddressDoctor.getVersion()); System.out.println("Init returned " + iLastError); } catch (AddressDoctorException ex) { System.out.println("Exception while initializing "+ "AddressDoctor: " + ex.toString()); System.out.println("Further processing not possible, "+ "application ends!"); return; } try { m_oAO = AddressDoctor.getAddressObject(); } catch (AddressDoctorException ex) { System.out.println("Exception while trying to get an "+ "AddressObject: " + ex.toString()); System.out.println("Further processing not possible, "+ "application ends!"); try { AddressDoctor.deinitialize(); } catch (AddressDoctorException ex2){} return; } try { m_oAO.setInputDataXML( "<?xml version='1.0' encoding='UTF-16'?>"+ "<!DOCTYPE InputData SYSTEM InputData.dtd'>"+ "<InputData>"+ "<AddressElements>"+ " <Key>4711</Key>"+ " <Country Item='1' Type='NAME'>SGP</Country>"+ " <Locality Item='1' Type='COMPLETE'>Singapore</Locality>"+ " <PostalCode Item='1' Type='FORMATTED'>048624</PostalCode>"+ " <Street Item='1' Type='COMPLETE'>Raffles Place</Street>"+ " <Number Item='1' Type='COMPLETE'>80</Number>"+ " <Building Item='1' Type='COMPLETE'>#50-01 UOB Plaza 1</Building>"+ " <Organization Item='1' Type='NAME'>AddressDoctor GmbH</Organization>"+ "</AddressElements>"+ "</InputData>"); } catch (Exception ex) { System.out.println("Data could not be assigned! Closing "+ "application: " + ex.toString()); try { AddressDoctor.releaseAddressObject(m_oAO); AddressDoctor.deinitialize(); } catch (AddressDoctorException ex2){} return; } try { AddressDoctor.process(m_oAO); iLastError = AddressDoctor.getLastError(); System.out.println("Process returned " + iLastError); } catch (AddressDoctorException ex) { System.out.println("Exception during process: " + ex.toString()); } if (iLastError == 0) { try { sResultXML = m_oAO.getResultXML(); } catch (AddressDoctorException ex) { System.out.println("Exception while trying to get "+ "ResultXML: " + ex.toString()); return; } System.out.println(sResultXML); } try { AddressDoctor.releaseAddressObject(m_oAO); AddressDoctor.deinitialize(); } catch (AddressDoctorException ex) { System.out.println("Exception while releasing the AO and "+ "de-initializing AddressDoctor: " + ex.toString()); } } }(Enter Code here)