webservice頭部認證

來源:互聯網
上載者:User

標籤:

  近期利用Jmeter測試webservice介面並發,調用webservice會出現Message does not conform to configured policy [ AuthenticationTokenPolicy(S) ]:  No Security Header found 這樣的錯誤。

以在 soapui 調用的結果來看, 會出現如下的返回

出現這種錯誤的原因 是webservice 的服務端需要提供 soap 認證的表頭。

舉例來說, 可能需要加上如下的認證頭:

[html] 
  1. <soapenv:Header>  
  2.   <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="1">  
  3.     <wsse:UsernameToken>  
  4.       <wsse:Username>UserName</wsse:Username>  
  5.       <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-.0#PasswordText">Password</wsse:Password>  
  6.     </wsse:UsernameToken>  
  7.   </wsse:Security>  
  8. </soapenv:Header>  

(這個具體的格式和服務端的要求有關, 具體的username和pass也是服務端提供的)

在sopaui 調用的時候, 加上類似, 就能呼叫成功了。

 

在soapui中調試成功後,再將對應的xml複製到jmeter使用。

webservice頭部認證

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.