Forum Discussion
keegan_morrison
Nimbostratus
Jun 09, 2008Generating IPPortDefinition in php
Hi. I'm stuck on something that seems so simple, yet has befuddled me for quite some time. Im trying to use LocalLB.PoolMember.wsdl to get statistics (specifically current connections) of a specific n...
keegan_morrison
Nimbostratus
Jun 20, 2008Posted By dmacvittie on 06/19/2008 2:25 PM
Here's what I think you're looking for Keegan:
[members] => Array
(
Array
(
[address] => 10.93.66.167
[port] => 80
)
)
I haven't tested this, but it should be an array of arrays of pool members.
Don.
Thanks for your response, dmacvittie. When i try to make members an array of arrays of addresses/ports, i get an error message stating "an error occurred in the call: Could not find element by name: address". However, when i make members just one array defined as
$members = Array('address'=>'10.93.67.167', port=>'80'); like I did in my original post, i do not get that error. It still does not work, however.
Joe, thanks for your response as well. The method I used for displaying the soap response is a PHP built in, called print_r(). Essentially, it dumps all elements of an array, including any nested arrays. I tried accessing the statistics array directly, and it was empty.
I was able to do a soap trace. I'm not sure exactly what it is supposed to look like. For troubleshooting purposes, I will post my full code as well as the output, including the soap trace.
$wdsl = "LocalLB.PoolMember.wsdl";
$soapoptions = array('namespace' => 'urn:iControl', 'trace' => 1);
$params['pool_names'] = Array(0 => "dsweb_tolphp5_pool");
$params['members'] = Array(
'address' => '10.93.66.167',
'port' => 80);
//here is where dmacvittie suggested making the members array an array of arrays,
//however, that causes the error message above.
print_r($params);
//$this->proxy_parms just has my username & password, i know that works fine.
$client = new SOAP_Client($this->wsdl_url . $wdsl, true, '', $this->proxy_parms);
$client->setOpt('curl', CURLOPT_SSL_VERIFYPEER, 0);
$client->setOpt('curl', CURLOPT_SSL_VERIFYHOST, 0);
$response = $client->call('get_statistics', $params, $this->soapoptions);
if (PEAR::isError($response))
{
die( "an error occurred in the call " . $response->message );
}
print_r($response);
//output soap trace
echo $client->__getLastRequest();
If any part of that is confusing, I can provide an explanation.
The output regarding the arrays & responses hasn't changed since my first post. Here is the soap trace output:
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:iControl"
xmlns:ns5="urn:iControl:LocalLB/PoolMember"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
dsweb_tolphp5_pool
10.93.66.167
80
I'm not sure what that is supposed to look like. However, I do notice that the declaration for the port value is an int, and the documentation calls for a long. Could that be causing the problem?
I have noticed that changing the IP to a node address that isn't in that pool makes no difference. Smae thing for changing the pool_names value, if I change it to a pool name that isn't in the currently selected partition, nothing special happens, i just get the response from my original post. I suspect this might be an issue. In most other instances, if I ask for information regarding a pool that is not a member of my current partition, it returns an error message. Could be a red herring, could be useful.
Let me know if you require any further information, and thanks for the help.
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
