【问题标题】:Sending xml content with http header using Apache Jmeter使用 Apache Jmeter 发送带有 http 标头的 xml 内容
【发布时间】:2012-12-26 01:30:51
【问题描述】:

我正在尝试通过使用 Apache Jmeter2.8 粘贴 HTTP 请求的 Post Body 部分以及 HTTP 标头管理器中的两个标头来发送一个 xml 文件内容。响应应该是另一个 xml 文件,但响应数据显示 xml解析错误。 我在采样器结果部分得到关注

Thread Name: SOS_Secured_SOS_Local 1-1
Sample Start: 2013-01-11 17:22:25 GMT+05:30
Load time: 746
Latency: 746
Size in bytes: 21586
Headers size in bytes: 256
Body size in bytes: 21330
Sample Count: 1
Error Count: 0
Response code: 200
Response message: OK

Response headers:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, GET, OPTIONS
Access-Control-Allow-Headers: Content-Type
Content-Type: text/xml
Content-Length: 21330
Date: Fri, 11 Jan 2013 11:52:26 GMT


HTTPSampleResult fields:
ContentType: text/xml
DataEncoding: null

但响应数据部分显示以下内容-

<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport version="1.0.0" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://schemas.opengis.net/ows/1.1.0/owsAll.xsd" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <ows:Exception exceptionCode="MissingParameterValue">
    <ows:ExceptionText>Premature end of file.</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>

有谁知道解决这个问题的方法是什么?

【问题讨论】:

  • 通过屏幕截图显示您的请求采样器内容
  • @PMD UBIK-INGENIERIE 我无法添加屏幕截图,但这里有说明。我正在添加一个 HTTP 请求,并在那里提供要测试的 Web 服务的 IP、端口和路径。在帖子正文部分,我添加了 xml 内容。我还在 HTTP 标头管理器中添加了两个键,它们是获取响应 xml 所必需的。该请求在 Firefox 的 REST 客户端中运行良好,但在响应选项卡中显示错误“缺少参数值”和“文件过早结束”。请帮忙...

标签: apache xml-parsing jmeter


【解决方案1】:

我猜你放在 Header Manager 中的参数应该是这样的:

/path?param1=value1&param2=value2

很遗憾,如果没有您的配置屏幕截图,很难确定答案是否正确。

【讨论】:

    猜你喜欢
    • 2012-10-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-10
    • 2011-09-20
    • 1970-01-01
    • 2018-06-15
    • 2015-02-22
    相关资源
    最近更新 更多