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(); }
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(); } }