Perl AXL and SOAP::Lite updating issues

Version 1
    This document was generated from CDN thread

    Created by: Jim Richardson on 14-06-2013 04:27:17 PM
    Thanks to everyone who has posted perl examples. I would not have made it as far as I have without them.

    Environment:
    CallManager 7.1
    Perl 5.12.2
    SOAP::Lite 0.715

    To my question. I am trying to update the display fields that tie a phone to a user to assist our administrators with assigning phones. The database fields I need to update are:

    NUMPLAN
    'description' => 'Jim Richardson Line 1'
    'alertingname' => 'Jim Richardson'
    'alertingnameascii' => 'Jim Richardson'
    DEVICENUMPLANMAP
    'displayascii' => 'Jim Richardson'
    'display' => 'Jim Richardson'
    'label' => 'Jim Richardson 8883'
    'labelascii' => 'Jim Richardson 8883'
    DEVICE                   
    'fkenduser' => 'bbd4df43-03c7-4c1c-b069-bd1b85f4715e'
    'description' => '8883 Jim Richardson'

    With Perl and SOAP::Lite I have been able to update all the field except for the fields in the NUMPLAN table: description, alertingname & alertingnameascii.

    NOTE: This code does not error, fields with the exceptions above get updated to values specified

    Here is the code I am using, any help would be appreciated. 


     1#!perl.exe
     2use warnings;
     3use strict;
     4use SOAP::Lite;
     5use Data::Dumper;
     6
     7
     8my $cucmip = "XXX.XXX.XXX.XXX"; 
     9my $axl_port = "8443";
    10my $user = "xxx";
    11my $password = "xxx";
    12my $axltoolkit = "AXLAPI.wsdl";
    13BEGIN {
    14  sub SOAP::Transport::HTTP::Client::get_basic_credentials {
    15    return ($user => $password)
    16  };
    17}
    18my $ver = "7.1";
    19my $cm = new SOAP::Lite
    20    -> encodingStyle('')
    21    -> on_action(sub { return "CUCM:DB ver=$ver" })
    22    -> proxy("https://$cucmip:$axl_port/axl/")
    23    -> uri("http://www.cisco.com/AXL/API/$ver");
    24    
    25#axl request
    26my $res = $cm->updatePhone(SOAP::Data->name('name' => "SEPACA016FCA626",
    27    SOAP::Data->name('description' => "AXL Test Phone 14" ),
    28    SOAP::Data->name('ownerUserId' => "jrichard" ),
    29    SOAP::Data->name('lines' => \SOAP::Data->value(
    30      # UPDATE FIRST LINE
    31      SOAP::Data->name( 'line' => \SOAP::Data->value(
    32        SOAP::Data->name( 'dirn' => \SOAP::Data->value(
    33          SOAP::Data->name('pattern' => "8893" ),
    34          SOAP::Data->name('description' => "Description 14" ), # <-- This line is not working
    35          SOAP::Data->name('usage' => "Device" ),
    36          SOAP::Data->name('routePartitionName' => "Corporate_Campus_Line1" ),
    37          SOAP::Data->name('label' => "Label 14" ),
    38          SOAP::Data->name('display' => "Display 14" ),
    39          SOAP::Data->name('asciiLabel' => "Ascii Label 14" ),
    40          SOAP::Data->name('displayASCII' => "Ansii Display 14" ),
    41          SOAP::Data->name('alertingName' => "Alerting 14" ), # <-- This line is not working
    42          SOAP::Data->name('asciiAlertingName' => "Acsii Alerting 14" ) # <-- This line is not working
    43        )), # dirn 8893 Corporate_Campus_Line1
    44      ))->attr({'index' => '1'} ), # line 1
    45      # UPDATE SECOND LINE
    46      SOAP::Data->name( 'line' => \SOAP::Data->value(
    47        SOAP::Data->name( 'dirn' => \SOAP::Data->value(
    48          SOAP::Data->name('pattern' => "8893" ),
    49          SOAP::Data->name('description' => "Description 15" ), # <-- This line is not working
    50          SOAP::Data->name('usage' => "Device" ),
    51          SOAP::Data->name('routePartitionName' => "Corporate_Campus_Line2" ),
    52          SOAP::Data->name('label' => "Label 15" ),
    53          SOAP::Data->name('display' => "Display 15" ),
    54          SOAP::Data->name('asciiLabel' => "Ascii Label 15" ),
    55          SOAP::Data->name('displayASCII' => "Ansii Display 15" ),
    56          SOAP::Data->name('alertingName' => "Alerting 15" ), # <-- This line is not working
    57          SOAP::Data->name('asciiAlertingName' => "Acsii Alerting 15" ) # <-- This line is not working
    58        )), # dirn 8893 Corporate_Campus_Line2    
    59    ))->attr({'index' => '2'} ), # line 2
    60  )) # lines
    61)); # updatePhone
    62
    63
    64unless ($res->fault) {
    65    print Dumper($res->paramsall());  
    66} else {
    67  print join ', ',
    68  "FAULTCODE: " . $res->faultcode,
    69  "FAULTSTRING: " . $res->faultstring;
    70}


    Subject: RE: Perl AXL and SOAP::Lite updating issues
    Replied by: Martin Sloan on 15-06-2013 08:40:36 AM
    Hi Jim,

    Check the updatePhoneReq element in your schema  version to make sure, because in the latest version those fields are not available in the call.  I guess the system is just ignoring them which is why you're not getting an error.  You might have to follow up with an updateLineReq.

    Marty

    Subject: RE: Perl AXL and SOAP::Lite updating issues
    Replied by: Jim Richardson on 18-06-2013 03:37:56 PM
    Martin Sloan:
    Hi Jim,

    Check the updatePhoneReq element in your schema  version to make sure, because in the latest version those fields are not available in the call.  I guess the system is just ignoring them which is why you're not getting an error.  You might have to follow up with an updateLineReq.

    Marty

    Marty,

    While the axlapi for 7.1 says it should work, it does not. I added two updateLine statements and all is working well. Below is the final code. Thanks for you help!

     1#!/usr/bin/perl
     2use warnings;
     3use strict;
     4use SOAP::Lite;
     5use Data::Dumper;
     6
     7
     8my $cucmip = "xxx.xxx.xxx.xxx";
     9my $axl_port = "8443";
    10my $user = "xxx";
    11my $password = "xxx";
    12my $axltoolkit = "AXLAPI.wsdl";
    13BEGIN {
    14  sub SOAP::Transport::HTTP::Client::get_basic_credentials {
    15    return ($user => $password)
    16  };
    17}
    18my $ver = "7.1";
    19my $cm = new SOAP::Lite
    20    -> encodingStyle('')
    21    -> on_action(sub { return "CUCM:DB ver=$ver" })
    22    -> proxy("https://$cucmip:$axl_port/axl/")
    23    -> uri("http://www.cisco.com/AXL/API/$ver");
    24
    25
    26#axl request
    27my $res = $cm->updatePhone(SOAP::Data->name('name' => "SEPACA016FCA626",
    28    SOAP::Data->name('description' => "AXL Test Phone 14" ),
    29    SOAP::Data->name('ownerUserId' => "jrichard" ),
    30    SOAP::Data->name('lines' => \SOAP::Data->value(
    31      # UPDATE FIRST LINE
    32      SOAP::Data->name( 'line' => \SOAP::Data->value(
    33        SOAP::Data->name( 'dirn' => \SOAP::Data->value(
    34          SOAP::Data->name('pattern' => "8893" ),
    35          SOAP::Data->name('usage' => "Device" ),
    36          SOAP::Data->name('routePartitionName' => "Corporate_Campus_Line1" ),
    37          SOAP::Data->name('label' => "Label 14" ),
    38          SOAP::Data->name('display' => "Display 14" ),
    39          SOAP::Data->name('asciiLabel' => "Ascii Label 14" ),
    40          SOAP::Data->name('displayASCII' => "Ansii Display 14" )
    41        )), # dirn 8893 Corporate_Campus_Line1
    42      ))->attr({'index' => '1'} ), # line 1
    43      # UPDATE SECOND LINE
    44      SOAP::Data->name( 'line' => \SOAP::Data->value(
    45        SOAP::Data->name( 'dirn' => \SOAP::Data->value(
    46          SOAP::Data->name('pattern' => "8893" ),
    47          SOAP::Data->name('usage' => "Device" ),
    48          SOAP::Data->name('routePartitionName' => "Corporate_Campus_Line2" ),
    49          SOAP::Data->name('label' => "Label 15" ),
    50          SOAP::Data->name('display' => "Display 15" ),
    51          SOAP::Data->name('asciiLabel' => "Ascii Label 15" ),
    52          SOAP::Data->name('displayASCII' => "Ansii Display 15" )
    53        )), # dirn 8893 Corporate_Campus_Line2    
    54    ))->attr({'index' => '2'} ), # line 2
    55  )) # lines
    56)); # updatePhone
    57
    58
    59unless ($res->fault) {
    60    print Dumper($res->paramsall());  
    61} else {
    62  print join ', ',
    63  "FAULTCODE: " . $res->faultcode,
    64  "FAULTSTRING: " . $res->faultstring;
    65}
    66
    67
    68my $res1 = $cm->updateLine(SOAP::Data->name('pattern' => "8893" ),
    69                           SOAP::Data->name('routePartitionName' => "Corporate_Campus_Line1" ),
    70          SOAP::Data->name('description' => "Description 14" ), 
    71          SOAP::Data->name('alertingName' => "Alerting 14" ), 
    72          SOAP::Data->name('asciiAlertingName' => "Acsii Alerting 14" )
    73); #updateLine 1
    74unless ($res1->fault) {
    75    print Dumper($res1->paramsall());  
    76} else {
    77  print join ', ',
    78  "FAULTCODE: " . $res1->faultcode,
    79  "FAULTSTRING: " . $res1->faultstring;
    80}
    81
    82
    83$res1 = $cm->updateLine(SOAP::Data->name('pattern' => "8893" ),
    84                           SOAP::Data->name('routePartitionName' => "Corporate_Campus_Line2" ),
    85          SOAP::Data->name('description' => "Description 15" ), 
    86          SOAP::Data->name('alertingName' => "Alerting 15" ), 
    87          SOAP::Data->name('asciiAlertingName' => "Acsii Alerting 15" ) 
    88          
    89); #updateLine 2
    90unless ($res1->fault) {
    91    print Dumper($res1->paramsall());  
    92} else {
    93  print join ', ',
    94  "FAULTCODE: " . $res1->faultcode,
    95  "FAULTSTRING: " . $res1->faultstring;
    96}


    Subject: RE: Perl AXL and SOAP::Lite updating issues
    Replied by: Martin Sloan on 18-06-2013 03:49:42 PM
    Jim,

    You're most welcome.  Glad it's working!

    Marty