cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
Walkthrough Wednesdays
895
Views
0
Helpful
6
Replies
chad_meyer
Beginner

AXL PHP Connection

Hey all,

 

I am trying to develop an IIS hosted webpage that will allow me to update phones without having to login to the UI.  I am new with SOAP and APIs in general and have followed Cisco's PHP guide on AXL connections.  We are running CUCM 11.5.  Postman query is successful, however am unsure how to get my connection to work via php file in IIS.  Test php file works no problem so IIS should not be the culprit.  Below is my code that is currently returning a 500 error:

 

<?php

$host = "<FQDN of server>";
$username = "******";
$password = "**********";

$context =
    stream_context_create(array('ssl'=>array('allow_self_signed'=>true)));

$client = new SoapClient("C:\inetpub\wwwroot\PhoneSetup\AXLAPI.wsdl",
    array('trace'=>true,
   'exceptions'=>true,
   'location'=>"https://".$host.":8443/axl",
   'login'=>$username,
   'password'=>$password,
   'stream_context'=>$context

));

$response = $client->getPhone(array("name"=>"	SEP5065F3B9AB95"));
?>

Any assistance as to where to start troubleshooting this?

 

Thanks in advance.

6 REPLIES 6
ROBERT SCHUKNECHT
Contributor

Hi Chad,

i am no expert in PHP but it seems to be that there are Spaces in the String of the Device Name

" SEP5065F3B9AB95". I would try to remove these Spaces so that the String becomes

"SEP5065F3B9AB95".


HTH,

Robert

Thanks for catching this Robert, however I am still receiving the same error after making that change.

You may also need to either disable cert name checking, or download the CUCM Tomcat cert and reference it:

 

	$context = stream_context_create(array('ssl'=>array('verify_peer_name'=>false,
		'allow_self_signed'=>true
		)));
	$context = stream_context_create(array('ssl'=>array('verify_peer_name'=>true,
		'allow_self_signed'=>true,
		'cafile'=>"/var/www/html/PHP-Sample/DS-UCM105.cisco.com.pem"
		)));

dstaudt,

 

I have the tomcat cert (in pem format) listed in the directory listed in the PHP script. Even when I had it disabled I was receiving errors.

Update - I found that I didn't have the soap extension DLL enabled in my PHP.ini file.  I enabled that then,still had issues then nulled out the certificate check and now my page loads, however to a white screen.  No error logs are shown in either IIS or PHP.  Getting closer. 

You won't see anything on your page as you have no output.
Add a
var_dump($response);
after
$response = $client->getPhone(array("name"=>" SEP5065F3B9AB95"));

and you will see the response
Content for Community-Ad

This widget could not be displayed.