有了这个com.holidaywebservice.holidayservice_v2.CountryCode@6b6478
,你试图打印ArrayOfCountryCode
对象。您的代码应该是:
package com.holidaywebservice.holidayservice_v2.clientsample;
import com.holidaywebservice.holidayservice_v2.*;
public class ClientSample {
public static void main(String[] args) {
//Create Web Service Client..."
HolidayService2 service1 = new HolidayService2();
//Create Web Service...
HolidayService2HttpGet port1 = service1.getHolidayService2HttpGet();
//call WS
ArrayOfCountryCode acc = port1.getCountriesAvailable();
for(CountryCode cc : acc.getCountryCode()){
System.out.println("Country code is: " + cc.getCode());
System.out.println("Country code Description is: " + cc.getDescription());
}
}
}
更新尝试仅添加以下内容
for(CountryCode cc : acc.getCountryCode()){
System.out.println("Country code is: " + cc.getCode());
System.out.println("Country code Description is: " + cc.getDescription());
}
ArrayOfCountryCode acc = hss1.getCountriesAvailable();
在当前代码中
的行之后。但你看到了它的要点,acc
是一系列国家代码。