rockneybot has asked for the wisdom of the Perl Monks concerning the following question:
So, when I run geocodeclient.pl, I get this error:[root@mycomputer html]# ls -lah /data/geocode/ca/geocode_ca.db -rw-r--r-- 1 root root 60M May 23 18:04 /data/geocode/ca/geocode_ca.db [root@mycomputer html]# cat /usr/lib/perl5/site_perl/5.8.8/geocode.pm package geocode; sub geocode { # Designate the location of the geocoding database $geocodes = "/data/geocode/ca/geocode_ca.db"; # Retrieve the address value passed into the function my ($class,$address) = @_; # Point to the geocoding database Geo::Coder::US->set_db($geocodes); # Retrieve coordinates from geocoding database my ($coords) = Geo::Coder::US->geocode($address); # Return the latitudinal and longitudinal coordinates return $coords->{lat},$coords->{long}; } return 1; [root@mycomputer html]# cat geocodews.pl #!/usr/bin/perl -w use Geo::Coder::US; use SOAP::Transport::HTTP; require("geocode.pm"); SOAP::Transport::HTTP::CGI->dispatch_to('geocode')->handle; [root@mycomputer html]# cat geocodeclient.pl #!/usr/bin/perl -w use SOAP::Lite; $soap = SOAP::Lite -> uri('http://localhost/geocode') -> proxy('http://localhost/geocodews.pl'); $address = "900 Cherry Ave., San Bruno, CA"; my $result = $soap->call('geocode', $address); my $latitude = $result->result; my $longitude = $result->paramsout; print "Latitude: ".$latitude."\n"; print "Longitude: ".$longitude."\n";
I'm totally hacking things together here, but a little tip on how to troubleshoot this would be much appreciated. Thank you![root@mycomputer html]# ./geocodeclient.pl not well-formed (invalid token) at line 1, column 1, byte 1 at /usr/li +b/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/XML/Parser.pm line +187 #!/usr/bin/perl -w use Geo::Coder::US; use SOAP::Transport::HTTP; require("geocode.pm"); SOAP::Transport::HTTP::CGI->dispatch_to('geocode')->handle; at ./geocodeclient.pl line 11
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: SOAP::Lite geocode server
by rhesa (Vicar) on May 25, 2006 at 00:25 UTC | |
by rockneybot (Novice) on May 25, 2006 at 01:20 UTC | |
by rhesa (Vicar) on May 25, 2006 at 01:46 UTC | |
by rockneybot (Novice) on May 25, 2006 at 01:54 UTC | |
by rhesa (Vicar) on May 25, 2006 at 02:34 UTC | |
|
Re: SOAP::Lite geocode server
by sgifford (Prior) on May 25, 2006 at 05:39 UTC |