public static IEnumerable GetDebtsByServices(string accountID, DateTime b_period, DateTime e_period)
    {
        int i_owner = 1032; // код поставщика, выдается администратором системы

        var    client = new ServiceIntegratorClient(new ServiceIntegrator(ServiceUrl.Url));
        string ticket = client.GetAuthorizationTicket(IdentityCredential.User, IdentityCredential.Password);

        var factory = new GetTRICDebtsByServicesFactory(client);

        var xmlRoot = new XmlBuilder("Accounts");

        var accountElement = new XmlBuilder("Account");

        accountElement.AddAttribute("i_lschet", accountID);
        string b_period_str = b_period.ToString("dd.MM.yyyy");
        string e_period_str = e_period.ToString("dd.MM.yyyy");

        accountElement.AddAttribute("b_period", b_period_str);
        accountElement.AddAttribute("e_period", e_period_str);

        xmlRoot.AddElement(accountElement.Build());

        string xmlAccounts = xmlRoot.Build().ToString();

        var response = factory.Make(new object[] { i_owner, xmlAccounts }, ticket);

        return(response.Tables[0].Rows);
    }
        public void Setup()
        {
            string user     = IdentityCredential.User;
            string password = IdentityCredential.Password;

            this.columnNamesInResponse  = "[i_lschet],[period],";
            this.columnNamesInResponse += "[sum_nach_11],[sum_odn_11],[sum_opl_11],";
            this.columnNamesInResponse += "[sum_nach_8],[sum_odn_8],[sum_opl_8],";
            this.columnNamesInResponse += "[sum_nach_10],[sum_odn_10],[sum_opl_10],";
            this.columnNamesInResponse += "[sum_nach_9],[sum_odn_9],[sum_opl_9],";
            this.columnNamesInResponse += "[sum_total_nach],[sum_total_opl],[sum_total],[orderby]";

            WSHttpBinding binding = new WSHttpBinding();

            binding.MaxReceivedMessageSize = 2147483647;
            binding.Security.Mode          = SecurityMode.Transport;
            binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;

            this.client = ServiceIntegratorClientFactory.Make(WebServiceUrl.Url);

            this.ticket = this.client.GetAuthorizationTicket(user, password);

            this.factory = new GetTRICDebtsByServicesFactory(client);
        }