wcf - 部署的服务上的WCFTestClient异常

标签 wcf wcftestclient

我使用Visual Studio随附的WCFTestClient来测试我的服务。
问题是该工具正在为我的应用在wisual studio中部署的服务工作。但是,如果我尝试连接到另一台计算机上的已部署实例,则会收到以下异常。有人解决了这个问题吗?

该服务使用WindowsAutentication

The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate oX0we6ADCgEBonQEcmBwBgkqhkiG9xIBAgIDAH5hMF+gAwIBBaEDAgEepBEYDzIwMTAxMDI3MDgzNTIxWqUFAgMCED6mAwIBKakLGwlCQVcuTE9DQUyqJzAloAMCAQOhHjAcGwRob3N0GxRsYmFpdGVzdDAxLmJhdy5sb2NhbA=='.

    Server stack trace: 
       at System.ServiceModel.Channels.HttpChannelUtilities.ValidateAuthentication(HttpWebRequest request, HttpWebResponse response, WebException responseException, HttpChannelFactory factory)
       at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory factory, WebException responseException, ChannelBinding channelBinding)
       at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at IBCMService.GetAllRegions()
       at BCMServiceClient.GetAllRegions()

    Inner Exception:
    The remote server returned an error: (401) Unauthorized.
       at System.Net.HttpWebRequest.GetResponse()
       at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)

    Inner Exception:
    The target principal name is incorrect
       at System.Net.NTAuthentication.GetOutgoingBlob(Byte[] incomingBlob, Boolean throwOnError, SecurityStatus& statusCode)
       at System.Net.NTAuthentication.GetOutgoingBlob(String incomingBlob)
       at System.Net.NegotiateClient.DoAuthenticate(String challenge, WebRequest webRequest, ICredentials credentials, Boolean preAuthenticate)
       at System.Net.NegotiateClient.Authenticate(String challenge, WebRequest webRequest, ICredentials credentials)
       at System.Net.AuthenticationManager.Authenticate(String challenge, WebRequest request, ICredentials credentials)
       at System.Net.AuthenticationState.AttemptAuthenticate(HttpWebRequest httpWebRequest, ICredentials authInfo)
       at System.Net.HttpWebRequest.CheckResubmitForAuth()
       at System.Net.HttpWebRequest.CheckResubmit(Exception& e)

最佳答案

您可以右键单击wcftestclient中的配置文件,单击“复制完整路径”,在编辑器中打开该路径,然后检查安全设置是否与部署的服务配置匹配

关于wcf - 部署的服务上的WCFTestClient异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4031314/

相关文章:

wcf - WCF和传统的ASP.NET Web有什么区别

WCF : How to disable WCF Test Client

C# + WinRT + 用于网络(Azure 移动服务)操作的 Monogame 线程

Silverlight 4 TreeView MVVM WCF

c# - 使用 BasicHttpBinding 进行身份验证的 WCF 服务

.net - 无法启动应用程序 "WcfTestClient.exe"

wcf - 为什么我的 WCF 服务没有加载我的绑定(bind)配置?

visual-studio-2010 - 如何在测试 WCF 服务时将值传递给 List<string> 属性?

c# - MVC 3 - 如何在异步 WCF 调用后立即 RedirectToAction

c# - 如何删除数据成员上的命名空间?