Client Documentation

Updated December 12, 2005

Calling the Member service with PHP and the Pear library

Geocoder.us user Kenny Wickstrom wrote this SOAP sample. Thanks Kenny!


    // Tested with PHP 5.2.4

    // The address to convert
    $address = '1600 Pennsylvania Av, Washington, DC';
    printf("Get geocode for address: %s\n",$address);

    // Chose your method, with or without user info
    $wsdl = 'http://geocoder.us/dist/eg/clients/GeoCoderPHP.wsdl';
    //$wsdl = 'http://username:password@geocoder.us/dist/eg/clients/GeoCoderPHP.wsdl';

    // Make the connection
    $client = new SoapClient($wsdl);

    // Use this to see what services are available
    //var_dump($client->__getFunctions());

    // Actually call the service
    $result = $client->geocode($address);
    var_dump($result);