Forum Discussion

cmaloy_15909's avatar
cmaloy_15909
Icon for Nimbostratus rankNimbostratus
May 15, 2013

Need help with PHP call get_member_object_status

I am trying to make a PHP call to get_member_object_status but it is returning empty arrays. I am guessing that the second argument (AddressPort[] []) is not properly formatted in a multidimensional array. Any help would be appreciated.

 

ObjectStatus [] [] get_member_object_status(
    in String [] pool_names,
    in Common__AddressPort [] [] members
);

 

PHP code is below

 

 

$username='xxxxx';

 

$password='xxxxx';

 

 

$location="https://$hostname/iControl/iControlPortal.cgi?";

 

$wsdl="https://$hostname/iControl/iControlPortal.cgi?WSDL=LocalLB.Pool";

 

$wsdl2="https://$hostname/iControl/iControlPortal.cgi?WSDL=System.Session";

 

 

$client = new SoapClient($wsdl,array('location'=>$location,'login'=>$username,'password'=>$password));

 

$client2 = new SoapClient($wsdl2,array('location'=>$location,'login'=>$username,'password'=>$password));

 

 

$client2->set_active_folder('/TrafficGroup1');

 

$client2->set_recursive_query_state("STATE_ENABLED");

 

 

echo "getting pool list

 

";

 

$pool_list=$client->get_list();

 

$poolstatus=$client->get_object_status($pool_list);

 

$memberlist=$client->get_member_v2($pool_list);

 

 

foreach ($pool_list as $index=>$pool)

 

{

 

echo "pool name is $pool

 

";

 

 

foreach ($memberlist[$index] as $member_index=>$member_value)

 

{

 

$address=$member_value->address;

 

$port=$member_value->port;

 

$memberstatus=$client->get_member_object_status($pool, $member_value);

 

var_dump($memberstatus);

 

}

 

}

 

?>

 

 

Output is

 

getting pool list

 

pool name is /TrafficGroup1/poolnameX

 

array(0) { }

 

array(0) { }

 

array(0) { }