0

I have a problem with message security in WCF. I'm using this tutorial: http://www.codeproject.com/Articles/96028/WCF-Service-with-custom-username-password-authenti I have 2 services. First one, with wshttpbindig is OK. Second one, with wsdualhttpbinding doesn't work. I have an exception when I'm opening proxy after setting Credentials. It looks like I have to set Credentials before I open proxy, but I can't open proxy after set Credentials. I was using only one certificate for both services.

What I should do with this? When I have 2 services do I have to use 2 certificates? If yes how can I do it?

InstanceContext context = new InstanceContext(this);                    
proxy = new CommunicationServiceReference.CommunicationServiceClient(context);

_proxy.ClientCredentials.UserName.UserName = UserSession.Login;
_proxy.ClientCredentials.UserName.Password = UserSession.Password;
_proxy.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = System.ServiceModel.Security.X509CertificateValidationMode.None;
_proxy.Endpoint.Address.Uri.Port.ToString();

_proxy.Open();

EDIT: Is it possible to configure service with wsdualhttpbinding using tutorial i posted above?

Paweł Reszka
  • 1,557
  • 4
  • 20
  • 41
  • Wrap the `_proxy.Open()` call in an exception handler and check what exception (if any) is being raised). – ChrisF Dec 09 '12 at 11:43
  • In client's appconfig I deacreased open timeout time and application threw timeout exception. It's freezes on this line. – Paweł Reszka Dec 09 '12 at 11:45

0 Answers0