【发布时间】:2017-02-14 06:30:14
【问题描述】:
我想知道当子标签看起来像这样时,如何获取 SOAP 响应主体子的内容:
<sth:x>...</sth:x>
在 Oracle 文档中,我找到了 loop all Elements with a specific name 的方法。 但因此我需要先创建一个元素来指定我要搜索的标签的名称。
如何创建一个看起来像上面的元素?我知道怎么做这样的:
<sth:id sth="asdf">
但这并没有真正起作用。 这是我尝试阅读的服务器响应。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<ns5:loginResponse xmlns:ns5="x">
<ns5:id>Value I am looking for</ns5:id>
<ns5:rc>0</ns5:rc>
</ns5:loginResponse>
</soapenv:Body>
</soapenv:Envelope>
感谢您的帮助:)
【问题讨论】: