Home » getAdvertiserAll

getAdvertiserAll

Description

Gets the advertiser list with access control privileges

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 GetAdvertiserAllTest {

    public static void main(String[] args) {
        GetAdvertiserAllTest.getAdvertiserAllTest();
    }

    private static void getAdvertiserAllTest() {
        
        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(1000);
            Advertiser[] advertiserAll = stub.getAdvertiserAll().get_return();
     
            System.out.println("GET_ADVERTISER_ALL COMPLETE!");
            for (Advertiser advertiser : advertiserAll) {
                System.out.println(advertiser.getId() + " " + advertiser.getName());
            }

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

SOAP

Request

POST /axis2/services/ZEDOAPI HTTP/1.0 Host: 172.16.1.9:8080 User-Agent: NuSOAP/0.7.2 (1.3) Content-Type: text/xml; charset=ISO-8859-1 SOAPAction: "urn:getAdvertiserAll" Content-Length: 597<? 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>
<zedoapi:user xmlns="http://zapi.zedo.com">user@domain</zedoapi:user>
<zedoapi:password xmlns="http://zapi.zedo.com">mypassword</zedoapi:password>
<zedoapi:network xmlns="http://zapi.zedo.com">525</zedoapi:network>
<zedoapi:callinfo xmlns="http://zapi.zedo.com">zapiCall</zedoapi:callinfo>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Response


HTTP/1.0 200 OK Date: Thu, 10 May 2007 19:02:10 GMT Server: Simple-Server/1.1 Content-Length: 45776 Content-Type: text/xml; charset=ISO-8859-1<? xml version='1.0' encoding='ISO-8859-1'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header />
<soapenv:Body>
<ns:getAdvertiserAllResponse xmlns:ns="http://zapi.zedo.com">
<ns:return>
<actionType xmlns="http://client.api.zedo.com/xsd">-1</actionType>
<assetId xmlns="http://client.api.zedo.com/xsd">173865</assetId>
<ax21:billingContact xmlns:ax21="http://client.api.zedo.com/xsd">
<address1 xmlns="http://client.api.zedo.com/xsd">AddressDetails</address1>
<address2 xmlns="http://client.api.zedo.com/xsd">BlockName, StreetName</address2>
<city xmlns="http://client.api.zedo.com/xsd">CityName</city>
<country xmlns="http://client.api.zedo.com/xsd">USA</country>
<email xmlns="http://client.api.zedo.com/xsd">user@domain.com</email>
<fax xmlns="http://client.api.zedo.com/xsd">1010101</fax>
<firstName xmlns="http://client.api.zedo.com/xsd">FirstName</firstName>
<lastName xmlns="http://client.api.zedo.com/xsd">LastName</lastName>
<phone xmlns="http://client.api.zedo.com/xsd">1010101</phone>
<state xmlns="http://client.api.zedo.com/xsd">StateName</state>
<zipCode xmlns="http://client.api.zedo.com/xsd">12345</zipCode>
</ax21:billingContact>
<createdBy xmlns:nil="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://client.api.zedo.com/xsd" nil:nil="true" />
<createdDate xmlns:nil="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://client.api.zedo.com/xsd" nil:nil="true" />
<modifiedBy xmlns:nil="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://client.api.zedo.com/xsd" nil:nil="true" />
<modifiedDate xmlns:nil="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://client.api.zedo.com/xsd" nil:nil="true" />
<name xmlns="http://client.api.zedo.com/xsd">IDX</name>
<ax21:salesContact xmlns:ax21="http://client.api.zedo.com/xsd">
<address1 xmlns="http://client.api.zedo.com/xsd">AddressDetails</address1>
<address2 xmlns="http://client.api.zedo.com/xsd">BlockName, StreetName</address2>
<city xmlns="http://client.api.zedo.com/xsd">CityName</city>
<country xmlns="http://client.api.zedo.com/xsd">USA</country>
<email xmlns="http://client.api.zedo.com/xsd">user@domain.com</email>
<fax xmlns="http://client.api.zedo.com/xsd">1010101</fax>
<firstName xmlns="http://client.api.zedo.com/xsd">FirstName</firstName>
<lastName xmlns="http://client.api.zedo.com/xsd">LastName</lastName>
<phone xmlns="http://client.api.zedo.com/xsd">1010101</phone>
<state xmlns="http://client.api.zedo.com/xsd">StateName</state>
<zipCode xmlns="http://client.api.zedo.com/xsd">12345</zipCode>
</ax21:salesContact>
<status xmlns="http://client.api.zedo.com/xsd">A</status>
</ns:return>
</ns:getAdvertiserAllResponse>
</soapenv:Body>
</SOAP-ENV:Envelope>