Jmeter-如何将XML请求发送到服务器? [英] Jmeter - How to send XML request to a server?

查看:1210
本文介绍了Jmeter-如何将XML请求发送到服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的测试计划中有一个HTTP请求采样器.我已经给出了服务器名称或IP,端口和URL.我选择了正文数据"选项卡,并以这种方式发出了XML请求:

I have a HTTP Request Sampler in my test plan. I have given my server name or IP, port and url. I chose the Body Data tab and gave an XML request in this way:

<Request>
    <Header><Log><Level>None</Level></Log></Header>
    <Body>
        <Action>
            <GetService>
                <Code>ABC</Code>
                <CodeValue>XYZ</CodeValue>
            </GetService>
        </Action>
    </Body> </Request>

但是,我将以下内容作为采样器的结果:

However, this what I am getting back the following as the Sampler result:

响应代码:非HTTP响应代码:java.net.ConnectException 响应消息:非HTTP响应消息:连接被拒绝

Response code: Non HTTP response code: java.net.ConnectException Response message: Non HTTP response message: Connection refused

响应头:

HTTPSampleResult字段: ContentType:
DataEncoding:空

HTTPSampleResult fields: ContentType:
DataEncoding: null

我确保可以对服务器执行ping操作.它启动并运行.

I have made sure that I can ping my server. Its up and running.

这里还有其他我想念的东西吗?

Is there something else that I am missing here?

提前谢谢!

推荐答案

我发现最简单的方法是使用SOAP/XML-RPC Request这样的东西.只需输入要发送的XML和URL,并确保不使用发送SOAPAction"即可.

I find it the easiest to just use a SOAP/XML-RPC Request for this kind of stuff. Simply enter the XML you want to send and the URL and make sure that Send SOAPAction is unchecked if you're not using it.

您遇到的问题似乎无关紧要.看来JMeter无法连接到服务器.您应该使用浏览器并尝试将XML发送到的URL手动尝试.您至少应该得到400错误. 连接被拒绝"看起来更像是服务器未运行.

The problem you're having seems to be unrelated though. It looks like JMeter can't get a connection to the server. You should try it manually by using your browser and going to the URL you want to send the XML to. You should at least get a 400 error. "Connection Refused" looks more like the server isn't running.

这篇关于Jmeter-如何将XML请求发送到服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆