Home » getZipLookups

getZipLookups

Description

Gets list of zip 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 GetZipLookupsTest {

    public static void main(String[] args) {
        GetZipLookupsTest.getZipLookupsTest();
    }

    private static void getZipLookupsTest() {
       
        try {
         
            ZEDOAPIStub stub = new ZEDOAPIStub("http://api.zedo.com/v8/?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);
            Zip[] zips = stub.getZipLookups().get_return();
     
            System.out.println("getZipLookupsTest COMPLETE!");
            for (Zip zip:  zips) {
                System.out.println(zip.getId() + " " + zip.getName());
            }

        } catch (Exception e) {
            System.err.println("ERROR: getZipLookupsTest 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/v8/?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->getZipLookups();
        }catch (SoapFault $ex) {
           var_dump($ex->faultcode, $ex->faultstring, $ex->detail);
                echo "GET ZIPLOOKUPS FAILED\n";
            die();
        }
        
        /**
         * Response
         */
        $tmp = new getZipLookupsResponse($response);
        $zipLookups = $tmp->return;
        echo "GET ZIPLOOKUPS COMPLETE - RESPONSE : \n";
        print_r($zipLookups);

SOAP

Request

POST /axis2/services/ZEDOAPI?wsdl HTTP/1.1
Content-Type: application/soap+xml; charset=UTF-8; action="urn:getZipLookups"
User-Agent: Axis2
Host: dev08.juhu.zedo.com:2000
Transfer-Encoding: chunked
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Header>
<zedoapi:user xmlns:zedoapi="http://api.zedo.com">example@example.com</zedoapi:user>
<zedoapi:password xmlns:zedoapi="http://api.zedo.com">password</zedoapi:password>
<zedoapi:network xmlns:zedoapi="http://api.zedo.com">525</zedoapi:network>
</soapenv:Header>
<soapenv:Body />
</soapenv:Envelope>

Response

HTTP/1.1 200 OK
Date: Thu, 21 Jan 2016 06:23:00 GMT
Server: Simple-Server/1.1
Transfer-Encoding: chunked
Content-Type: application/soap+xml; charset=UTF-8; action="urn:getZipLookupsResponse"
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<ns:getZipLookupsResponse xmlns:ns="http://zapi.zedo.com" xmlns:ax21="http://base.zedo.com/xsd" xmlns:ax22="http://util.zedo.com/xsd" xmlns:ax25="http://soap.reportengine.zedo.com/xsd" xmlns:ax24="http://client.api.zedo.com/xsd">
<ns:return type="com.zedo.api.client.Zip">
<ax24:countryId>360</ax24:countryId>
<ax24:description>beverly hills, USA</ax24:description>
<ax24:id>1001</ax24:id>
<ax24:name>Beverly Hills</ax24:name>
<ax24:status>A</ax24:status>
<ax24:zipCode>90210</ax24:zipCode>
</ns:return>
<ns:return type="com.zedo.api.client.Zip">
<ax24:countryId>360</ax24:countryId>
<ax24:description>ZIPCODES</ax24:description>
<ax24:id>1002</ax24:id>
<ax24:name>ZIPCODES</ax24:name>
<ax24:status>A</ax24:status>
<ax24:zipCode>0</ax24:zipCode>
</ns:return>
<ns:return type="com.zedo.api.client.Zip">
<ax24:countryId>360</ax24:countryId>
<ax24:description>ZIPCODES</ax24:description>
<ax24:id>1003</ax24:id>
<ax24:name>ZIPCODES</ax24:name>
<ax24:status>A</ax24:status>
<ax24:zipCode>1033</ax24:zipCode>
</ns:return>
<ns:return type="com.zedo.api.client.Zip">
<ax24:countryId>360</ax24:countryId>
<ax24:description>ZIPCODES</ax24:description>
<ax24:id>1004</ax24:id>
<ax24:name>ZIPCODES</ax24:name>
<ax24:status>A</ax24:status>
<ax24:zipCode>1226</ax24:zipCode>
</ns:return>
<ns:return type="com.zedo.api.client.Zip">
<ax24:countryId>360</ax24:countryId>
<ax24:description>ZIPCODES</ax24:description>
<ax24:id>1005</ax24:id>
<ax24:name>ZIPCODES</ax24:name>
<ax24:status>A</ax24:status>
<ax24:zipCode>1504</ax24:zipCode>
</ns:return>
<ns:return type="com.zedo.api.client.Zip">
<ax24:countryId>360</ax24:countryId>
<ax24:description>ZIPCODES</ax24:description>
<ax24:id>1006</ax24:id>
<ax24:name>ZIPCODES</ax24:name>
<ax24:status>A</ax24:status>
<ax24:zipCode>1719</ax24:zipCode>
</ns:return>
<ns:return type="com.zedo.api.client.Zip">
<ax24:countryId>360</ax24:countryId>
<ax24:description>ZIPCODES</ax24:description>
<ax24:id>1007</ax24:id>
<ax24:name>ZIPCODES</ax24:name>
<ax24:status>A</ax24:status>
<ax24:zipCode>1904</ax24:zipCode>
</ns:return>
</ns:getZipLookupsResponse>
</soapenv:Body>
</soapenv:Envelope>