@WebService
public interface MyService {
public void doStuff( @WebParam(name = "someObjectList") List<SomeObject> someObjectList);
}
我想区分null和空列表。我该如何注释@WebParam someObjectList
?
应该可以,我找到了JAXB example。
我用apache生成ws cxf 3.0.1
答案 0 :(得分:2)
最合乎逻辑的做法是:
public class MyListParameter {
@XmlElementWrapper(nillable=true)
public List<MyObject> myObjects;
}
然后:
@WebService
public interface MyService {
public void doStuff( @WebParam(name = "someObjectList") MyListParameter someObjectList);
}