Esempio n. 1
0
        static void Main(string[] args)
        {
            DoLogin();

            PolicyServiceClient         client   = new PolicyServiceClient();
            ContextInformationInspector behavior = new ContextInformationInspector();

            client.Endpoint.Behaviors.Add((IEndpointBehavior)behavior);

            SST.PortalProd.AdmCartera.Common.Entities.Currency[] currencies = client.GetCurrencyList();
        }
Esempio n. 2
0
        public static void DoLogin()
        {
            UserPassCredential credential = new UserPassCredential();

            credential.userName = "******";
            credential.password = "******";

            AuthenticationServiceClient client = new AuthenticationServiceClient();

            try
            {
                ContextInformationInspector behavior = new ContextInformationInspector();
                client.Endpoint.Behaviors.Add((IEndpointBehavior)behavior);

                AuthenticatedToken token = client.LogInUserPass(credential);
                TokenManager.Instance.LoadToken(token);
                client.Close();
            }
            catch (Exception ex)
            {
                client.Abort();
            }
        }