Using SOAP::Lite module on remote server, Google API 
Author Message
 Using SOAP::Lite module on remote server, Google API

Hey, I'm using a remote server, and even though they don't have
SOAP::Lite installed by default, they said that I can install it

with the Google API.

The program I'm trying to use came with the Google API, and it is:

#!/usr/bin/perl
use "SOAP::Lite";

my $key='000000000000000000000000';
my $query="foo";
my $googleSearch = SOAP::Lite -> service("file:GoogleSearch.wsdl");
my $result = $googleSearch -> doGoogleSearch($key, $query, 0, 10,
"false", "", "false", "", "latin1", "latin1");
print "About $result->{'estimatedTotalResultsCount'} results.\n";

Since I uploaded the module to the cgi-bin, I changed 'use
"SOAP::Lite";' to 'use lib "Lite";', and then I changed
'$googleSearch=SOAP::Lite->' to '$googleSearch=Lite->'. Of course, I
used the $key that Google emailed to me.

The problem I'm having is that when I run the script, I get an ISE.
The error log says 'Can't locate object method "service" via package
"Lite",' even though the subrouting "service" IS in the Lite.pm
module.

So my questions are:

(1) is the module installed correctly? I just uploaded Lite.pm to the
cgi-bin (and also tried uploading it to the home directory to no
effect). I made a test script of:

use lib "Lite";
print "Content-type: text/html\n\n";
print "It's working";

that worked just fine, but it's not actually using the module, either.

(2) If the module is installed correctly, am I calling it correctly?
The line that says '$googleSearch=Lite->' is obviously where there's a
problem, so I'm thinking there may be a syntax error here, but I don't
know how to fix it.

(3) In reading Lite.pm, it looks like it calls several other SOAP
modules, but I couldn't find any of them on CPAN. Is there somewhere
that I'm supposed to download an entire SOAP package, or should I be
able to do this with just the Lite.pm?

TIA,

Mike



Sun, 27 Nov 2005 19:20:30 GMT  
 Using SOAP::Lite module on remote server, Google API

Quote:
> "SOAP::Lite";' to 'use lib "Lite";', and then I changed

Ok not sure where you loaded the modules or what are you doing ut changing
    use SOAP::Lite
to
    use lib 'Lite'
does not look correct to me.
I would think you will need something like:
    use lib 'SOAP';
    use Lite;
then whatever you try to do.

Also instead of changing the program why don't you install the SOAP::Lite
package in a directory you have write permissions to and then just do:
    use lib '/path/to/SOAP/local/installation'
in your program.

hope it helps,

George



Sun, 27 Nov 2005 19:49:53 GMT  
 Using SOAP::Lite module on remote server, Google API

Quote:
> Hey, I'm using a remote server, and even though they don't have
> SOAP::Lite installed by default, they said that I can install it

> with the Google API.
<snip>
> Since I uploaded the module to the cgi-bin, I changed 'use
> "SOAP::Lite";' to 'use lib "Lite";', and then I changed
> '$googleSearch=SOAP::Lite->' to '$googleSearch=Lite->'. Of course, I
> used the $key that Google emailed to me.

The use lib pragma expects not module names but directories where it
should look for modules. If you do a 'perldoc -q lib', you'll see that

What I'd suggest is making a directory where you'll install modules,
installing Soap::Lite there, and then adding the following to your
script:

    use lib '/path/to/your/new/lib/directory';
    use Soap::Lite;

and then using Soap::Lite's methods as its documentation specifies.

Quote:
> The problem I'm having is that when I run the script, I get an ISE.
> The error log says 'Can't locate object method "service" via package
> "Lite",' even though the subrouting "service" IS in the Lite.pm
> module.

> So my questions are:

> (1) is the module installed correctly? I just uploaded Lite.pm to the
> cgi-bin (and also tried uploading it to the home directory to no
> effect).

No. When you 'use Soap::Lite;' perl is looking for 'Soap/Lite.pm'

somewhere in its array. Even if you do the latter, the object created
will be of the class SOAP::Lite, so you need to return to the
appropriate usage (i.e., use '$googleSearch = SOAP::Lite->' instead of
'$googleSearch = Lite->').

Quote:
> I made a test script of:

> use lib "Lite";
> print "Content-type: text/html\n\n";
> print "It's working";

In this example, you're not even loading the SOAP::Lite module; you're
simply telling your script to look for any modules in the "Lite"
directory under the current directory. Since you don't load any, it
doesn't choke, and, of course, it works.

--
Matthew Weier O'Phinney

http://matthew.weierophinney.net



Sun, 27 Nov 2005 20:11:14 GMT  
 Using SOAP::Lite module on remote server, Google API

Quote:

> Hey, I'm using a remote server, and even though they don't have
> SOAP::Lite installed by default, they said that I can install it

> with the Google API.
...
> (1) is the module installed correctly? I just uploaded Lite.pm to the
> cgi-bin (and also tried uploading it to the home directory to no
> effect).

That definitely won't work. SOAP::Lite is a whole package containing a
bunch of different modules. You should download the whole thing from

http://www.soaplite.com/

or

http://search.cpan.org/dist/SOAP-Lite/

(Use the [Download] link at the top, not the SOAP::Lite link in the
list of individual files.)

Then upload it onto your server and install it. You'll need
command-line access to the server. The basics of installing modules:

http://www.perldoc.com/perl5.6/pod/perlmodinstall.html

And here's a good tutorial on how to install modules into your own
directory on a server:

http://www.perl.com/pub/a/2002/04/10/mod_perl.html

I've successfully installed SOAP::Lite in this way and used it with
the Google API, so I know it works.

Kevin
--
perl -MLWP::UserAgent -e '$u=new LWP::UserAgent;$u->agent("japh");
print join(" ",(split(/\s+/,(split/\n/,$u->request(HTTP::Request->
new(GET=>join("",split(/\n/,"http://groups.google.com/groups?selm=
4365%40omepd.UUCP&output=gplain"))))->content)[60]))[0..3]),",\n"'



Sun, 27 Nov 2005 22:15:04 GMT  
 Using SOAP::Lite module on remote server, Google API
<snip>
Quote:
> > (1) is the module installed correctly? I just uploaded Lite.pm to the
> > cgi-bin (and also tried uploading it to the home directory to no
> > effect).

> That definitely won't work. SOAP::Lite is a whole package containing a
> bunch of different modules. You should download the whole thing from

> http://www.soaplite.com/

    <snip>

Thanks for the help, you guys. I followed your advice, and now it's
working flawlessly! I screwed up on the install at first and somehow
made the 1.1MB package take up 52MB of my web space, but I'll leave
that one to the host to figure out ;-)

To any future readers of this post, if you're installing to a remote
host, the www.soaplite.com site links to a good set of instructions on
how to install it. Took me about 20 minutes, even with my first
(major) mistake.

Thanks again, guys,

Mike



Mon, 28 Nov 2005 07:02:33 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Exceptions from SOAP::Lite using Google API

2. Has Any one used Perl Soap lite client to access Windows Server

3. SOAP in Apache with SOAP::Lite

4. SOAP in Apache with SOAP::Lite

5. How to suppress methodName element in soap:Body of envelope with SOAP::Lite

6. Accessing Unix SOAP::Lite Services from MS SOAP Toolkit

7. SOAP::Lite request to Apache Server timing out

8. SOAP::Lite server hanging

9. SOAP::Lite Server Error--?

10. SOAP::Lite Server Error--?

11. over-riding values using SOAP::Lite WSDL support

 

 
Powered by phpBB® Forum Software