使用Apache Jmeter使用http标头发送xml内容

时间:2013-01-11 12:55:00

标签: apache xml-parsing jmeter

我试图通过粘贴HTTP请求的Post Body部分以及使用Apache Jmeter2.8在HTTP Header Manager中的两个头部来发送一个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>

有没有人知道这可能是什么解决方案?

1 个答案:

答案 0 :(得分:0)

我猜您在Header Manager中输入的参数应该在这样的路径中:

  

/ path?param1 = value1&param2 = value2

不幸的是,没有配置的屏幕截图,很难确定它是答案。