Forum Discussion

sumitbaliyan's avatar
sumitbaliyan
Occasional Contributor
10 years ago

Not able to fetch node value of XML element

Hi folks,

Need your help, I am fairly aware of XPath and how to fetch node value of XML element value via XPath in SoapUI. But for below SoapUI response, I am not getting expected result.

Response XML
=========
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<n:addResponse xmlns:n="http://www.parasoft.com/wsdl/calculator/">
<n:Result xsi:type="xsd:float">11.0</n:Result>
</n:addResponse>
</soap:Body>
</soap:Envelope>

XPath expression used
================
declare namespace n='http://www.parasoft.com/wsdl/calculator/';
declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/';
//soap:Body/n:addResponse/n:Result

Result
======
<n:Result xsi:type="xsd:float" xmlns:n="http://www.parasoft.com/wsdl/calculator/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">11.0</n:Result>


Please guide.

2 Replies

  • sumitbaliyan's avatar
    sumitbaliyan
    Occasional Contributor
    For more clarity: Result stated above is Actual Result, whereas Expected Result is 11.0
  • nmrao's avatar
    nmrao
    Champion Level 3
    That is correct, I can see the result success. See the attachment.