SOAP応答からノードGoodEmailの値を抽出しようとしています。何を試しても、常にorg.apache.commons.jxpath.JXPathNotFoundExceptionが発生するようです。
SOAP応答:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<VerifyEmailResponse xmlns="http://ws.cdyne.com/">
<VerifyEmailResult>
<ResponseText>Invalid Email Address</ResponseText>
<ResponseCode>0</ResponseCode>
<LastMailServer/>
<GoodEmail>false</GoodEmail>
</VerifyEmailResult>
</VerifyEmailResponse>
</soap:Body>
</soap:Envelope>
Javaコード:
String payload = message.getPayloadAsString(); //The SOAP response
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
InputSource is = new InputSource();
is.setCharacterStream(new StringReader(payload));
Document doc = db.parse(is);
JXPathContext context = JXPathContext.newContext(doc);
String jxpathReply = (String) context.getValue("//soap:Envelope/soap:Body/VerifyEmailResponse/VerifyEmailResult/GoodEmail");
私には、エラーコードは、間違っているのはxpathフィルターであることを示唆しているようです。私はいくつかの異なる方法を試しましたが、正しく理解できません。私は何が間違っているのですか?