2013-04-04 745 views
1

我嘗試使用此tutorial頁19- 22缺少的wsse:Security標頭在請求

所以一切似乎罰款壁壘安全添加到我的2軸項目,但是當我切換到soapUI的角度來嘗試測試其中我建議的服務 的要求是:

soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:axis="http://axis2wstest"> 
<soapenv:Header/> 
    <soapenv:Body> 
     <axis:testws> 
     <!--Optional:--> 
     <axis:x>5</axis:x> 
     </axis:testws> 
    </soapenv:Body> 
</soapenv:Envelope> 

,這讓我作爲響應:

faultstring>Missing wsse:Security header in request</fau 

SO我添加了安全頭和我的要求變得一樣的一個書面教程

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:axis="http://axis2wstest"> 
<soapenv:Header> 
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis- 
200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="1"> 
<wsse:UsernameToken xmlns:wsu="http://docs.oasis- 
open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="123"> 
<wsse:Username>test</wsse:Username> 
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis- 
200401-wss-username-token-profile-1.0#PasswordText">pass</wsse:Password> 
</wsse:UsernameToken> 
</wsse:Security> 
</soapenv:Header> 
    <soapenv:Body> 
     <axis:testws> 
     <!--Optional:--> 
     <axis:x>5</axis:x> 
     </axis:testws> 
    </soapenv:Body> 
</soapenv:Envelope> 

但反應是一樣的

soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> 
    <soapenv:Body> 
     <soapenv:Fault xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> 
     <faultcode>wsse:InvalidSecurity</faultcode> 
     <faultstring>Missing wsse:Security header in request</faultstring> 
     <detail/> 
     </soapenv:Fault> 
    </soapenv:Body> 
</soapenv:Envelope> 
+0

請不要用「urgent」等詞語標記你的問題。謝謝。 – 2013-04-05 10:31:19

回答

4

不要添加安全頭直接發送到您的請求!

點擊Aut在左下角。然後你可以在那裏輸入你的用戶名/密碼。 欲瞭解更多信息,請參閱:http://www.soapui.org/SOAP-and-WSDL/authenticating-soap-requests.html

由於授權類型選擇搶佔。 (據我所知,只在soapUI 4.5.1中)

+0

謝謝您的迴應!但我使用soaUI插件進行日食。我點擊Aut菜單,我有這些字段 - 密碼(我寫密碼),用戶名(我寫的用戶名),傳入WSS(它;下拉,當我打開它沒有opions)和相同的與輸出WSS。看來我需要設置我的authorizatuon類型,但是當我在eclipse中打開時--Windows - Preferences - soapUi;在https設置中,有一個字段以搶先方式進行身份驗證,然後單擊選項 - 「向傳出請求添加身份驗證信息」,但沒有任何反應。 – 2013-04-07 05:37:38

+0

離開*傳入WSS *和*傳出WSS *空白並僅設置用戶名和密碼。它應該工作。 – Sebi 2013-04-08 05:30:26

+0

我不會使用Eclipse插件。我不知道它是否是最新的... – Sebi 2013-04-08 05:33:02