2010-10-27 69 views
3

我使用隨Visual Studio提供的WCFTestClient來測試我的服務。 問題是,該工具正在爲我的應用程序部署在wisual studio中的服務工作。但是,如果我嘗試連接到另一臺機器上的部署實例,則會出現以下異常。有沒有人解決過這個問題?已部署服務的WCFTestClient例外

該服務使用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) 
+0

匹配'.net3.5'和你試圖連接到'.NET3.5 SP1'的服務器,那麼你可以看看http://msmvps.com/blogs/alvin/archive/2008/11/14 /net-3-5-sp1-breaking-change-to-wcf.aspx – InSane 2010-10-27 08:50:57

+0

機器是否在同一個域中? – 2010-10-27 09:03:38

回答

1

您可以右鍵單擊在wcftestclient配置文件,單擊複製完整路徑,打開路徑它在編輯器中,並檢查安全設置,如果你的本地計算機上部署的服務配置