我有一个程序通过WSDL结构将请求发送到Web服务,然后收到响应。目前我收到的回复是:
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> 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& fromLocalCache, Boolean& 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>
关于什么已经消失的任何想法?
答案 0 :(得分:1)
您可能提供了错误的凭据。您在跟踪中有以下内容:
Authentication with the SecurityService has failed for username 'exam269'
来自MSDN的异常说明,here:
NegotiateStream 和 SslStream 类会在此时抛出此异常 客户端或服务器无法通过身份验证。当这个例外是 抛出后,您可以 使用其他凭据重试身份验证 。 如果您无法重试身份验证,则 FatalAuthenticationException 抛出而不是 AuthenticationException 。