Forum Discussion

oksana_132542's avatar
oksana_132542
Icon for Nimbostratus rankNimbostratus
Dec 02, 2013
Solved

Authorization Required Error in PoolMemberChangeState.pl

Hello, I'm working through the sample provided to enable/disable pool member. When I run the script I get the following error: C:\Users\OXSHTU\Documents\newsetupAPI\iControl-11.1.0\sdk\samples\soap\perl\soaplite\LocalLB>C:\strawberry\perl\bin/perl5.16.3.exe

test-icontrolproxy-pool-member-state.pl IPofF5 443 MyUserID MyPassword IPofPoolMember:8080 disable

Get devices...

401 F5 Authorization Required at test-icontrolproxy-pool-member-state.pl line 138.

I tested that I can manually login to the F5 and perform disable/enable tasks. Here is what i have in .pl script starting from line 136:

 EM: get devices.
 print "\nGet devices...\n";
 my $resp = $soap->uri('urn:iControl:Management/EM')->get_devices();
 my $device_list = $resp->result;

 EM: generate a context ID.
 print "\nGenerate context ID...\n";
 $resp = $soap->uri("urn:iControl:Management/EM")->get_context_id();
 my $context_id = $resp->result;

 Append context ID to SOAP URI.
 $proxy_uri = sprintf("%s?context_id=%s", $proxy_uri, $context_id);
 $soap = SOAP::Lite->proxy($proxy_uri);

Thank you!

  • This thread should give you the info you need.

     

    https://devcentral.f5.com/questions/error-401-f5-authentication-required