我是SoapUI和SoapUI Pro的新手。最近我遇到了一個財產轉移問題,其中我嘗試用Google搜索解決方案時沒有運氣。如何從肥皂響應中檢索節點?
我與「國家代碼」從webservicex.net練習,當我運行「」 GetCountry」測試請求我將得到國家的響應的列表。
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetCountriesResponse xmlns="http://www.webserviceX.NET">
<GetCountriesResult><![CDATA[<NewDataSet>
<Table>
<Name>Afghanistan, Islamic State of</Name>
</Table>
<Table>
<Name>Albania</Name>
</Table>
<Table>
<Name>Algeria</Name>
</Table>
.....
</NewDataSet>]]></GetCountriesResult>
</GetCountriesResponse>
</soap:Body>
</soap:Envelope>
這是所有好直到我想從數據集中找回其中一個國家,例如阿爾及利亞,這是因爲我想將國家名稱轉移到下一個測試步驟,該步驟是以國名作爲請求的服務。從響應中選擇節點,但是我注意到我得到的XPath指向整個響應而不是其中的一個節點
declare namespace ns1='http://www.webserviceX.NET';
//ns1:GetCountriesResponse[1]/ns1:GetCountriesResult[1]
我想這可能是很簡單的問題,你們中的一些人,但我的XPath技能是限制我自己解決它的能力。非常感謝任何人都可以提供幫助。
喜新,你對如何檢索從CDATA那麼節點什麼建議嗎? –