2016-11-08 40 views
1

我試圖聯繫可以通過JMeter(3.0)web服務擊中一個WebService,我得到以下錯誤:獲取SOAP錯誤使用JMeter的

<?xml version="1.0" encoding="UTF-8"?> 
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> 
    <s:Body> 
     <s:Fault> 
     <s:Code> 
      <s:Value>s:Sender</s:Value> 
      <s:Subcode> 
       <s:Value xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/none">a:ActionNotSupported</s:Value> 
      </s:Subcode> 
     </s:Code> 
     <s:Reason> 
      <s:Text xml:lang="es-AR">The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).</s:Text> 
     </s:Reason> 
     </s:Fault> 
    </s:Body> 
</s:Envelope> 

我還沒有遇到網絡聯繫的任何問題來自SoapUI的服務,所以我想知道什麼會導致這個問題。

你可以看到屏幕截圖在這裏:

在樹中的HTTP請求,HTTP請求數據的第一部分,HTTP報頭管理器設置:https://i.stack.imgur.com/6HxIK.jpg

enter image description here

這裏是SoapUI上的結果(工作正常):

Results and log enter image description here

SoapUI發送請求的方式可能與Jmeter的方式不同,這就是爲什麼它可以工作嗎?

請幫忙。謝謝!

+0

你能展示你的測試計劃嗎? –

回答

1

你需要把這個action位是Content-Type頭部等的一部分:

Header Manager Settings

我還建議增加HTTP Cookie Manager到您的測試計劃


出於興趣,爲什麼不直接使用JMeter HTTP(S) Test Script Recorder來記錄源自SoapUI的請求,如:

  1. 配置JMeter進行錄製。這樣做的最簡單的方法是使用JMeter Templates功能

    • 從JMeter的主菜單:File - Templates - Recording - Create
    • 工作臺 - HTTP(S)測試腳本記錄 - 開始

      JMeter Proxy

  2. 配置SoapUI進行錄製

    • 從了SoapUI主菜單:Preferences - Proxy Settings
    • 代理Settting:手動,主機:IP地址或JMeter是跑步機的主機名,端口:8888

      SoapUI proxy settings

  3. 在執行請求SoapUI

  4. 在工作臺 - >錄製控制器下檢查JMeter中記錄的請求。
+0

謝謝,解決了這個問題,在編輯內容類型設置後,我能夠正確發送請求。我非常感謝你的幫助! – Mauro

1

我認爲你的http header的值爲SOAPAction有一些微不足道的錯誤。

發生了通知(在您附加的圖片中)其值中有雙引號。
只需從SOAPAction值中刪除雙引號"即可。

UPDATE:

值得注意的是,在編輯的問題,這已經soapUI的發送額外的HTTP頭action用一個值(你屏蔽值)。

因此,請在jmeter請求中添加action標頭,並在jmeter計劃中添加正確的值。