lib/soaspec/exchange_handlers/soap_handler.rb in soaspec-0.0.47 vs lib/soaspec/exchange_handlers/soap_handler.rb in soaspec-0.0.48
- old
+ new
@@ -153,16 +153,16 @@
# @return [String] Value inside element found through Xpath
def xpath_value_for(response: nil, xpath: nil)
raise ArgumentError unless response && xpath
result =
if Soaspec.strip_namespaces? && !xpath.include?(':')
- temp_doc = response.doc
+ temp_doc = response.doc.dup
temp_doc.remove_namespaces!
temp_doc.xpath(xpath).first
else
response.xpath(xpath).first
end
- raise NoElementAtPath, "No value at Xpath '#{xpath}'" unless result
+ raise NoElementAtPath, "No value at Xpath '#{xpath}' in XML #{response.doc}" unless result
result.inner_text
end
# Based on a exchange, return the value at the provided xpath
# If the path does not begin with a '/', a '//' is added to it
\ No newline at end of file