我有以下方法
public PingResponse ping(String xml) throws RemoteException {
PingResponse response = new PingResponse();
response.setPingResult("Service is Live");
return response;
}
这是 PingResponse.java
@XmlRootElement(name = "PingResponse")
public class PingResponse implements java.io.Serializable {
private String pingResult;
@XmlElement(name = "PingResult")
public String getPingResult() {
return pingResult;
}
public void setPingResult(String pingResult) {
this.pingResult = pingResult;
}
我遇到的问题是我得到的 XML 响应pingResult
是小写的。完整示例:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<PingResponse>
<pingResult>Service is Live</pingResult>
</PingResponse>
</soapenv:Body>
</soapenv:Envelope>
知道这里可能是什么问题吗?