首页 > 解决方案 > Raw Soap requests/responses in citrus

问题描述

Is there any way to send raw soap requests and responses in Citrus-framework as client or server ? I have a plain text of a soap-request and want to send it to a server. Afterwards I want to validate the plain text/ xml - response.

Regards, Suspicious Dee

标签: httpsoapcitrus-framework

解决方案


默认情况下,Citrus 将自动处理 SOAP 信封并为您包装/解包有效负载主体。如果您想保持 SOAP 信封原样以便自己提供整个 SOAP 消息,您需要在服务器端点上进行设置:

<citrus-ws:server id="soapServer"
    port="8080"
    auto-start="true"
    keep-soap-envelope="true"/>

现在keep-soap-envelope="true",您可以在处理此服务器端点上的消息时自己指定 SOAP 信封。在验证中,您现在可以提供整个 SOAP 信封作为预期的消息内容。

在客户端,您需要http-client在 Citrus 中使用普通组件,因为该soap-client组件目前无法保留 SOAP 信封。

当然,也可以使用客户端和服务器端的核心 http 组件来发送和接收带有测试人员提供的 SOAP 信封的 SOAP 消息。


推荐阅读