Rzeczywiście. W metodzie doQuerySysStatus jest country-id. country-code jest w doLogin.
Kiedyś temu napisałem takiego potworka do łączenia się z Allegro. Klasa korzysta z wbudowanego w PHP rozszerzenia SOAP. Może pomoże.
Nie konfigurowałem w żaden sposób SOAP, użyłem ustawień domyślnych.
<?php
class Allegro
{
const WEBAPI_URL = 'http://webapi.allegro.pl/uploader.php?wsdl';
private $_data = array();
/**
* @var SoapClient
*/
private $_soap;
public function __construct($encoding = null, $userLogin = null, $userPassword = null, $webAPIKey = null, $localVersion = null) {
if(!is_null($encoding)) $this->_data
['encoding'] = $encoding; if(!is_null($userLogin)) $this->_data
['userLogin'] = $userLogin; if(!is_null($userPassword)) $this->_data
['userPassword'] = $userPassword; if(!is_null($webAPIKey)) $this->_data
['webAPIKey'] = $webAPIKey; if(!is_null($localVersion)) $this->_data
['localVersion'] = $localVersion;
$this->_soap = new SoapClient(self::WEBAPI_URL);
// sprawdzanie poprawnosci klucza wersji
$sysStatus = $this->getAllegroSysStatus();
if($this->_data['localVersion'] != $sysStatus['ver-key']) {
$this->_data['localVersion'] = $sysStatus['ver-key'];
}
}
public function login() {
'user-login' => $this->_data['userLogin'],
'user-password' => $this->_data['userPassword'],
'country-code' => 1,
'webapi-key' => $this->_data['webAPIKey'],
'local-version' => $this->_data['localVersion']);
return $this->doLogin($params);
}
public function getAllegroSysStatus() {
'sysvar' => 1, //which feature you are asking for, 1 is for AllegroWebApi, other possible options above
'country-id' => 1, //country code, 1 is for Poland, all country codes are available in doLogin method documentation
'webapi-key' => $this->_data['webAPIKey']);
return $this->doQuerySysStatus($params);
}
public function __call
($name, array $args = array()) { if(is_array($args[0
])) $args = $args[0
]; return $this->_soap->__soapCall($name, $args);
}
public function __get($name) {
return $this->_data[$name];
}
}
?>