1

我正在使用 WSO2 身份服务器的 4.1.0 版。我使用了 WSO2 AuthenticationAdmin 服务(localhost:9443/services/AuthenticationAdmin)来登录、检查身份验证器等。还有一个“注销”操作。

当soapUI 生成注销请求时,它不包含任何值得注意的元素,正如具有命名空间http://authentication.services.core.carbon.wso2.org的架构(xsd)所证实的那样。SOAP 请求正文如下。

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:aut="http://authentication.services.core.carbon.wso2.org">
 <soap:Header/>
   <soap:Body>
     <aut:logout/>
 </soap:Body>
</soap:Envelope>

发送请求时,RAW 响应如下。

HTTP/1.1 202 Accepted
Date: Wed, 26 Jun 2013 08:29:48 GMT
Server: WSO2 Carbon Server
Content-Type: text/xml;charset=UTF-8
Set-Cookie: JSESSIONID=94784CC9FC03E9FA3822CFDDAD0D36F6; Path=/; Secure; HttpOnly
Vary: Accept-Encoding
Content-Encoding: gzip
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked

首先,我是否认为响应中没有 SOAP 消息。另外,HTTP 状态为 202,表示已接受请求进行处理,但尚未完成处理。

如何使用此服务注销?

< aut:logout > 应该添加哪些元素?

是否应该将 JSESSIONID 添加到请求的标头中?

如何将此注销与 loginWithRememberMeOption 结合使用?

------- 更新查看 xsd 后,我看到必须将 wsa:action 添加到 SOAP 标头。完成此操作后,我收到了以下回复。此回复要求提供 MessageID。但我不确定这个值应该是多少。

<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
   <soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
      <wsa:Action>http://www.w3.org/2005/08/addressing/fault</wsa:Action>
   </soapenv:Header>
   <soapenv:Body>
      <soapenv:Fault>
         <soapenv:Code>
            <soapenv:Value>soapenv:Sender</soapenv:Value>
            <soapenv:Subcode>
               <soapenv:Value xmlns:wsa="http://www.w3.org/2005/08/addressing">wsa:MessageAddressingHeaderRequired</soapenv:Value>
            </soapenv:Subcode>
         </soapenv:Code>
         <soapenv:Reason>
            <soapenv:Text xml:lang="en-US">A required header representing a Message Addressing Property is not present</soapenv:Text>
         </soapenv:Reason>
         <soapenv:Detail>
            <wsa:ProblemHeaderQName xmlns:wsa="http://www.w3.org/2005/08/addressing">wsa:MessageID</wsa:ProblemHeaderQName>
         </soapenv:Detail>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>

添加生成的 MessageID 时,它又是一个带有 HTTP 202 状态的空 SOAP 回复。

4

1 回答 1

0

注销方法只是使会话无效。

您只需调用来自soapUI 的注销操作。它没有参数。

如果您查看 AuthenticationAdmin WSDL,您可以看到没有用于注销操作的输出。这就是您获得 HTTP 202 状态代码的原因。

您可以通过<HideAdminServiceWSDLs>在 carbon.xml (/repository/conf/carbon.xml) 中将配置更改为 false来查看 WSDL

<HideAdminServiceWSDLs>false</HideAdminServiceWSDLs>

在浏览器中键入以下内容以查看 WSDL。

https://:9443/services/AuthenticationAdmin?wsdl

我希望这有帮助!

于 2013-06-27T04:03:13.597 回答