0
運行的WSDL2Java後想我們得到了響應Manupulating使用WSDL響應
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "response", propOrder = {
"responseDate",
"institutionList"
})
@XmlRootElement(name="response")
public class Response implements Serializable {
@XmlElement(required = true)
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar responseDate;
@XmlElement(required = true)
protected List<InstitutionList> institutionList;
public XMLGregorianCalendar getResponseDate() {
return responseDate;
}
public void setResponseDate(XMLGregorianCalendar value) {
this.responseDate = value;
}
public List<InstitutionList> getInstitutionList() {
if (institutionList == null) {
institutionList = new ArrayList<InstitutionList>();
}
return this.institutionList;
}
}
和InstitutionList
具有深層結構。由於一些進口我不能序列化我的Response
(它需要GWT),所以我必須手動製作一些HashMap
(可以序列化)並填充來自深層結構的所有字段。有沒有辦法做到這一點?此外,如果我想從數據庫中保存Response
的數據,我不得不使用hashmap和所有值。謝謝你的幫助!