none
Need help with some exceptions

    질문

  • I have a WCF net.tcp server/client with authentication and encryption (using verisign certificate) .

    So far, I have 2 people complaining from about 100-150 who tested my application :

    1.

    System.Reflection.TargetInvocationException: An exception occurred during the operation, making the result invalid. Check InnerException for exception details. ---> System.ServiceModel.Security.MessageSecurityException: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail. ---> System.ServiceModel.FaultException: An error occurred when verifying security for the message.

    2. 

    System.Reflection.TargetInvocationException: An exception occurred during the operation, making the result invalid.  Check InnerException for exception details. ---> System.ServiceModel.CommunicationException: The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.

    Any ideas on what might be causing this exceptions ?

    2012년 3월 13일 화요일 오후 5:56

모든 응답

  • Exception thrown by server would be my guess, after that I'd say contract mismatch is a close second.  Is the service set to return exceptions?  You can turn on WCF logging if you want to see the raw messages.

    -Dan


    If this answers your question, please Mark as Answer

    2012년 3월 13일 화요일 오후 6:09
  • Now I have this huge log and I can't figure out what's causing it . This is for a user that gets the first exception I mentioned :

    http://pastebin.com/LGW7Bucq

    • 편집됨 FAndrei 2012년 3월 21일 수요일 오후 12:02
    2012년 3월 21일 수요일 오후 12:01
  • Hi,

    You say your using verisign for authentication and encryption. Are you using message or transport security?

    What binding are you using?

    Does the client have to provide a certificate? or is it only the service that provides the certificate for security?

    2012년 3월 21일 수요일 오후 1:40
  • I'm using Message security . This is my binding: 

                    selfHost.Credentials.UserNameAuthentication.UserNamePasswordValidationMode = System.ServiceModel.Security.UserNamePasswordValidationMode.Custom;

                    selfHost.Credentials.UserNameAuthentication.CustomUserNamePasswordValidator = new Passwordvalidator();
                    selfHost.Credentials.ServiceCertificate.SetCertificate(StoreLocation.LocalMachine, StoreName.My, X509FindType.FindBySubjectName, "...");
                    selfHost.Credentials.IssuedTokenAuthentication.CertificateValidationMode = System.ServiceModel.Security.X509CertificateValidationMode.None;
                    selfHost.Credentials.IssuedTokenAuthentication.RevocationMode = X509RevocationMode.NoCheck;
                    selfHost.Credentials.ClientCertificate.Authentication.CertificateValidationMode = System.ServiceModel.Security.X509CertificateValidationMode.None;
                    selfHost.Credentials.IssuedTokenAuthentication.TrustedStoreLocation = StoreLocation.LocalMachine;
                    NetTcpBinding binding = new NetTcpBinding();
                    binding.Security.Mode = SecurityMode.Message;

                    binding.Security.Message.ClientCredentialType = MessageCredentialType.UserName;
                    binding.ReceiveTimeout = TimeSpan.MaxValue;
                    binding.MaxReceivedMessageSize = int.MaxValue;
                    binding.MaxConnections = 1000000;
                    binding.ReaderQuotas.MaxArrayLength = 200000;
                    binding.ReaderQuotas.MaxBytesPerRead = 200000;
                    binding.ReaderQuotas.MaxStringContentLength = 10000;
                    binding.ReaderQuotas.MaxNameTableCharCount = 50000;
                    binding.MaxBufferPoolSize = 1000000;
                    binding.MaxBufferSize = 1000000;
                    binding.MaxReceivedMessageSize = 1000000;
                    binding.TransferMode = TransferMode.Buffered;
                    binding.SendTimeout = TimeSpan.FromSeconds(50.0);
                    binding.CloseTimeout = TimeSpan.FromSeconds(50.0);


                    ServiceThrottlingBehavior throttling = new ServiceThrottlingBehavior();
                    throttling.MaxConcurrentSessions = 10000000;
                    throttling.MaxConcurrentCalls = 10000000;
                    throttling.MaxConcurrentInstances = 10000000;


                    selfHost.Description.Behaviors.Add(throttling);
                    selfHost.Description.Behaviors.Find<ServiceDebugBehavior>().IncludeExceptionDetailInFaults = true;

                    
    2012년 3월 21일 수요일 오후 3:20
  • I think i fixed the problem by changing the clock skew:

    http://www.danrigsby.com/blog/index.php/2008/08/26/changing-the-default-clock-skew-in-wcf/

    I'm waiting for the people who couldn't connect to confirm . 

    • 답변으로 제안됨 Dragan Radovac 2012년 4월 3일 화요일 오전 7:27
    • 답변으로 표시됨 Yi-Lun Luo 2012년 4월 6일 금요일 오전 2:26
    • 답변으로 표시 취소됨 FAndrei 2012년 4월 29일 일요일 오전 11:01
    • 답변으로 제안 취소됨 FAndrei 2012년 5월 5일 토요일 오후 5:40
    2012년 3월 21일 수요일 오후 6:52
  • Actually the problem wasn't solved ...

    Same people can't connect and furthermore , all connected users are disconnected after 24 hours .  (connection failed event is triggered)

    clockskew timespan is set to 24 hours .

    2012년 4월 29일 일요일 오전 11:04
  • Upp ...  

    People that couldn't connect before still have the same problem. 

    Furthermore, changing clock skew only causes users that didn't had any problems to get disconnected after 24 hours (clock skew timespan) and they are not able to reconnect until I restart the server .

    Any ideas ?



    • 편집됨 FAndrei 2012년 5월 5일 토요일 오후 5:58
    2012년 5월 5일 토요일 오후 5:40
  • Up....
    2012년 5월 6일 일요일 오후 8:49
  • Up....
    2012년 5월 9일 수요일 오후 4:03
  • Can you at least recommend me another forums where i might get some answers? 
    2012년 5월 17일 목요일 오후 1:00
  • Up....
    2012년 6월 1일 금요일 오후 6:04