相关疑难解决方法(0)

使用WS-Security UsernameToken PasswordDigest身份验证方案的WCF客户端使用Axis 2 Web服务时出错

我有一个WCF客户端连接到基于Java的Axis2 Web服务(在我的控制之外).它即将应用WS-Security,我需要修复.NET客户端.但是,我正在努力提供正确的身份验证.我知道WSE 3.0可能会让它变得更容易,但我宁愿不再使用过时的技术.

类似的问题(未解决),包括这个,这个这个.

SOAP消息如下所示:

<wsse:UsernameToken>
  <wsse:Username><!-- Removed--></wsse:Username> 
  <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest"><!-- Removed--></wsse:Password> 
  <wsse:Nonce><!-- Removed--></wsse:Nonce> 
  <wssu:Created>2010-05-28T12:50:33.675+01:00</wssu:Created> 
</wsse:UsernameToken>
Run Code Online (Sandbox Code Playgroud)

但是,我的看起来像这样:

<s:Header>
<h:Security xmlns:h="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"></h:Security>
<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<u:Timestamp u:Id="_0">
<u:Created>2010-06-23T10:31:23.441Z</u:Created>
<u:Expires>2010-06-23T10:36:23.441Z</u:Expires>
</u:Timestamp>
<o:UsernameToken u:Id="uuid-d329b3b2-6a1f-4882-aea6-ec6b8a492de7-1">
<o:Username>
<!-- Removed-->
</o:Username>
<o:Password>
<!-- Removed-->
</o:Password>
</o:UsernameToken>
</o:Security>
</s:Header>
Run Code Online (Sandbox Code Playgroud)

我的客户端看起来像这样:PS注意所需的 SecurityHeaderType参数.那是什么?

public MyAck SendRequest(MyRequest request)
{
 RemoteServicePortTypeClient client = new RemoteServicePortTypeClient();

 client.ClientCredentials.UserName.UserName = "JAY";
 client.ClientCredentials.UserName.Password = "AND";

    // what is the difference between the two different Credential …
Run Code Online (Sandbox Code Playgroud)

c# wcf ws-security axis2 web-services

13
推荐指数
1
解决办法
2万
查看次数

标签 统计

axis2 ×1

c# ×1

wcf ×1

web-services ×1

ws-security ×1