add env vars

This commit is contained in:
vchikalkin 2021-06-07 12:14:44 +03:00
parent e8aaf57e10
commit 255d7a3957

View File

@ -1,4 +1,5 @@
using LeasingTrial;
using System;
using System.ServiceModel;
namespace _1C.Gateway.Managers
@ -9,6 +10,12 @@ namespace _1C.Gateway.Managers
public LeasingTrialManager()
{
var url = Environment.GetEnvironmentVariable("1C_URL_LEASING_TRIAL");
var username = Environment.GetEnvironmentVariable("1C_USERNAME");
var password = Environment.GetEnvironmentVariable("1C_PASSWORD");
var address = new EndpointAddress(url);
var binding = new BasicHttpBinding
{
MaxReceivedMessageSize = int.MaxValue,
@ -18,12 +25,9 @@ namespace _1C.Gateway.Managers
Transport = {ClientCredentialType = HttpClientCredentialType.Basic}
}
};
var address = new EndpointAddress("http://1c-dev.evoleasing.ru/1c_leasing_trial/ws/wsmd_exch.1cws");
_mdExchPortTypeClient = new md_exchPortTypeClient(binding, address);
_mdExchPortTypeClient.ClientCredentials.UserName.UserName = "ws";
_mdExchPortTypeClient.ClientCredentials.UserName.Password = "123";
_mdExchPortTypeClient.ClientCredentials.UserName.UserName = username;
_mdExchPortTypeClient.ClientCredentials.UserName.Password = password;
}
public TransTaxResponse TransTax(TransTaxRequest transTaxRequest)