簡體   English   中英

使用Apache Jmeter使用http標頭發送xml內容

[英]Sending xml content with http header using Apache Jmeter

我正在嘗試通過使用Apache Jmeter2.8粘貼HTTP請求的Post Body部分以及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>

有誰知道這有什么解決方案?

我猜您在Header Manager中輸入的參數應該在這樣的路徑中:

/ path?param1 = value1&param2 = value2

不幸的是,如果沒有您的配置的屏幕截圖,則很難確保它是答案。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM