Home » updateDimension

updateDimension

Description

Updates the dimension with the given dimension ID

Attributes

FieldTypeDescriptionRequired
DimensionDimensionTrue

 

Dimension

FieldTypeDescriptionRequired
idintfalse
namestringfalse
statusstringfalse
xintfalse
yintfalse
editstringfalse

Samples

Java

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

public class UpdateDimensionTest {

    public static void main(String[] args) {
        UpdateDimensionTest.updateDimensionTest();
    }
    
    private static void updateDimensionTest() {
        
        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.GetDimension gd = new ZEDOAPIStub.GetDimension();
            gd.setId(21);
            Thread.sleep(1000);
            ZEDOAPIStub.GetDimensionResponse gdr = stub.getDimension(gd);
            ZEDOAPIStub.Dimension d = gdr.get_return();
            
            d.setName("ZedoTest test");
            d.setEdit("N");
            d.setId(20);
            d.setStatus("A");
            d.setX(23);
            d.setY(23);

            ZEDOAPIStub.UpdateDimension ud = new ZEDOAPIStub.UpdateDimension();
            ud.setDimension(d);
            Thread.sleep(1000);
            stub.updateDimension(ud);
   
            System.out.println("UPDATE_DIMENSION COMPLETE!");
            System.out.println("PLEASE: " + ud.getDimension().getId() + " " + ud.getDimension().getName());

        } catch (Exception e) {
            System.err.println("ERROR: UPDATE_DIMENSION 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 
         */
        $dimension_id = 17;
        $param = new getDimension($dimension_id);
        
        /**
         *Execute API Call 
         */
        
        
        try {
        $response = $stub->dimension=$param;
        }catch (SoapFault $ex) {
          var_dump($ex->faultcode, $ex->faultstring, $ex->detail);
                echo "GET CHANNELSET FAILED\n";
                die();
        }
        
        /**
         * Response
         */
        $tmp = new getDimensionResponse($response);
        $tmp = $tmp->return;
        $dimension = $tmp->return;
        /**
         * Edit Dimension
         */
        $dimension->status="I";
        
        /**
         * Update Dimension
         */
        print_r($dimension);
        $updateDimension = new updateDimension($dimension);
        try {
                $response = $stub->updateDimension($updateDimension);
        }catch (SoapFault $ex) {
           var_dump($ex->faultcode, $ex->faultstring, $ex->detail);
                echo "UPDATE DIMENSION FAILED\n";
                die();
        }

SOAP

Request

POST /axis2/services/ZEDOAPI?wsdl HTTP/1.1
Content-Type: application/soap+xml; charset=UTF-8; action="urn:updateDimension"
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:updateDimension xmlns:ns5="http://zapi.zedo.com">
<ns5:dimension>
<ns1:edit xmlns:ns1="http://client.api.zedo.com/xsd">edit</ns1:edit>
<ns1:id xmlns:ns1="http://client.api.zedo.com/xsd">88</ns1:id>
<ns1:name xmlns:ns1="http://client.api.zedo.com/xsd">dimname</ns1:name>
<ns1:status xmlns:ns1="http://client.api.zedo.com/xsd">A</ns1:status>
<ns1:x xmlns:ns1="http://client.api.zedo.com/xsd">1</ns1:x>
<ns1:y xmlns:ns1="http://client.api.zedo.com/xsd">10</ns1:y>
</ns5:dimension>
</ns5:updateDimension>
</soapenv:Body>
</soapenv:Envelope>

Response

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