Problem with Platform API on Perl

(imported topic written by mcmaurer91)

Hello,

I’m doing some BigFix/TEM testing and trying to make use of the PlatformAPI with PERL.

I’ve been able to successfully import a .bes file using the ImportFile.pl example, but when I try to load a RetrievedProperty (eventually I’d like to modify them programatically), I get stuck with a pretty generic error message:

$ ./setPromise.pl BES_BFenterprise 'C:\Users\Administrator\My Documents\BESCredentials\mcmaurer\

\publisher.pvk’

here

here2

Win32::OLE(0.1709) error 0x8002000e: “Invalid number of parameters” in METHOD/PROPERTYGET “CurrentFIPSMode”

Here’s my code:

#!/usr/bin/perl use strict; use warnings; use FindBin; use lib $FindBin::Bin; use BESAPI;   use Data::Dumper; 

if ( @ARGV != 4 ) 
{ print 
"ImportFile.exe <username> <password> <dsn> <private key path>"; exit ( 0 ); 
}   my ( $username, $password, $dsn, $privateKey, $besFile, ) = @ARGV;   print 
"here\n"; my $check = BESAPI::CheckSigningKeys ( $dsn, $username, $password, $privateKey );   my $retProp = BESAPI->

new ( 
"RetrievedProperty" );   print 
"here2\n"; print 
"Initial: " . Dumper $retProp;   print 
"here3\n"; my $ids = $retProp->load ( 235, $username, $password );   print 
"here4\n"; print 
"IDs: " . Dumper $ids; print $ids;   print 
"IDs: " . join ( 
" ", @$ids ) . 
"\n"; 

if ( $@ ) 
{ print 
"$@\n"; 
} 1;

It seems to be dying during the object creation…

I’m able to use the TestAPI.htm page fine as well. So maybe this is related to my perl install? I’m using cygwin and CPAN’s Win32::OLE module.

(imported comment written by mcmaurer91)

I may have answered my own question, but would be helpful if someone can answer…

It seems the calls work, even though I can’t inspect the output of each call? I’ve done a little more testing and was able to create a setting with similar code, but I still get the OLE error if I try to print out the object. Is there any good way in the API to see if a result was successful or not?

(imported comment written by SystemAdmin)

Hello mcmaurer,

The error message is related to syntax from my experience.

Maybe this will be of help: http://forum.bigfix.com/viewtopic.php?id=7344