WWW::Search::Google-->Service description 'file:' can't be loaded: 404 File `' does not exist

WWW::Search::Google-->Service description 'file:' can't be loaded: 404 File `' does not exist

Post by patrik » Thu, 18 Oct 2007 05:28:01


Dear my friends...

I tried a simple code like this:
====
#!/usr/bin/perl -w
use WWW::Search::Google;
$key="ABQIAAAASzVWEo9_PkDjwjTkhPHJIxTovFWtVmuuMSRYt_dv3iXA1zQ3OxT9hxr3F7hqD-SZIzQb7p0QjzUobQ";
my $search = WWW::Search->new('Google', key => $key);
$search->native_query("Business Education");
while (my $result = $search->next_result()) {
print $result->title, "\n";
print $result->url, "\n";
print $result->description, "\n";
print "\n";
}
====
But as I run this code I get an error message as the output like this:
./googleku.pl
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.8/Net/Google/Service.pm line 80.
Service description 'file:' can't be loaded: 404 File `' does not exist
===

I found this threath as my googling result: http://www.yqcomputer.com/
I did the as it told me but it did not make any change.
===
Net::Google fix: copy the wsdl file

The fix is an easy one. Somehow the build process doesn't copy the GoogleSearch.wsdl and the directory Services that contains this file to the blib directory. So copying manually the Services directory from:
Net-Google-1.0/lib/Net/Google

to the following directory:
Net-Google-1.0/blib/lib/Net/Google

fixed the problem for me. Entering nmake tests reported no more problems, and nmake install made the programs I have that require Net-Google work again.
===

Please tell me if somebody has ever found the same problem.

Please tell me my mistake.

Thank you very much.
--
Patrik Hasibuan < XXXX@XXXXX.COM >
Junior Programmer
 
 
 

WWW::Search::Google-->Service description 'file:' can't be loaded: 404 File `' does not exist

Post by davidfilme » Thu, 18 Oct 2007 07:35:03

> Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.8/Net/Google/Service.pm line 80.

Hmmm. FWIW, I tried to reproduce your problem, but I needed to
install Net::Google on my machine (a SuSe 10 box). I got this exact
same error when trying to 'make test' (using my own Google key, but it
is a very old key - March 2006; do keys expire if you don't use them
for a long time?)

 
 
 

WWW::Search::Google-->Service description 'file:' can't be loaded: 404 File `' does not exist

Post by patrik » Thu, 18 Oct 2007 17:39:59

ear my friend, David.

Since you told me that you meet the same problem (and I also use opensuse, mine is 10.2): Here what I've done as I solved the problem, thread below:
http://www.perlmonks.org/?node_id=517871
as root I do so:
1. cd /PATH/TO/.cpan/build/Net-Google-1.0
2. cp -pR lib/Net/Google/Services blib/lib/Net/Google/
3. perl -Mblib t/001-search.t (here, I typed in my API key as the value of $key)
4. perl -Mblib t/002-spelling.t (here, I typed in my API key as the value of $key)
5. perl -Mblib t/003-cache.t (here, I typed in my API key as the value of $key)
6. perl Build.PL
7. perl Build
6. make install
======
suseonthelap:/home/patrikh/arsip/installer/pm/Net-Google-1.0/Net-Google-1.0 # whoami
root
suseonthelap:/home/patrikh/arsip/installer/pm/Net-Google-1.0/Net-Google-1.0 # ls
blib _build Build Build.PL Changes lib Makefile Makefile.PL MANIFEST META.yml README t
suseonthelap:/home/patrikh/arsip/installer/pm/Net-Google-1.0/Net-Google-1.0 # cp -pR lib/Net/Google/Services blib/lib/Net/Google/
suseonthelap:/home/patrikh/arsip/installer/pm/Net-Google-1.0/Net-Google-1.0 # perl -Mblib t/001-search.t
1..5
ok 1 - Read Google API key
ok 2 - use Net::Google;
ok 3 - The object isa Net::Google
ok 4 - The object isa Net::Google::Search
Exception from service object: Invalid authorization key: ABQIAAAASzVWEo9_PkDjwjTkhPHJIxTovFWtVmuuMSRYt_dv3iXA1zQ3OxT9hxr3F7hqD-SZIzQb7p0QjzUobQ at /usr/lib/perl5/vendor_perl/5.8.8/SOAP/Lite.pm line 3412
ok 5 - Got results for related:http://perl.aaronland.net
Google returned 0 results:
suseonthelap:/home/patrikh/arsip/installer/pm/Net-Google-1.0/Net-Google-1.0 # perl -Mblib t/002-spelling.t
1..5
ok 1 - Read Google API key
ok 2 - use Net::Google;
ok 3 - The object isa Net::Google
ok 4 - The object isa Net::Google::Spelling
Exception from service object: Invalid authorization key: ABQIAAAASzVWEo9_PkDjwjTkhPHJIxTovFWtVmuuMSRYt_dv3iXA1zQ3OxT9hxr3F7hqD-SZIzQb7p0QjzUobQ at /usr/lib/perl5/vendor_perl/5.8.8/SOAP/Lite.pm line 3412
not ok 5 - The correct spelling of 'neu yirk citee' is 'new york city'
# Failed test 'The correct spelling of 'neu yirk citee' is 'new york city''
# at t/002-spelling.t line 41.
# got: undef
# expected: 'new york city'
# Looks like you failed 1 test of 5.
suseonthelap:/home/patrikh/arsip/installer/pm/Net-Google-1.0/Net-Google-1.0 # perl -Mblib t/003-cache.t
1..5
ok 1 - Got Google API key
ok 2 - use Net::Google;
ok 3 - The object isa Net::Google
ok 4 - The object isa Net::Google::Cache
Exception from service object: Invalid authorization key: ABQIAAAASzVWEo9_PkDjwjTkhPHJIxTovFWtVmuuMSRYt_dv3iXA1zQ3OxT9hxr3F7hqD-SZIzQb7p0QjzUobQ at /usr/lib/perl5/vendor_perl/5.8.8/SOAP/Lite.pm line 3412
not ok 5 - Got cache for http://aaronland.net
# Failed test 'Got cache for http://aaronland.net'
# at t/003-cache.t line 42.
# Looks like you failed 1 test of 5.
suseonthelap:/home/patrikh/arsip/installer/pm/Net-Google-1.0/Net-Google-1.0 # perl Build.PL
Checking whether your kit is complete...
Looks good

Checking prerequisites...
Looks good

Deleting Build
Removed previous script 'Build'

Creating new 'Build' script for 'Net-Google' version '1.0'
suseonthelap:/home/patrikh/arsip/installer/pm/Net-Google-1.0/Net-Google-1.0 # perl Build
suseonthelap:/home/patrikh/arsip/installer/pm/Net-Google-1.0/Net-Google-1.0 # make install
/usr/bin/perl Build --makefile_env_macros 1 install
Skipping /usr/lib/perl5/site_perl/5.8.8/N