Description
Gets list of country lookups
Attributes
Function doesn’t accept attributes
Samples
Java
import com.zedo.zapi.*; import com.zedo.zapi.ZEDOAPIStub.*; import javax.xml.namespace.QName; import org.apache.axis2.AxisFault; public class GetCountryLookupsTest { public static void main(String[] args) { GetCountryLookupsTest.getCountryLookupsTest(); } private static void getCountryLookupsTest() { try { ZEDOAPIStub stub = new ZEDOAPIStub("http://api.zedo.com/v7/?wsdl&java"); stub._getServiceClient().addStringHeader(new QName("http://api.zedo.com", "user", "zedoapi"), "example@example.com"); stub._getServiceClient().addStringHeader(new QName("http://api.zedo.com", "password", "zedoapi"), "password"); stub._getServiceClient().addStringHeader(new QName("http://api.zedo.com", "network", "zedoapi"), "525"); stub._getServiceClient().getOptions().setTimeOutInMilliSeconds(10 * 60 * 1000); Thread.sleep(5000); Country[] countries = stub.getCountryLookups().get_return(); System.out.println("getCountryLookupsTest COMPLETE!"); for (Country country : countries) { System.out.println(country.getId() + " " + country.getName()); } } catch (Exception e) { System.err.println("ERROR: getCountryLookupsTest FAILED!"); System.err.println("Exception: " + e.getMessage()); if (e instanceof AxisFault) { AxisFault af = (AxisFault) e; System.err.println("AxisFault's detail: " + af.getDetail()); af.printStackTrace(); } else { e.printStackTrace(); } } } }
PHP
include_once './zlib/ZEDOAPI.php'; /** *Create Client Stub */ $config = Array(); $config['location'] = 'http://api.zedo.com/v7/?wsdl&php'; //URL of the SOAP server to send the request to $config['exceptions'] = true; //Enable Exception Handling $stub = new ZEDOAPI($config); $header = Array(); $header[0] = new SoapHeader('http://api.zedo.com','user', 'example@example.com'); $header[1] = new SoapHeader('http://api.zedo.com','password', 'password'); $header[2] = new SoapHeader('http://api.zedo.com','network','525'); $header[3] = new SoapHeader('http://api.zedo.com','callinfo','zapiCall'); $stub->__setSoapHeaders($header); /** *Define Call Parameters */ /** *Execute API Call */ try { $response = $stub->getCountryLookups(); }catch (SoapFault $ex) { var_dump($ex->faultcode, $ex->faultstring, $ex->detail); echo "GET COUNTRYLOOKUPS FAILED\n"; die(); } /** * Response */ $tmp = new getCountryLookupsResponse($response); $countryLookups = $tmp->return; echo "GET COUNTRYLOOKUPS COMPLETE - RESPONSE : \n"; print_r($countryLookups);
SOAP
Request
POST /axis2/services/ZEDOAPI?wsdl HTTP/1.0 Host: localhost:8080 User-Agent: NuSOAP/0.7.2 (1.1.1.1) Content-Type: text/xml; charset=ISO-8859-1 SOAPAction: "urn:getCountryLookups" Content-Length:509<? xml version="1.0" encoding="ISO-8859-1"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Header> <user>user@example.com</user> <password xmlns="http://zapi.zedo.com">password</password> <network>128</network> <callinfo>zapiCall</callinfo> </SOAP-ENV:Header> <SOAP-ENV:Body> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Response
HTTP/1.0 200 OK Date: Thu, 13 Aug 2009 06:21:46 GMT Server: Simple-Server/1.1 Content-Type: text/xml; charset=ISO-8859-1 Connection: Close<? xml version='1.0' encoding='ISO-8859-1'?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns:getCountryLookupsResponse xmlns:ns="http://zapi.zedo.com" xmlns:ax25="http://soap.reportengine.zedo.com/xsd" xmlns:ax22="http://util.zedo.com/xsd"xmlns:ax24="http://client.api.zedo.com/xsd" xmlns:ax21="http://base.zedo.com/xsd"> <ns:return type="com.zedo.api.client.Country"> <ax24:code>166</ax24:code> <ax24:id>354</ax24:id> <ax24:name>Tuvalu</ax24:name> </ns:return> <ns:return type="com.zedo.api.client.Country"> <ax24:code>1</ax24:code> <ax24:id>189</ax24:id> <ax24:name>Andorra</ax24:name> </ns:return> </ns:getCountryLookupsResponse> </soapenv:Body> </soapenv:Envelope>