【问题标题】:HTTP request web service function in jmeterjmeter中的HTTP请求Web服务功能
【发布时间】:2016-01-22 02:50:33
【问题描述】:

我尝试从 java web 服务调用一个函数,但不知道如何设置以及如何编写“body data”的内容。

WSDL 定位:localhost:8080/OracleDB/WS?WSDL

function ReturnSet 请求无输入并返回List

在 jmeter 中,我设置 IP=localhost, Port=8080, Path=/OracleDB/WS?WSDL, Method=POST 和正文数据到 HTTP 请求

<?xml version="1.0" encoding="utf-8"?> 
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
            <ReturnSet>
            </ReturnSet>
    </soap:Body>
</soap:Envelope>

返回找不到ReturnSet。


更新:

感谢 Dmitri T。

在 SoapUI 中,它发送 XML 如下所示,标题 Content-Type 设置为“text/xml; charset=utf-8”。 在这些更改之后,它就可以工作了。

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:uses="http://useSQL/">
    <soapenv:Header/>
        <soapenv:Body>
            <uses:ReturnSet/>
        </soapenv:Body>
</soapenv:Envelope>

【问题讨论】:

    标签: java web-services soap wsdl jmeter


    【解决方案1】:

    我相信您需要添加 HTTP Header Manager 并添加正确的 Content-TypeSOAPAction 标头。


    另一个选择是切换到SOAP/XML-RPC Request采样器

    【讨论】:

    • 是的,我有这两个属性的标头管理器,Content-Type="text/xml; charset=utf-8",SOAPAction 是空白的,就像jmeter.apache.org/usermanual/build-ws-test-plan.html 中的教程一样。在 SOAP/XML-RPC 请求采样器的下面,在 WebService 采样器中,它说使用 HTTP 请求代替。它应该在 HTTP 请求中工作。或者你可以在 SOAP/XML-RPC 请求中展示它是如何工作的。
    • 我认为正确的内容类型应该是application/soap+xml; charset=utf-8'。使用查看结果树侦听器检查响应
    • 好吧,它显示:响应消息:不支持的媒体类型。
    • 根据w3.org/TR/soap12-part2/#tabreqstatereqtrans 服务器对您的内容类型和/或编码不满意。
    • 找出正确的组合。也许在SoapUI 的帮助下。我没有 OracleDB 可以玩,因此无法为您提供解决方案,只有前进的方向。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-10-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-19
    • 2013-04-28
    相关资源
    最近更新 更多