<?
$credentials = "admin:passwd";
//Request
$xml_data = "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" ";
$xml_data .= "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"> ";
$xml_data .= "<SOAP-ENV:Body> <axl:getPhone xmlns:axl=\"http://www.cisco.com/AXL/1.0\" ";
$xml_data .= " xsi:schemaLocation=\"http://www.cisco.com/AXL/1.0 http://ccmip/schema/axlsoap.xsd\">";
$xml_data .= "<phoneName>SEP001B54523F81</phoneName>";
$xml_data .= "</axl:getPhone> </SOAP-ENV:Body> </SOAP-ENV:Envelope>";
$soap_out = "";
$soap_out .= "POST /axl/ HTTP/1.0\r\n";
$soap_out .= "Host:ccmip:8443\r\n";
$soap_out .= "Authorization: Basic " + authorization + "\r\n";
$soap_out .= "Accept: text/*\r\n";
$soap_out .= "Content-type: text/xml\r\n";
$soap_out .= "SOAPAction: \"CUCM:DB ver=6.1\"\r\n";
$soap_out .= "Content-length: ".strlen($xml_data)."\r\n";
$soap_out .= "Connection: Keep-Alive\r\n\r\n";
$soap_out .= $xml_data . "\n";
$options = array(
'uri' => 'http://www.cisco.com/AXL/1.0',
'location' => 'http://ccmip/axl/',
'xml_encoding' => 'UTF-8');
$client = new SoapClient('http://ccmip/axl/', $options);
$client->setCredentials('admin','passwd','basic');
$client->send($soap_out,'CUCM:DB ver=6.1',30,30,'');
$err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}
//echo $client->response;
echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
//echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
echo '<br><br>-------<br>';
echo '<pre>' . htmlspecialchars($soap_out, ENT_QUOTES) . '</pre>';
?>