Forum Discussion
Puli
Nimbostratus
Mar 20, 2008How to capture return messages in perl
Am trying to capture return messages in a perl variable so i can make decisions based on that.
Specificatlly am want capture return message from
$soapResponse = $PoolMember->get_session_enabled_state
(
SOAP::Data->name(pool_names => [@pool_list])
);
Can anyone help.
Ven
- Do a site search on "PoolMember->get_session_enabled_state" and you'll see a bunch of perl samples using that method. Here's one from the CodeShare:
http://devcentral.f5.com/wiki/default.aspx/iControl/TogglePoolMember.html
- Puli
Nimbostratus
sorry, more information. - An example of that is in that sample on code share as well. Look at the checkResponse() subroutine. You can see if the fault member of the $soapResponse is set, and if so, get the value form the $soapResponse->faultcode and $soapResponse->faultstring.
- Ok, I think I get what you are getting at. If you want to trap HTTP level error messages, you'll need to put an eval around your call and then interrogate the $soap->transport class's members (code, message, & status)
eval { $soapResponse = $PoolMember->get_session_enabled_state ( SOAP::Data->name(pool_names => [@pool_list]) ); }; if ( $PoolMember->transport->status != 200 ) { print "Code : ", $PoolMember->transport->code, "\n"; print "Message: ", $PoolMember->transport->message, "\n"; print "Status : ", $PoolMember->transport->status, "\n"; exit; } else { ... }
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