WSDL调用Web服务;服务器无法处理请求---> System.Security.AuthenticationException

时间:2015-04-17 17:33:15

标签: c#-4.0 soap wsdl

我有一个程序通过WSDL结构将请求发送到Web服务,然后收到响应。目前我收到的回复是:

    <soap:Fault>
  <faultcode>soap:Server</faultcode>
  <faultstring>System.Web.Services.Protocols.SoapException: Server was unable to process request. ---&gt;   System.Security.Authentication.AuthenticationException: Failed to authenticate Rewards service - (5.0.0):Authentication with the SecurityService has failed for username 'exam269'
at P3Rewards.ServiceHost.RewardsServiceState.GetPrincipal(Boolean&amp; fromLocalCache, Boolean&amp; fromP3Cache) in c:\Development\P3Rewards\Source\P3Rewards.ServiceHost\RewardsServiceState.cs:line 105
at P3Rewards.ServiceHost.ServiceMethodCall`2.GenerateController() in c:\Development\P3Rewards\Source\P3Rewards.ServiceHost\ServiceMethodCall.cs:line 254
at System.Lazy`1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
at System.Lazy`1.get_Value()
at P3Rewards.ServiceHost.ServiceMethodCall`2.get_Controller() in c:\Development\P3Rewards\Source\P3Rewards.ServiceHost\ServiceMethodCall.cs:line 27
at P3Rewards.ServiceHost.ServiceMethodCall`2.LogResponse() in c:\Development\P3Rewards\Source\P3Rewards.ServiceHost\ServiceMethodCall.cs:line 245
at P3Rewards.ServiceHost.ServiceMethodCall`2.Execute() in c:\Development\P3Rewards\Source\P3Rewards.ServiceHost\ServiceMethodCall.cs:line 149
at P3Rewards.ServiceHost.ServiceMethodCall`2.ServiceCallMethodFluentHandler.Execute() in c:\Development\P3Rewards\Source\P3Rewards.ServiceHost\ServiceMethodCall.cs:line 88
at P3Rewards.ServiceHost.RewardsService.NewMemberRegistration(String source, NewMember registerMember) in c:\Development\P3Rewards\Source\P3Rewards.ServiceHost\RewardsService.asmx.cs:line 163
--- End of inner exception stack trace ---</faultstring>
  <detail />
</soap:Fault>

关于什么已经消失的任何想法?

1 个答案:

答案 0 :(得分:1)

您可能提供了错误的凭据。您在跟踪中有以下内容:

Authentication with the SecurityService has failed for username 'exam269'

来自MSDN的异常说明,here

  

NegotiateStream SslStream 类会在此时抛出此异常   客户端或服务器无法通过身份验证。当这个例外是   抛出后,您可以 使用其他凭据重试身份验证 。   如果您无法重试身份验证,则 FatalAuthenticationException   抛出而不是 AuthenticationException