AXL PHP Error - Cannot insert a null into column

Version 1
    This document was generated from CDN thread

    Created by: Jason Rohm on 17-08-2011 03:09:10 PM
    I am receiving the following PHP/Apache error when attempting a very simple line update.
     
    [Wed Aug 17 14:06:36 2011]  [client 10.3.64.165] PHP Fatal error:  Uncaught SoapFault exception: [soapenv:Client] Cannot insert a null into column (devicenumplanmap.fknumplan). in /var/www/html/axl/test2.php:14\nStack trace:\n#0 [internal function]: SoapClient->__call('updatePhone', Array)\n#1 /var/www/html/axl/test2.php(14): SoapClient->updatePhone(Array)\n#2 {main}\n  thrown in /var/www/html/axl/test2.php on line 14

    The phone and line exist and I am able to make other modifications to the phone itself and the the DIRN based on the uuid, but other cosmetic changes to the line appearance fail.
     
    Complete test code:
     
    <html><head><title>PHP Test</title></head>
    <body>
    <?php
     $client = new SoapClient("AXLAPI.wsdl",
      array('trace'=>true,
      'exceptions'=>true,
      'location'=>"https://callmanager:8443/axl",
      'login'=>'REMOVED',
      'password'=>'REMOVED',
      )
     );
     $response = $client->updatePhone(array("name"=>"SEPD0C282D10E02","lines"=>(array("line"=>array("index"=>"1", "label"=>"A New Label")))));
     var_dump($response);
    ?>
    </body></html>

    Subject: RE: AXL PHP Error - Cannot insert a null into column
    Replied by: Jason Rohm on 17-08-2011 04:07:43 PM
    The following post applies to the same error but with a non-applicable solution.

    http://developer.cisco.com/web/axl/forums/-/message_boards/view_message/1052849

    Subject: RE: AXL PHP Error - Cannot insert a null into column
    Replied by: Jason Rohm on 17-08-2011 04:54:55 PM
    After gratuitus trial and error, I've found the answer to my own problem.

    It seems that the system is expecting SOME dirn identity information to function. I'm not sure if that is documented somewhere (if you know, send me the link). However, the following corrected my issues...

    FAILS:

    $response = $client->updatePhone(array("name"=>"SEPD0C282D10E02","lines"=>(array("line"=>array("index"=>"1", "label"=>"A New Label")))));

    SUCCEEDS:

    $response = $client->updatePhone(array("name"=>"SEPD0C282D10E02","lines"=>array("line"=>array("index"=>"1","label"=>"A New Label", "dirn"=>array("pattern"=>"148116") ))));

    SUCCEEDS:

    $response = $client->getPhone(array("name"=>"SEPD0C282D10E02"));
    $line_uuid = preg_replace('/[\{\}]/', '', $response->return->phone->lines->line->dirn->uuid);
    $response = $client->updatePhone(array("name"=>"SEPD0C282D10E02","lines"=>array("line"=>array("index"=>"1","label"=>"A New Label", "dirn"=>array("uuid"=>"$line_uuid") ))));