我尝试从http://api.mouzenidis-travel.com/search/ServiceMainSearch.svc?Wsdl
获得结果有一些方法可以获取数据:
//我的PHP代码:
$ client = new SoapClient(“http://api.mouzenidis-travel.com/search/ServiceMainSearch.svc?Wsdl”);
$ countryList = $ client-> GetCountries(); //结果
[0] => stdClass Object
(
[Code] => GR
[ID] => 29
[Name] => ГрециÑ
[NameLat] => Greece
)
[1] => stdClass Object
(
[Code] => CZ
[ID] => 6240
[Name] => ЧехиÑ
[NameLat] => Czech Republic
)
$ cityDepObj = $ client-> GetCityDeparture(array('countryID'=> 29));
[0] => stdClass Object
(
[Code] => MOW
[GroupName] => РоÑÑиÑ
[GroupNameLat] => РоÑÑиÑ
[GroupOrder] => 4
[ID] => 1
[Name] => МоÑква
[NameLat] => Moscow
[CountryID] => 460
[IsDeparture] => 1
[RegionID] => 0
)
[1] => stdClass Object
(
[Code] =>
[GroupName] => РоÑÑиÑ
[GroupNameLat] => РоÑÑиÑ
[GroupOrder] => 4
[ID] => 299
[Name] => ÐрхангельÑк
[NameLat] => Arkhangelsk
[CountryID] => 460
[IsDeparture] => 1
[RegionID] => 0
)
。 。
$客户端 - >用getFilter(阵列(29,阵列(1)));
Fatal error: Uncaught SoapFault exception: [s:Client] No connections available ...
我写信给Mouzendinis技术支持,没有结果。
是什么让我错了?
答案 0 :(得分:1)
在C#中,此方法需要字段' Country' as int
,而不是int数组。此外,其他字段必须初始化为空数组或null
。
最后一个字段是导致过滤器更新的字典。例如:如果您更改了出发城市,则应将字段设置为DictionaryEnum.CityDeparture
答案 1 :(得分:0)
您可以检查他们的API文档并检查传递给GetFilter方法所需的参数。
答案 2 :(得分:0)
当您$client->GetCityDeparture(array('countryID'=>29));
时,您是否尝试使用$client->GetFilter(array('countryId'=>29,'departureCityId'=>array(1)));
?
否则,尝试使用wsdl到php生成器,这样可以简化请求构建和处理响应