【发布时间】:2019-02-01 13:24:27
【问题描述】:
我正在尝试使用空手道 0.9.1 测试肥皂网络服务,我根据文档创建了场景。
但是当我在测试场景中传递 web 服务请求时测试肥皂 web 服务时出现异常。
场景:1 我通过了如下请求,
* def req=
"""
<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:QueryUsageBalance xmlns:ns2="http://www.mycompany.com/usage/V1">
<ns2:UsageBalance>
<ns2:LicenseId>12341234</ns2:LicenseId>
</ns2:UsageBalance>
</ns2:QueryUsageBalance>
</S:Body>
</S:Envelope>
"""
结果
“[Fatal Error] :32:18: XML document structures must start and end within the same entity”
场景:2
Given request
"""
<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:QueryUsageBalance xmlns:ns2="http://www.mycompany.com/usage/V1">
<ns2:UsageBalance>
<ns2:LicenseId>12341234</ns2:LicenseId>
</ns2:UsageBalance>
</ns2:QueryUsageBalance>
</S:Body>
</S:Envelope>
"""
结果
“[Fatal Error] :32:18: XML document structures must start and end within the same entity”
场景:3
Given request =
"""
<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:QueryUsageBalance xmlns:ns2="http://www.mycompany.com/usage/V1">
<ns2:UsageBalance>
<ns2:LicenseId>12341234</ns2:LicenseId>
</ns2:UsageBalance>
</ns2:QueryUsageBalance>
</S:Body>
</S:Envelope>
"""
结果
Program execution freezes and no output
谁能帮我理解我在这里做错了什么。
我在空手道 0.6.1 中使用了相同的 xml,它运行良好。
【问题讨论】:
标签: karate