Пример #1
0
        public static BEWSActualizaCIPResponseMod1 ActualizarCIPMod1(BEWSActualizaCIPRequestMod1 request)
        {
            BEWSActualizaCIPResponseMod1 response = new BEWSActualizaCIPResponseMod1();

            using (var proxy = new WSCrypto())
            {
                proxy.Credentials       = System.Net.CredentialCache.DefaultNetworkCredentials;
                proxy.Proxy             = WebProxy.GetDefaultProxy();
                proxy.Proxy.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
                request.CIP             = request.CIP.Trim();
                request.Firma           = proxy.Signer(request.CIP, ByteUtil.FileToByteArray(PrivatePath));
                request.CIP             = proxy.EncryptText(request.CIP, ByteUtil.FileToByteArray(PublicPathContraparte));
                using (var proxyCIP = new Service())
                {
                    response = proxyCIP.ActualizarCIPMod1(request);
                    //if (response != null)
                    //    if (!String.IsNullOrEmpty(response.XML))
                    //        response.XML = proxy.DecryptText(response.XML, ByteUtil.FileToByteArray(PrivatePath));
                }
            }
            return(response);
        }