Forum Discussion
Laggin_53249
Nimbostratus
Sep 14, 2007m_interface.initialize() always returns true, isValid() always returns false?
I can't believe I haven't run into this until now.
As long as I supply a valid ip address for the m_interface.initialize(Host . . .value, the return value is always true, regardless if the u...
Sep 14, 2007
Good points. The Initialize method basically validates that the inputs are correct format (address/port/etc) but does not actually connect to the BIG-IP to verify connectivity information (in hindsight maybe it should).
The m_interface.ConnectionInfo.isValid() call verifies that the inputs for hostname, port, username, and password are non-zero length (meaning that the initialize call was made and succeeded). Not sure how this could be returning false. I'll have to test this out.
With what you have, the easiest way to verify a connection is to put a try/catch loop around an iControl call after you make the initialize() call.
...
m_interfaces.initialize(...)
try
{
String sVersion = m_interfaces.SystemInfo.get_version();
}
catch (Exception)
{
// Invalid connection.
}I'll look at adding the true connectivity to the assembly's intialize method but in the mean time, this should get you going. I'll also double check on the isValid() method returning false, it should not be in your case...
-Joe
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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