Hola, actualmente estoy haciendo una aplicacion que permita consultar si un CUFE es valida en la DIAN. Estoy usando el siguiente codigo :
const string apiUrl = "https://vpfe-hab.dian.gov.co/WcfDianCustomerServices.svc";
byte[] archivo; //= FileToByteArray(@"c:\temp\ws_f0890900161000000dab3.zip");
EndpointAddress endpointAddress = new EndpointAddress(new Uri(apiUrl));
var securityElement = SecurityBindingElement.CreateUserNameOverTransportBindingElement();
securityElement.AllowInsecureTransport = false;
securityElement.EnableUnsecuredResponse = true;
securityElement.IncludeTimestamp = false;
var encodingElement = new TextMessageEncodingBindingElement(MessageVersion.Soap11, Encoding.UTF8);
var transportElement = new HttpsTransportBindingElement();
var binding = new CustomBinding(securityElement, encodingElement, transportElement);
wsDian.WcfDianCustomerServicesClient Service = new WcfDianCustomerServicesClient(binding, endpointAddress);
Service.ClientCredentials.UserName.UserName = "MiSoftwareID";
Service.ClientCredentials.UserName.Password = "MiContraseñaEnSHA256";
Service.GetStatus(strCuf);
Pero estoy obteniendo el siguiente error :
Error al realizar la solicitud HTTP a https://vpfe-hab.dian.gov.co/WcfDianCustomerServices.svc. Esto puede deberse a que el certificado del servidor no está configurado correctamente en HTTP.SYS en el caso HTTPS. La causa puede ser también una falta de coincidencia del enlace de seguridad entre el cliente y el servidor.
Me pueden ayudar por favor