2011-01-25 68 views
1

我在我的应用程序中使用了Windows应用程序和WCF服务。我已经在web服务器上发布了我的服务,并且我在配置设置中提到了endPointAddress。该应用程序在我的系统和一些系统中正常工作,但无法在另一个系统中登录。它在登录时会抛出异常...在C中登录时发生异常#

在这里我提到了我的例外情况,可以有人告诉我这个问题的解决方案吗? 在此先感谢..

例外: 'http://example.com/DashBoardPointsService/Service.svc' 为目标“

SOAP安全协商http://example.com/DashBoardPointsService/ Service.svc'失败。有关更多详情,请参阅内部例外

内部异常:

System.ComponentModel.Win32Exception:安全支持提供程序接口(SSPI)协商失败。 在System.ServiceModel.Security.WindowsSspiNegotiation.GetOutgoingBlob(字节[] incomingBlob,IExtendedProtectionSupport extendedProtectionSupport) 在System.ServiceModel.Security.SspiNegotiationTokenProvider.GetOutgoingBlobProxy.GetOutgoingBlob(ChannelBinding channelBinding) 在System.ServiceModel.Security.RequestSecurityToken.GetBinaryNegotiation() 在System.ServiceModel.Security.WSTrust.Driver.WriteRequestSecurityToken(RequestSecurityToken RST,的XmlWriter的XmlWriter) 在System.ServiceModel.Security.RequestSecurityToken.WriteTo(XmlWriter的作家) 在System.ServiceModel.Channels.BodyWriter.WriteBodyContents(的XmlDictionaryWriter作家) at System.ServiceModel.Channels.Message.OnWriteMessage(XmlDictionaryWriter writer) at System.Serv系统上的System.ServiceModel.Channels.TextMessageEncoderFactory.TextMessageEncoder.WriteMessage(消息消息,Int32 maxMessageSize,BufferManager bufferManager,Int32 messageOffset) 消息消息(消息消息,BufferManager bufferManager,Int32 initialOffset,Int32 maxSizeQuota)。 ServiceModel.Channels.HttpOutput.SerializeBufferedMessage(消息信息) 在System.ServiceModel.Channels.HttpOutput.Send(时间跨度超时) 在System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.SendRequest(消息消息,时间跨度超时) 在System.ServiceModel.Channels.RequestChannel.Request(消息消息,TimeSpan超时) at System.ServiceModel.Security.IssuanceTokenProviderBase`1.DoNegotiation(TimeSpan timeout)

堆栈跟踪:

at System.ServiceModel.Security.IssuanceTokenProviderBase`1.DoNegotiation(TimeSpan timeout) 
    at System.ServiceModel.Security.SspiNegotiationTokenProvider.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Security.SecurityUtils.OpenCommunicationObject(ICommunicationObject obj, TimeSpan timeout) 
    at System.ServiceModel.Security.SymmetricSecurityProtocol.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Channels.SecurityChannelFactory`1.ClientSecurityChannel`1.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.DoOperation(SecuritySessionOperation operation, EndpointAddress target, Uri via, SecurityToken currentToken, TimeSpan timeout) 
    at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.GetTokenCore(TimeSpan timeout) 
    at System.IdentityModel.Selectors.SecurityTokenProvider.GetToken(TimeSpan timeout) 
    at System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade) 
    at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(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 IService.GetLoginDetails(String strUserName, String strPassword) 
    at ExportReportsandPointsDetails.frmLogin.btnSubmit_Click(Object sender, EventArgs e) 

来源:

这是WCF服务我的配置设置:

public void CreateConnection() 
{ 
    try 
    { 
     string strNewURL = "http://example.com/DashBoardPointsService/Service.svc"; 
     EndpointAddress ep = new EndpointAddress(strNewURL);     

     WSHttpBinding binding = new WSHttpBinding(); 
     binding.Security.Mode = SecurityMode.Message; 

     binding.MaxBufferPoolSize = 819222; 
     binding.MaxReceivedMessageSize = 819222; 
     binding.ReceiveTimeout = TimeSpan.MaxValue; 
     binding.SendTimeout = TimeSpan.MaxValue; 
     binding.OpenTimeout = TimeSpan.MaxValue; 
     binding.CloseTimeout = TimeSpan.MaxValue; 
     binding.MaxReceivedMessageSize = 99999999; 
     binding.MaxBufferPoolSize = 99999999; 
     binding.ReaderQuotas.MaxArrayLength = 714748; 
     binding.ReaderQuotas.MaxBytesPerRead = 214748; 
     binding.ReaderQuotas.MaxDepth = 2147483647; 
     binding.ReaderQuotas.MaxNameTableCharCount = 214749; 
     binding.ReaderQuotas.MaxStringContentLength = 214749; 

     objConnectionManager = new ChannelFactory<IService>(binding, ep);     
     objActivatedConnectionManager = objConnectionManager.CreateChannel();     

    } 
    catch (Exception ex) 
    { 
     objlog.Write(ex); 
    } 
} 
+0

你可以发布WCF服务的配置吗?什么是clientCredential类型?客户端无法连接到的计算机在不同的域中? –

+0

这是我的wcf配置,我在一个函数中使用它。 – Suryakavitha

+0

我看不到它。你有没有错过格式化?如果您尝试使用wsHttpBinding,并且WCF服务或客户端位于不同的域上,则它将无法工作。改为使用basicHttpBinding –

回答

0

这可能是配股。

客户端有一个正在被服务器阻止的安全上下文。

检查客户端的身份和服务器上的权限。

相关问题