eclipse 请求中缺少 wsse:Security 标头

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15810027/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 20:20:04  来源:igfitidea点击:

Missing wsse:Security header in request

eclipseaxis2soapuirampart

提问by Tania Marinova

I try to add rampart security to my axis 2 project using this tutorial page 19- 22

我尝试使用本教程 第 19-22 页为我的轴 2 项目添加城墙安全性

SO everything seems fine but when I switch to soapUI perspective to try to test the service the request which I'm proposed is :

所以一切似乎都很好但是当我切换到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>

and it gives me as a response:

它给了我一个回应:

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

SO I add the security header and my request becomes the same as the one written in the tutorial

所以我添加了安全标头,我的请求与教程中编写的请求相同

<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>

but the response is the same

但回应是一样的

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>

回答by Sebi

Don't add the security header directly to your request!

不要将安全标头直接添加到您的请求中!

Click on Autat the bottom left. Then you can enter your username/password there. For more information see: http://www.soapui.org/SOAP-and-WSDL/authenticating-soap-requests.html

点击左下角的Aut。然后你可以在那里输入你的用户名/密码。有关更多信息,请参阅:http: //www.soapui.org/SOAP-and-WSDL/authenticating-soap-requests.html

As Authorisation typechoose Preemptive. (Only in soapUI 4.5.1 as far as I know)

作为授权类型选择Preemptive。(据我所知,仅在soapUI 4.5.1 中)