我有这样的问题。 我有网络服务
@WebService
@SOAPBinding(style = Style.RPC)
public interface ServerWebService {
@WebMethod
WSResponse calculateValue(@WebParam(name = "WSRequest") WSRequest request) throws ServerFault, TfmRequestInputFault;
}
请求POJO:
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class WSRequest implements Serializable {
@XmlElement(required = true)
private String promotionData;
public String getPromotionData() {
return promotionData;
}
public void setPromotionData(String promotionData) {
this.promotionData = promotionData;
}
}
Xml请求是这样的:
<soapenv:Envelope>
<soapenv:Body>
<cal:calculateValue>
<WSRequest>
<promotionData>
**<anotherXML>....</anotherXML>**
</promotionData>
</WSRequest>
</cal:calculateValue>
</soapenv:Body>
</soapenv:Envelope>
当请求进入Web服务时,XML from不会保存到我的POJO的String字段中。请告诉我,我做错了什么? 这个问题只发生在xml as field中,当简单字符串出现时 - 一切正常。