开发者

Exception occuring while login in C#

I am using windows application and WCF service in my application. I have published my service in web server and also i referred that endPointAddress in my config settings. The application working properly in my system and some systems but it could not be login in another system. And its throws an exception while login...

Here i mentioned my exception, can any one tell me the solution of this problem? Thanks in Advance..

Exception:

SOAP security negotiation with 'http://example.com/DashBoardPointsService/Service.svc' for target 'http://example.com/DashBoardPointsService/Service.svc' failed. See inner exception for more details.

Inner Exception:

System.ComponentModel.Win32Exception: The Security Support Provider Interface (SSPI) negotiation failed. at System.ServiceModel.Security.WindowsSspiNegotiation.GetOutgoingBlob(Byte[] incomingBlob, IExtendedProtectionSupport extendedProtectionSupport) at System.ServiceModel.Security.SspiNegotiationTokenProvider.GetOutgoingBlobProxy.GetOutgoingBlob(ChannelBinding channelBinding) at System.ServiceModel.Security.RequestSecurityToken.GetBinaryNegotiation() at System.ServiceModel.Security.WSTrust.Driver.WriteRequestSecurityToken(RequestSecurityToken rst, XmlWriter xmlWriter) at System.ServiceModel.Security.RequestSecurityToken.WriteTo(XmlWriter writer) at System.ServiceModel.Channels.BodyWriter.WriteBodyContents(XmlDictionaryWriter writer) at System.ServiceModel.Channels.Message.OnWriteMessage(XmlDictionaryWriter writer) at System.ServiceModel.Channels.BufferedMessageWriter.WriteMessage(Message message, BufferManager bufferManager, Int32 initialOffset, Int32 maxSizeQuota) at System.ServiceModel.Channels.TextMessageEncoderFactory.TextMessageEncoder.WriteMessage(Message message, Int32 maxMessageSize, BufferManager bufferManager, Int32 messageOffset) at System.ServiceModel.Channels.HttpOutput.SerializeBufferedMessage(Message message) at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout) at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout) at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) at System.ServiceModel.Security.IssuanceTokenProviderBase`1.DoNegotiation(TimeSpan timeout)

Stack Trace:

   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)

Source:

This is My config settings of WCF service:

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);                
  开发者_JS百科      objActivatedConnectionManager = objConnectionManager.CreateChannel();                

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


This is probably a rights issue.

The client has a security context that is being blocked by the server.

Check the identity of the client and the permissions on the server.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜