Xml 考虑名称空间的SOAP请求的Xpath
我想知道是否有人可以帮助我了解使用XPath遍历SOAP响应以挑选数据的需求Xml 考虑名称空间的SOAP请求的Xpath,xml,web-services,xpath,soap,Xml,Web Services,Xpath,Soap,我想知道是否有人可以帮助我了解使用XPath遍历SOAP响应以挑选数据的需求 <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns2:preferredPaymentSearch xmlns:ns2="http://website.abc.com">
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:preferredPaymentSearch xmlns:ns2="http://website.abc.com">
<header>
<issueAudit>
<info>
<issues>
<issue severity="INFO" issueId="7f32d1f1-8355-4af3-8862-6e3b66061c41" host="server.test.com/10.2.333.46" issueMessage="qqdG6jVIqIkw459wSj0ymokh" issueCode="TrackingId" timestamp="2017-03-22T09:36:40.362Z" />
<issue severity="INFO" issueId="220f5972-eed0-43e3-be72-cdbea1798520" host="server.test.mcom/10.2.333.46" issueMessage="server.test.com/10.2.333.46" issueCode="Host" timestamp="2017-03-22T09:36:40.362Z" />
</issues>
</info>
<warnings>
<issues />
</warnings>
<errors>
<issues />
</errors>
</issueAudit>
<status>SUCCESS</status>
<ver>1.0.0-SNAPSHOT</ver>
</header>
<results>
<preferredPaymentResults>
<preferredPaymentCriterion>
<productSupplier>
<ns2:actorCode>ABC</ns2:actorCode>
</productSupplier>
<requiredFunds amount="59.29" currency="GBP" />
</preferredPaymentCriterion>
<preferredPaymentOption>
<preferredCardOption>
<cardForm>PHYSICAL</cardForm>
<cardType>VISA_CREDIT</cardType>
<provider>lodged</provider>
</preferredCardOption>
</preferredPaymentOption>
</preferredPaymentResults>
</results>
</ns2:preferredPaymentSearch>
请尝试使用上述xpath,它将提供“成功”您的xpath有什么问题?它应该已经起作用了:或者您只需要在XPath的末尾追加
/text()
,就可以得到内部文本?嗯。也许我使用的工具给出了错误的结果:是的,看起来问题出在您使用的工具上。这一个在那里工作://soap:Body//*[name()='status']
//soap:Body/descendant::*[name()='status']
//header/status/text()