我将 CXF 用于我的网络服务。我有豆
public class Document {
private int id;
private String name;
private String description;
private Date createdDate;
//....getters/setters
}
我有一个 webmethod 接口
@WebMethod(operationName = "SaveDocument")
Document saveDocument(@WebParam(name = "document") Document document);
输入消息是否有可能没有ID和createdDate?或者我应该做两个 2 豆。一个用于输入,另一个用于响应?喜欢
public class DocumentIn {
private String name;
private String description;
//....getters/setters
}
和
public class DocumentOut {
private int id;
private String name;
private String description;
private Date createdDate;
//....getters/setters
}
和网络方法
@WebMethod(operationName = "SaveDocument")
DocumentOut saveDocument(@WebParam(name = "document") DocumentIn document);