<?php
   
// Enables or disables the WSDL caching feature 
   
ini_set("soap.wsdl_cache_enabled""0"); 
 
   
// Your API Access key, that you generated in the customer portal 
   
define('AUTH_KEY'
          
'000000000000000000000000000000000000000000000000000'); 
 
   
// Your Customer Portal Username 
   
define('AUTH_USER','SL00000');   

   
// Where our SOAP server is located 
   
define('SOAP_SERVER_LOCATION '
      
'https://api.service.softlayer.com/soap/v1/SL-Service.html');      

   
$client = new SoapClient(null, array('location' => SOAP_SERVER_LOCATION
                                     
'uri'      => SOAP_SERVER_LOCATION) );

   
# Did our SOAP call complete?
   
$bolResult       false

   
# What was the returned error message
   
$strErrorMessage "";

   
# Lets store our results in an array
   
$arrResult       = array();

   try {
      
$arrResult $client->__call("getServerList", array() ,null ,
             new 
SoapHeader('myUrn''authenticate',
                            array(
AUTH_USERAUTH_KEY) ) );        
      
$bolResult true
   
} catch( SoapFault $e ) {
      
$strErrorMessage $e->getMessage();
   }

   if(
$bolResult){
      echo 
'<table cellpadding="2">'."\n";
      if(
count($arrResult)){
    foreach(
$arrResult as $arrServer){
         echo 
'<tr>';
         echo 
'<td>'.$arrServer['ID'].'</td>';
         echo 
'<td>'.$arrServer['SERVERNAME'].'</td>';
         echo 
'<td>'.$arrServer['PUBLIC_IP_ADDRESS'].'</td>';
         echo 
'<td>'.$arrServer['PRIVATE_IP_ADDRESS'].'</td>';
         echo 
'<td>'.$arrServer['MGMT_IP_ADDRESS'].'</td>';
         echo 
"</tr>\n";
    }
      } else {
        echo 
"<tr><td>No Servers Found!</td></tr>";
      }
      echo 
"</table>\n";
   }else{
      echo 
"There was an error with your SOAP call<br>\n";
      echo 
"Error Response:<br>\n";
      echo 
$strErrorMessage."<br>\n";
   }
echo 
"Done!<br>\n";
?>