Can't not add new Device Pool (PHP Developer).

Version 1
    This document was generated from CDN thread

    Created by: ALFREDO PRADO on 14-11-2009 12:20:57 PM
    Can't not add new Device Pool (PHP Developer).
     
    Hi,
          
          Try make a supercopy with already create device pool "DP_LAB_1" and AXL function response "Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Client] Cannot insert a null into column (devicepool.fkcallmanagergroup).". My Call Manager version is 6.1.2.1000-13.

     
          This is my code:
     
    #!/usr/bin/php -q
    <?php


        function object_to_array($mixed)
        {
            if(is_object($mixed)) $mixed = (array) $mixed;
            if(is_array($mixed)) {
                $new = array();
                foreach($mixed as $key => $val) {
                    $key = preg_replace("/^\\0(.*)\\0/","",$key);
                    $new[$key] = object_to_array($val);
                }
            }
            else $new = $mixed;
           
            return $new;      
        }


       
        $client = new SoapClient("./WSDL-AXIS/AXLAPI.wsdl",
                    array('trace'=>true,
                          'exceptions'=>true,
                          'location'=>"https://X.X.X.X:8443/axl",
                          'login'=>'axluser',
                          'password'=>'password',
                           ));

        $devicePool = $client->getDevicePool(array("name"=>"DP_LAB_1"));
       
        $devicePool->return->devicePool->name = "DP_TEST";
        unset($devicePool->return->devicePool->uuid);
        $devicePool = object_to_array($devicePool);

     
        print_r($devicePool);
        $client->addDevicePool($devicePool->return->devicePool);
       
    ?>

     
    This is a complete output :
     
    ./getUserCUCM61.php
    Array
    (
         => Array
            (
                 => Array
                    (
                         => DP_TEST
                        [dateTimeSettingName] => CMLocal
                        [callManagerGroupName] => CCMG_LAB_1
                        [mediaResourceList] => Array
                            (
                                 => {BC5A6392-6A89-A90C-788E-CD6F428820B2}
                            )

                         => R_LAB_1
                         => Colombia
                         => SRST_LAB_1
                        [connectionMonitorDuration] => -1
                         => L_LAB_1
                        [physicalLocationName] => PL_LAB_1
                         => Default
                        [singleButtonBarge] => Default
                         => Default
                    )

            )

    )

    Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Client] Cannot insert a null into column (devicepool.fkcallmanagergroup). in /var/www/cucm/getUserCUCM61.php:35
    Stack trace:
    #0 [internal function]: SoapClient->__call('addDevicePool', Array)
    #1 /var/www/cucm/getUserCUCM61.php(35): SoapClient->addDevicePool(NULL)
    #2 {main}
      thrown in /var/www/cucm/getUserCUCM61.php on line 35


     



    Subject: RE: Can't not add new Device Pool (PHP Developer).
    Replied by: David Staudt on 16-11-2009 04:43:47 PM
    Can you attach the AXL service logs (available via the RTMT tool?)  This should show the actual XML request from the app.

    Subject: RE: Can't not add new Device Pool (PHP Developer).
    Replied by: ALFREDO PRADO on 16-11-2009 05:36:07 PM
    Hi David:
     
        Thank's for you help, but no I found the problem, the problem is my old version of PHP, bacuse with other more new the addDevicePool function work fine. Now I use:
     
     php -v
    PHP 5.2.6-1+lenny3 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 26 2009 22:16:23)
    Copyright (c) 1997-2008 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
     
        Best Regards,