Forum Discussion
zak_thompson_86
Nimbostratus
Jan 22, 2008add_address_class_member.. not adding?
So using php and soap.
I can grab the classes display them. print ou their contents. all good.. but however.. can't add anything..
try {
$client = new SoapClient($wsdl,array('location'=>$location,'login'=>$username,'password'=>$password));
$pool_list=$client->get_address_class_list();
$classOpt = array('name' => 'testblock');
print_r($client->get_address_class($classOpt));
$addBlock = array('address' => '21.1.1.1','netmask' => '255.255.255.255');
$doIt = array('name' => $classOpt,'members' => $addBlock);
try {
$client->add_address_class_member("asfasdfasdf");
}
catch (Exception $k)
{
echo "ARG!";
echo $k->getMessage();
}
//print_r($pool_list);
}
catch (Exception $e) {
echo "Error!
";
echo $e -> getMessage ();
}
No exceptions on failure nothing been beating it around for a while with little luck.
- The issue you are having is that the add_address_class_member takes an array of structures defining the address class entries you want to add. You are passing in a scalar string. The server is looking for an array and when you pass a scalar, the array conversion doesn't find an array definition and interprets it as an empty array and essentially performs a no-op.
struct LocalLB::Class::AddressEntry { string address; string netmask; }; struct LocalLB::Class::AddressClass { string name; AddressEntry [] members; }; LocalLB::Class::add_address_class_member( in LocalLB::Class::AddressClass [] class_members );
- zak_thompson_86
Nimbostratus
yeah.. no real idea what your talking about tried making a new object using $client->AddressClass but thats not valid.. no real idea how to accomplish this to be honest. - What exactly don't you understand about what I'm talking about?
$client->add_address_class_member("asfasdfasdf");
$client->add_address_class_member($doIt);
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects