Click here to get back home

beginner question on use of Frontier::Client

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
beginner question on use of Frontier::Client lvirden 11-15-2006
Posted by lvirden on November 15, 2006, 10:52 am
Please log in for more thread options


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!


Posted by Christian Winter on November 15, 2006, 11:01 am
Please log in for more thread options


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

Posted by lvirden on November 15, 2006, 11:48 am
Please log in for more thread options



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.


Similar ThreadsPosted
Can't find string terminator "EOM" - beginner question June 29, 2005, 3:34 pm
Frontier::Daemon encoding question August 15, 2005, 10:40 am
XML-RPC server using Frontier::Daemon keeps crashing August 25, 2004, 12:06 pm
What to do when CPAN module authors can't be reached? (Bug + fix for Frontier::RPC2) May 6, 2006, 2:50 pm
POE::Component::Client::TCP help! February 7, 2005, 12:11 pm
soaplite server and .net client September 14, 2006, 9:04 pm
Determine NT domain username of web client February 3, 2005, 4:24 pm
Sockets - client unable to connect May 1, 2006, 5:28 pm
Writing a HTML/ASP SOAP client for a SOAP::Lite destination March 16, 2005, 5:19 pm
DBI question November 5, 2004, 4:28 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap