get_object_status PHP

I’m trying to write a php app which uses iControl on the GTM and LTM.

So far I have the following..;

// Create SOAP instance

$args = array(‘soap_version’ => SOAP_1_1,

‘location’ => “https://:443$host/iControl/iControlPortal.cgi”,

‘login’ => $login,

‘uri’ => ‘urn:iControl:GlobalLB/WideIP’,

‘password’ => $password);

$this->_client = new SoapClient(null, $args);

// List Wide-IP’s

$wide_ips = $this->_client->get_list();

Now - this works and I get an array back. But when I try and call get_object_status, I get the same error over and over..;

[SOAP-ENV:Server] Could not find element by name: wide_ips

I’ve tried so many different ways of calling it..;

$wide_ips_status = $this->_client->get_object_status(array(‘wide_ips’ => $wide_ips));

$wide_ips_status = $this->_client->get_object_status($wide_ips);

etc etc.

How should I be calling it?

Thanks

You are not launching SoapClient in WSDL mode, you need to give SoapClient the WSDL file either as a local file or a URL.

I modifed your code, so it works now. Note that “location” is now a variable which is used to form the start of the WSDL URL for the SoapClient

I assume you are using PHP 5.1+

$location = "https://$host:443/iControl/iControlPortal.cgi"; 
 // Create SOAP instance 
 $args = array('soap_version' => SOAP_1_1, 
 'location' => $location, 
 'login' => $login, 
 'password' => $password); 
  
 //note the SoapClient is called with WSDL as a first parameter 
 $this->_client = new SoapClient($location . '?WSDL=GlobalLB.WideIP', $args); 
  
 //get WideIPs from iControl 
 $wide_ips = $this->_client->get_list(); 
  
 // List Wide-IP's 
 var_dump($wide_ips); 
  
 //get object status 
 $status_array=$this->_client->get_object_status($wide_ips); 
 var_dump($status_array);

Hope this helps.

Sam