function __construct($options, $wsdl)
 {
     parent::__construct($options, $wsdl);
     $this->helper = new AnymapHelper();
 }
Exemplo n.º 2
0
$credentials->username = $username;
$credentials->password = $password;
$token_service = new GetTokenService(array(), 'http://webservices.anymap.be/wsdl/anymap/GetToken.wsdl');
$result = $token_service->receive($credentials);
if (!empty($result->errorCode) || !empty($result->errorMessage)) {
    echo <<<end_echo
FATAL
    errorCode       : {$result->errorCode}
    errorMessage    : {$result->errorMessage}
end_echo;
    exit;
}
$token = $result->token;
#echo "$token\n";
require_once __DIR__ . '/generated/geocoder_wsdl/SoapGeocoderService.php';
$service = new SoapGeocoderService(array(), 'http://webservices.anymap.be/wsdl/anymap/Geocoder.wsdl');
$clientInfo = new ClientInfo('ClientInfo');
$clientInfo->format = '';
$clientInfo->geocodingType = 0;
$clientInfo->name = $username;
$clientInfo->token = $token;
$addressIn = new GivenAddress('GivenAddress');
$addressIn->city = 'Leuven';
$addressIn->country = 'be';
$addressIn->houseNumber = '43';
$addressIn->postCode = '3000';
$addressIn->street = 'Vanden Tymplestraat';
$minMatching = 1;
$language = 'nl';
$return = $service->doGeocoding($clientInfo, $addressIn, $minMatching, $language);
print_r($return);