Chat with Us!

How to ... Use the AXL WSDL with PHP

CUCM/AXL Version tested: 10.5(1)

Platform: Ubuntu 9.04, extra packages: php5, php-soap

The PHP project provides a simple SOAP handling library that makes it fairly easy to interact with web services. The following code performs a <getUser> query and prints out the user's first and last names.

Note, this example creates an HTTPS connection to the UCM AXL service, but does not validate the UCM's security certificate. (See the PHP SOAPClient 'local_cert' option.)

The AXL WSDL (AXLAPI.wsdl and axlsoap.xsd files from the AXL SQL Toolkit - AXIS versions) were copied to /var/www on the PHP server. Note, PHP SOAP will cache this WSDL for 24 hours by default - this caching can be disabled in php.ini.

    <html>
    <head>
        <title>PHP Test</title>
    </head>
    <body>
        <?php
            $client = new SoapClient("/var/www/AXLAPI.wsdl",
                array('trace'=>true,
               'exceptions'=>true,
               'location'=>"https://<server>:8443/axl",
               'login'=>'adminUserID',
               'password'=>'password',
            ));
           $response = $client->getUser(array("userid"=>"dstaudt"));
           echo("First Name: ".$response->return->user->firstName)."<br>";
           echo("Last Name: ".$response->return->user->lastName);
        ?>
    </body>
</html>