protected function client_info_object() { $credentials = new Credentials(); $credentials->username = $this->_username; $credentials->password = $this->_password; $token_service = new GetTokenService(array(), 'http://webservices.anymap.be/wsdl/anymap/GetToken.wsdl'); $result = $token_service->receive($credentials); $this->check_for_soap_errors($result); $token = $result->token; $clientInfo = new ClientInfo('ClientInfo'); $clientInfo->format = ''; $clientInfo->geocodingType = 0; $clientInfo->name = $this->_username; $clientInfo->token = $token; return $clientInfo; }
<?php require_once __DIR__ . '/generated/gettoken_wsdl/GetTokenService.php'; $username = '******'; $password = '******'; $credentials = new Credentials(); $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';