我正在通过 php 使用这个网络服务
$wsdl = 'http://www.ezzylearning.com/services/CountryInformationService.asmx?wsdl';
$soap = new soapClient($wsdl);
try{
$return = $soap->GetCountriesByContinent(array('continentCode'=>'AS'));
} catch (Exception $e) {
die ('Error: ' . $e->getMessage());
}
var_dump($return->GetCountriesByContinentResult);
我得到这个结果:
object(stdClass)#3 (2) { ["schema"]=> string(607) "" ["any"]=> string(6747) "AFAFGAfghanistanAMARMArmeniaAZAZEAzerbaijanBHBHRBahrainBDBGDBangladeshBTBTNBhutanIOIOTBritish Indian Ocean TerritoryBNBRNBruneiKHKHMCambodiaCNCHNChinaCXCXRChristmas IslandCCCCKCocos IslandsGEGEOGeorgiaHKHKGHong KongININDIndiaIDIDNIndonesiaIRIRNIranIQIRQIraqILISRIsraelJPJPNJapanJOJORJordanKZKAZKazakhstanKWKWTKuwaitKGKGZKyrgyzstanLALAOLaosLBLBNLebanonMOMACMacaoMYMYSMalaysiaMVMDVMaldivesMNMNGMongoliaMMMMRMyanmarNPNPLNepalKPPRKNorth KoreaOMOMNOmanPKPAKPakistanPSPSEPalestinian TerritoryPHPHLPhilippinesQAQATQatarSASAUSaudi ArabiaSGSGPSingaporeKRKORSouth KoreaLKLKASri LankaSYSYRSyriaTWTWNTaiwanTJTJKTajikistanTHTHAThailandTRTURTurkeyTMTKMTurkmenistanAEAREUnited Arab EmiratesUZUZBUzbekistanVNVNMVietnamYEYEMYemen" }
如您所见,以这种方式获取数组是没有用的,因为所有内容都是附加的。那么,使用该服务的正确方法是什么?
提前致谢。