Click here to get back home

PHP, SOAP and geocoder.us

 HomeNewsGroups | Search | About
 comp.infosystems.gis    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
PHP, SOAP and geocoder.us www.douglassdavis.com 09-24-2005
Get Chitika Premium
Posted by www.douglassdavis.com on September 24, 2005, 7:07 pm
Please log in for more thread options


I am trying to retrieve latitude and longitude via geocoder.us

I use this code, as seen on
(http://www.developer.com/lang/php/article.php/3548171):

<?php
// Create new instance of the SoapClient class
// You'll need to download the WSDL file from:
// http://geocoder.us/dist/eg/clients/GeoCoder.wsdl
$client = new SoapClient("geocoder.wsdl");
// Retrieve the address coordinates
$result = $client->geocode("411 Woody Hayes Dr, Columbus, OH");
// Dump the returned object
var_dump($result);
?>

I get this error:

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing
WSDL: Unexpected WSDL element in c:\program files\apache
group\Apache\htdocs\loctest.php:44 Stack trace: #0 c:\program
files\apache group\Apache\htdocs\loctest.php(44):
SoapClient->__construct('c:\program file...') #1 thrown in
c:\program files\apache group\Apache\htdocs\loctest.php on line 44

I'm using the WSDL file at
http://geocoder.us/dist/eg/clients/GeoCoder.wsdl along with PHP5.1 and
Win XP Pro.

Has any one done this successfully? Can any one help me figure out
what could be wrong??



Posted by www.douglassdavis.com on September 24, 2005, 7:09 pm
Please log in for more thread options

www.douglassdavis.com wrote:
> I am trying to retrieve latitude and longitude via geocoder.us
>
> I use this code, as seen on
> (http://www.developer.com/lang/php/article.php/3548171):
>

that's http://www.developer.com/lang/php/article.php/3548171



Posted by Janwillem Borleffs on September 25, 2005, 7:44 pm
Please log in for more thread options
www.douglassdavis.com wrote:
> Has any one done this successfully? Can any one help me figure out
> what could be wrong??
>

The WSDL contains some non-printable characters, which PHP doesn't like.

Once stripped, everything will work as expected. For your convenience, I
have prepared a stripped copy for you, which you can download from here:

http://www.jwscripts.com/wsdl/geocoder.wsdl


JW






Posted by www.douglassdavis.com on September 25, 2005, 11:00 am
Please log in for more thread options

Janwillem Borleffs wrote:
> www.douglassdavis.com wrote:
> > Has any one done this successfully? Can any one help me figure out
> > what could be wrong??
> >
>
> The WSDL contains some non-printable characters, which PHP doesn't like.
>
> Once stripped, everything will work as expected. For your convenience, I
> have prepared a stripped copy for you, which you can download from here:
>
> http://www.jwscripts.com/wsdl/geocoder.wsdl
>
>
> JW


Thanks... I never would have guessed.




Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap