SOAP服务测试-xml响应中的特殊字符

时间:2018-07-16 15:04:26

标签: soap karate

我正在尝试使用空手道测试SOAP服务。通过参考git上的文档,我能够设置我的项目并做一些肥皂功能。我在断言期间遇到问题,因为响应具有特殊字符。详细信息如下:

SOAP XML响应:

<Reason Number="1">
    <ReasonText>T12345</ReasonText>
</Reason>

SOAP原始响应:

&lt;ReasonText&gt;T844&lt;/ReasonText&gt;

我可以在空手道功能中使用以下命令成功断言:

* def actualResponse = response
* match actualResponse contains '&lt;ReasonText&gt;T12345&lt;/ReasonText&gt;'

在使用以下代码时无法断言:

* def actualResponse = response
* match actualResponse contains '<ReasonText>T12345</ReasonText>'

对此表示感谢。

1 个答案:

答案 0 :(得分:-1)

There's something very wrong somewhere. And I have no idea what you mean by "SOAP Raw Response". If the server is actually returning what you are saying, then it is a problem with the server, not Karate.

Since no one else has reported this, I'm 99.9% sure you have a problem in your environment. Please take the help of someone from the server-side team if necessary.