I get this response from a service I am calling. I wish to write an assertion in Soap-UI to validate the value of the <Result> tag.



<s:Envelope xmlns:s="http://ift.tt/sVJIaE">
<s:Body>
<ServiceResponse> <!--Issue happens here when xmlns attribute is present-->
<ServiceResult xmlns:a="http://ift.tt/1J11uPT" xmlns:i="http://ift.tt/ra1lAU">
<AdditionalInfo i:nil="true"/>
<ErrorMessage/>
<ErrorMessageId i:nil="true"/>
<ErrorMessages xmlns:b="http://ift.tt/1bQEByM"/>
<InternalId>0</InternalId>
<RecordsAffected>0</RecordsAffected>
<Result>false</Result>
<WarningMessages xmlns:b="http://ift.tt/1bQEByM"/>
<a:ReturnBase>
</a:ReturnBase>
</ServiceResult>
</ServiceResponse>
</s:Body>
</s:Envelope>


I used the Xpath Testing tool online to find a correct path. When I remove the xmlns attribute on the <ServiceResponse> tag, the XPATH works as expected. However when I have the xmlns="http://schema.Services" on the <ServiceResponse> tag, XPath fails to return an item.


I also tried to find this in Notepad++ with the XML Tools Plugin and it throws an exception when I have the <ServiceResponse xmlns="http://schema.Services"> in there.


How can I go about writing this assertion in soap-UI?


No comments:

Post a Comment