Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- PHP, SOAP and geocoder.us
September 25, 2005, 2:07 am
rate this thread
I am trying to retrieve latitude and longitude via geocoder.us
I use this code, as seen on
// Create new instance of the SoapClient class
// You'll need to download the WSDL file from:
$client = new SoapClient("geocoder.wsdl");
// Retrieve the address coordinates
$result = $client->geocode("411 Woody Hayes Dr, Columbus, OH");
// Dump the returned object
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
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??
September 25, 2005, 2:09 am
- Janwillem Borleffs
September 25, 2005, 5:44 pm
Re: PHP, SOAP and geocoder.us
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: