Forum Discussion
example of set_string_class_member_data_value in perl
Does anyone have an example of set_string_class_member_data_value in a perl script?
4 Replies
- Hamish
Cirrocumulus
As a matter of fact... Yes I do...
classAPI is the handle. className does what it says on the tin. classMembers are classValues are the keys & values to set
sub addClassEntry { my($classAPI, $className, $classMembers, $classValues)=@_; my @stringInfoList=(); print "addClassEntry: ($className) ($classMembers) ($classValues)\n"; my $class_members = {name => $className, members => [$classMembers]}; push(@stringInfoList, $class_members); print "addClassEntry: calling class->set_string_class_member_data_value()\n"; $soapResponse=$classAPI->add_string_class_member(SOAP::Data->name(class_members => [$class_members])); $soapResponse=$classAPI->set_string_class_member_data_value(SOAP::Data->name(class_members => [$class_members]), SOAP::Data->name(values => [[$classValues]])); my($status,$text)=&checkResponse($soapResponse); print "addClassEntry: status[$status] text [$text]\n"; if(($status!=1)||($text ne "OK")) { print "addClassEntry: status $status error [$text] from add_string_class_member()\n"; exit(-1); } print "addClassEntry: status $status success [$text] from add_string_class_member()\n"; } - Arjan_128616
Nimbostratus
I got an error: Can't call method "add_string_class_member" without a package or object reference at StringClass.pl line 254.
- Hamish
Cirrocumulus
That's a subroutine... You need to actually create the $classAPI handle... With something like
my $classAPI=SOAP::Lite -> uri('urn:iControl:LocalLB/Class') -> readable(1) -> proxy("$isProtocol://$icUser:$icPass\@$icServer:$icPort/iControl/iControlPortal.cgi", cookie_jar => $cookieJar); $classAPI->transport->cookie_jar($cookieJar);Did you do that bit?
- Arjan_128616
Nimbostratus
Thanks everything works like a charm
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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