如何制作soap
网络服务所需的参数?
@WebService
public class MyService {
//how can I make city param required?
@WebMethod
public ComplexResponse lookup(@WebParam(name = "city") String city) {
}
}
答案 0 :(得分:3)
添加
@XmlElement(required=true, nillable=false)
到param应该工作:
public ComplexResponse lookup(@WebParam(name = "city") @XmlElement(required=true, nillable=false) String city)