0
次のSOAPメッセージがあり、jaxbクラスが生成されています。SOAPメッセージはJavaオブジェクトに構文解析できません
SOAPメッセージ:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:sendSmsResponse xmlns:ns1="http://www.csapi.org/schema/parlayx/sms/send/v2_2/local">
<result>100001200301111029065e4000141</result>
</ns1:sendSmsResponse>
</soapenv:Body>
</soapenv:Envelope>
JAXBクラス
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "sendSmsResponse", propOrder = {
"result"
})
public class SendSmsResponse {
@XmlElement(required = true)
protected String result;
public String getResult() {
return result;
}
public void setResult(String value) {
this.result = value;
}
}
しかし、次のように、これは非整列化例外を生成しました。
javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: unexpected element (uri:"http://www.csapi.org/schema/parlayx/sms/send/v2_2/local", local:"result"). Expected elements are <{}result>
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:161)
しかし、私は<ns1:result>
からns1:
を削除する場合は、それが解析されます。何が原因だろうか?