void IServicioSunat.Inicializar(ParametrosConexion parametros) { System.Net.ServicePointManager.UseNagleAlgorithm = true; System.Net.ServicePointManager.Expect100Continue = false; System.Net.ServicePointManager.CheckCertificateRevocationList = true; _proxyDocumentos = new Documentos.billServiceClient("ServicioSunat", parametros.EndPointUrl); // Agregamos el behavior configurado para soportar WS-Security. //var behavior = new PasswordDigestBehavior(string.Concat(parametros.Ruc, parametros.UserName), parametros.Password); var behavior = new PasswordDigestBehavior(string.Concat("20519069262", parametros.UserName), parametros.Password); _proxyDocumentos.Endpoint.EndpointBehaviors.Add(behavior); }
void IServicioSunat.Inicializar(ParametrosConexion parametros) { System.Net.ServicePointManager.UseNagleAlgorithm = true; System.Net.ServicePointManager.Expect100Continue = false; System.Net.ServicePointManager.CheckCertificateRevocationList = true; _proxyDocumentos = new billServiceClient(CreateBinding(), new EndpointAddress(parametros.EndPointUrl)) { ClientCredentials = { UserName = { UserName = parametros.Ruc + parametros.UserName, Password = parametros.Password } } }; }