HASH ref ERROR when running platform API example TakeActionFromFixlet.pl

(imported topic written by SystemAdmin)

Before running TakeActionFromFixlet.pl, the fixlet ID and Site ID have been acquired by Session Relevance.

When running TakeActionFromFixlet.pl, such error shows:

Can’t use string (“2147499519”) as a HASH ref while “strict refs” in use at C:/T

EM/TEMWrapper/BESAPI.pm line 28.

The error is for the code in TakeActionFromFixlet.pl:

my $siteID =

2147499519

; # ID of the site where the Fixlet resides

my $fixletID = 3041; # ID of the Fixlet # Run GTS TSCM Evaluator on SCM511_ITCS104v8_WIN2K8 (3041)

my $action = 0;

BESAPI::CheckSigningKeys( $dsn, $username, $password, $privateKey );

my $fixlet = BESAPI::FixletMessage( $siteID, $fixletID, $username, $password );

The code in BESAPI.pm is like this:

my $besAPIObject = $self->{object};

Here I hope to get your help to fix this problem. Thanks a lot!

P.S. the code is attached

(imported comment written by PeterLoer)

It looks to me like the problem is that the version of BESAPI.pm you are using doesn’t have a FixletMessage method defined.

If that is correct, the error you are seeing would make sense – in the absence of an explicit FixletMessage method, the AUTOLOAD is being invoked and is attempting to use the first supplied argument, $siteID, as the $self reference, and then generating an error when it turns out that it is the wrong type.

On the Platform API Examples wiki page, you can find a copy of BESAPI.pm that should include the method you are trying to use:

https://www.ibm.com/developerworks/mydeveloperworks/wikis/home?lang=en#/wiki/Tivoli%20Endpoint%20Manager/page/Platform%20API%20Examples

Hope that helps…

cheers,

peter