【发布时间】:2018-05-18 05:23:38
【问题描述】:
如何使用 JSON 和独立的 WireMock 验证我的 Soap 请求是否包含标头和正文中的特定元素。
如果我的请求在标头中包含 <a:Id>1876</a:Id>,我应该得到 response1,否则我应该得到 response2
同样,我也需要检查身体。
以下是我的请求 XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:a="http://abc.example.com/a"
xmlns:b="http://abc.example.com/b"
xmlns:c="http://abc.example.com/c"
<soapenv:Header>
<a:abcHeaders>
<a:Id>1876</a:Id>
<a:Xid>12</a:Xid>
</a:abcHeaders>
</soapenv:Header>
<soapenv:Body>
<b:abcOpern>
<b:xyz>
<c:pqr>12</c:pqr>
</b:xyz>
</b:abcOpern>
</soapenv:Body>
</soapenv:Envelope>
【问题讨论】:
标签: json soap mocking wiremock