beginner question on use of Frontier::Client

beginner question on use of Frontier::Client

am 15.11.2006 16:52:01 von lvirden

I'm attempting to write one of my first perl programs. It is to
interact with an internal web service. I'm having something basic going
wrong:

use Frontier::Client ;

# Parameter:
# login_id
#
# Output:
# login_id of manager

my @supervisor_info;
$server = Frontier::Client->new('url' => 'http://server:port/' );

foreach my $empno (@ARGV) {
@supervisor_info = Frontier::Client->call('GetAllInfoByEmpNo',
$empno);
if ( $#supervisor_info != 0 ) {
print "found $empno\n";
} else {
print "Unable to locate supervisor for $empno\n";
} ;
}

As you can see, I'm not trying to do anything with the data yet - in
fact, not even looking at the data yet. Just trying to get the basic
skeleton working, so that I know, moving on, that the basics are
working.

Of course, I have a real server and port URL in the new call.
And the method name comes from the documentation that the web service
guys have provided.

The error I get is:
Can't use string ("Frontier::Client") as a HASH ref while "strict refs"
in use at /usr/local/perl5/lib/site_perl/5.8.4/Frontier/Client.pm line
53.

(where that is the path to the pm file).

I appear to be missing something obvious. Given that I have not written
many perl programs, it is probably something embarassingly simple.

I was wondering if anyone could provide me a kind nudge in the right
direction?

Thanks!

Re: beginner question on use of Frontier::Client

am 15.11.2006 17:01:02 von Christian Winter

lvirden wrote:
> I'm attempting to write one of my first perl programs. It is to
> interact with an internal web service. I'm having something basic going
> wrong:
>
> use Frontier::Client ;
>
> # Parameter:
> # login_id
> #
> # Output:
> # login_id of manager
>
> my @supervisor_info;
> $server = Frontier::Client->new('url' => 'http://server:port/' );
>
> foreach my $empno (@ARGV) {
> @supervisor_info = Frontier::Client->call('GetAllInfoByEmpNo',
> $empno);

That should be
@supervisor_info = $server->call(...
as call() is an object method.

-Chris

Re: beginner question on use of Frontier::Client

am 15.11.2006 17:48:28 von lvirden

Christian Winter wrote:
> That should be
> @supervisor_info = $server->call(...
> as call() is an object method.

:blush: I can't believe that I missed that one. I apologize for such a
novice mistake... but then, I am a novice. I don't "think" in Perl yet,
so I'm doing a lot of googling and thumbing through books.

I appreciate your patience.