Home » updatePublisher

updatePublisher

Description

Updates the Publisher with the given publisher ID

Attributes

FieldTypeRequired
PublisherPublisherTrue

Publisher

 

FieldTypeDescriptionRequiredAccepted Value
idintA unique number to identify the publisher. falseThis is set by default when user is created.
namestringPublisher Name.false
statusstringDisplays whether the publisher is active or inactive. falseAccepted values are 'A' for active and 'I' for inactive.
codeintA unique number to identify the publisher.false
siteLocationstringThe publishers website url.false
salesContactContactInformation of a sales contact personfalse
billingContactContactSales Contact's first name.false

Samples

Java

import javax.xml.namespace.QName;
import org.apache.axis2.AxisFault;
import com.zedo.zapi.ZEDOAPIStub;

public class UpdatePublisherTest {

    public static void main(String[] args) {
        UpdatePublisherTest.updatePublisherTest();
    }

    private static void updatePublisherTest() {
        
        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);
            
            ZEDOAPIStub.GetPublisher req = new ZEDOAPIStub.GetPublisher();
            req.setId(462323);
            Thread.sleep(1000);
            ZEDOAPIStub.GetPublisherResponse res = stub.getPublisher(req);
            ZEDOAPIStub.Publisher p = res.get_return();
            
            p.setName("aaaa");
//            p.setSiteCode(0);
            p.setSiteLocation("http://www.ZedoTest.ru");
            p.setStatus("A");           
            
            ZEDOAPIStub.Contact c1 = new ZEDOAPIStub.Contact();
            c1.setAddress1("");
            c1.setAddress2("");
            c1.setCity("");
            c1.setCountry("");
            c1.setEmail("");
            c1.setFax("");
            c1.setFirstName("");
            c1.setLastName("");
            c1.setPhone("");
            c1.setState("");
            c1.setZipCode("");
            p.setBillingContact(c1);
            
            ZEDOAPIStub.Contact c2 = new ZEDOAPIStub.Contact();
            c2.setAddress1("");
            c2.setAddress2("");
            c2.setCity("");
            c2.setCountry("");
            c2.setEmail("");
            c2.setFax("");
            c2.setFirstName("");
            c2.setLastName("");
            c2.setPhone("rkrgfrk krkrkr krkrjnm");
            c2.setState("");
            c2.setZipCode("");
            p.setSalesContact(c2);
              
            ZEDOAPIStub.UpdatePublisher up = new ZEDOAPIStub.UpdatePublisher();
            up.setPublisher(p);
            Thread.sleep(1000);
            stub.updatePublisher(up);
            
            System.out.println("UPDATE_PUBLISHER COMPLETE!");
            System.out.println("PLEASE: " + up.getPublisher().getName() + " " + up.getPublisher().getId());

        } catch (Exception e) {
            System.err.println("ERROR: UPDATE_PUBLISHER 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 
         */
        $publisher_id = 1349779;
        $param = new getPublisher($publisher_id);
        
        /**
         *Execute API Call 
         */
        try {
        $response = $stub->getPublisher($param);
        }catch (SoapFault $ex) {
            var_dump($ex->faultcode, $ex->faultstring, $ex->detail);
                echo "GET PUBLISHER FAILED\n";
                die();
        }
        
        /**
         * Response
         */
        $tmp = new getPublisherResponse($response);
        $tmp = $tmp->return;
        $publisher = $tmp->return;
        /**
         * Edit Publisher
         */
        
        $publisher->name="EditPublisherTest";
        
        $contact = new Contact();
        $contact->address1="address1";
        $contact->address2="address2";
        $contact->city="city";
        $contact->companyName="companyName";
        $contact->country="country";
        $contact->email="email";
        $contact->fax="fax";
        $contact->firstName="firstName";
        $contact->lastName="lastname";
        $contact->phone="phone";
        $contact->state="state";
        $contact->zipCode="zipCode";
        $publisher->billingContact=$contact;
        $publisher->salesContact=$contact;
        
        /**
         * Update Publisher
         */
        print_r($publisher);
        $updatePublisher = new updatePublisher($publisher);
        try {
                $response = $stub->updatePublisher($updatePublisher);
        }catch (SoapFault $ex) {
             var_dump($ex->faultcode, $ex->faultstring, $ex->detail);
                echo "UPDATE PUBLISHER FAILED\n";
                die();
        }


SOAP

Request

POST /axis2/services/ZEDOAPI?wsdl HTTP/1.1
Content-Type: application/soap+xml; charset=UTF-8; action="urn:updatePublisher"
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>
<ns5:updatePublisher xmlns:ns5="http://zapi.zedo.com">
<ns5:pub>
<billingContact xmlns="http://client.api.zedo.com/xsd">
<address1>xcv</address1>
<address2>cb</address2>
<city>city</city>
<companyName>
</companyName>
<country>sdf</country>
<email>sdfg</email>
<fax>ab</fax>
<firstName>ZCg</firstName>
<lastName>drg</lastName>
<phone>74578</phone>
<state>ilui</state>
<zipCode>4524</zipCode>
</billingContact>
<ns1:code xmlns:ns1="http://client.api.zedo.com/xsd">1813</ns1:code>
<ns1:id xmlns:ns1="http://client.api.zedo.com/xsd">1173691</ns1:id>
<ns1:name xmlns:ns1="http://client.api.zedo.com/xsd">update_thru_api_6</ns1:name>
<salesContact xmlns="http://client.api.zedo.com/xsd">
<address1>chf</address1>
<address2>fhfgh</address2>
<city>fghfth</city>
<companyName>
</companyName>
<country>dged</country>
<email>rfthrtfh</email>
<fax>ac</fax>
<firstName>fname</firstName>
<lastName>tyujyuj</lastName>
<phone>45353</phone>
<state>ghkh</state>
<zipCode>435</zipCode>
</salesContact>
<ns1:siteLocation xmlns:ns1="http://client.api.zedo.com/xsd">http://www.dograe.com</ns1:siteLocation>
<ns1:status xmlns:ns1="http://client.api.zedo.com/xsd">I</ns1:status>
</ns5:pub>
</ns5:updatePublisher>
</soapenv:Body>
</soapenv:Envelope>

Response


HTTP/1.1 200 OK
Date: Thu, 21 Jan 2016 09:27:03 GMT
Server: Simple-Server/1.1
Transfer-Encoding: chunked
Content-Type: application/soap+xml; charset=UTF-8; action="urn:updatePublisherResponse"
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<ns:updatePublisherResponse xmlns:ns="http://zapi.zedo.com">
<ns:return>0</ns:return>
</ns:updatePublisherResponse>
</soapenv:Body>
</soapenv:Envelope>