wsimport:使用bean作为方法参数的服务接口

时间:2015-06-13 08:49:08

标签: java web-services wsimport

WSimport(http://www.webservicex.com/globalweather.asmx?WSDL)正在创建所有源文件。但是服务接口(GlobalWeatherSoap)没有接受bean参数的方法。

/**
 * Get all major cities by country name(full / part).
 * 
 * @param countryName
 * @return
 *     returns java.lang.String
 */
@WebMethod(operationName = "GetCitiesByCountry", action = "http://www.webserviceX.NET/GetCitiesByCountry")
@WebResult(name = "GetCitiesByCountryResult", targetNamespace = "http://www.webserviceX.NET")
@RequestWrapper(localName = "GetCitiesByCountry", targetNamespace = "http://www.webserviceX.NET", className = "com.x.test.GetCitiesByCountry")
@ResponseWrapper(localName = "GetCitiesByCountryResponse", targetNamespace = "http://www.webserviceX.NET", className = "com.x.test.GetCitiesByCountryResponse")  
public String getCitiesByCountry(@WebParam(name = "CountryName", targetNamespace = "http://www.webserviceX.NET")
    String countryName);

我想创建以bean为参数的服务接口方法(GetCitiesByCountry)。任何人都可以帮助我。

0 个答案:

没有答案