Example #1
0
        private async Task <ScreenSoapClient> GetAuthenticatedClient(string siteUrl, string username, string password)
        {
            var client = new ScreenSoapClient(ServiceHelpers.GetDefaultBinding(siteUrl), ServiceHelpers.GetServiceAddress(siteUrl, "EP203000"));
            await client.LoginAsync(username, password);

            return(client);
        }
        static async Task <ScreenSoap> LoginAsync()
        {
            BasicHttpBinding binding = new BasicHttpBinding();

            binding.Name                   = "ScreenSoap";
            binding.AllowCookies           = true;
            binding.MaxReceivedMessageSize = 2147483647;
            binding.SendTimeout            = new TimeSpan(0, 5, 0);
            binding.ReceiveTimeout         = new TimeSpan(0, 5, 0);

            EndpointAddress address = new EndpointAddress(AcumaticaUri + "/Soap/.asmx");

            if (address.Uri.Scheme == Uri.UriSchemeHttps)
            {
                binding.Security.Mode = BasicHttpSecurityMode.Transport;
            }

            var screen = new ScreenSoapClient(binding, address);

            await screen.LoginAsync(Username + "@" + Tenant, Password);

            await screen.SetLocaleNameAsync("en-US");

            return(screen);
        }