首页 > 解决方案 > 发送带有文件附件的 SOAP 请求

问题描述

我需要发送一个 SOAP 请求并包含一个文件。

我已阅读空手道框架文档,可以查看使用 json 请求上传文件的示例,但无法弄清楚如何针对 SOAP 请求进行修改。

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <AddDocumentRequest>
            <applicationId>123213</applicationId>
            <siteId>siteid</siteId>
            <username>User</username>
            <token>token</token>
            <documentName>testfile.txt</documentName>
            <documentFile>
                <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:12324"/>
            </documentFile>
            <description>payslip</description>
            <isPrivate>true</isPrivate>
        </AddDocumentRequest>
    </soap:Body>
</soap:Envelope>

我通常使用soap ui 进行此测试,但希望使用空手道框架实现与我使用空手道进行所有api 和性能测试相同的事情。

标签: karate

解决方案


推荐阅读