/// <summary>
        /// Tests a call to User Details Service
        /// </summary>
        static void TestUserDetailsService()
        {
            Console.WriteLine("TestUserDetailsService");
            System.ServiceModel.Channels.Binding binding = FaBindingFactory.GetUsernameTokenOverSslBinding();
            EndpointAddress          endpointAddress     = new EndpointAddress(new Uri("Url to the service"));
            UserDetailsServiceClient client = FaServiceFactory.GetUserDetailsServiceClient(binding, endpointAddress, new NetworkCredential(userName, password));

            UserDetailsResult result = client.findSelfUserDetails();

            if (null != result)
            {
                UserDetails[] userDetails = result.Value;
                if (null != userDetails)
                {
                    foreach (UserDetails userDetail in userDetails)
                    {
                        Console.WriteLine("  Person id = " + userDetail.PersonId);
                    }
                }
            }
            else
            {
                Console.WriteLine("  result null ");
            }
        }
        /// <summary>
        /// Tests a call to Person Service
        /// </summary>
        static void TestPersonService()
        {
            Console.WriteLine("TestPersonService");
            System.ServiceModel.Channels.Binding binding = FaBindingFactory.GetUsernameTokenOverSslBinding();
            EndpointAddress     endpointAddress          = new EndpointAddress(new Uri("Url to the service"));
            PersonServiceClient client = FaServiceFactory.GetPersonServiceClient(binding, endpointAddress, new NetworkCredential(userName, password));

            FusionApplicationAccelerator.PersonServiceReference.FindCriteria findCriteria = new FusionApplicationAccelerator.PersonServiceReference.FindCriteria();
            findCriteria.fetchSize  = 2;
            findCriteria.fetchStart = 0;
            string[] findAttributes = new string[2] {
                "PartyName", "PersonProfile"
            };
            findCriteria.findAttribute = findAttributes;

            FusionApplicationAccelerator.PersonServiceReference.FindControl  findControl = new FusionApplicationAccelerator.PersonServiceReference.FindControl();
            FusionApplicationAccelerator.PersonServiceReference.PersonResult result      = client.findPerson(findCriteria, findControl);
            if (null != result)
            {
                FusionApplicationAccelerator.PersonServiceReference.Person[] persons = result.Value;
                if (null == persons)
                {
                    Console.WriteLine("  Persons is null ");
                }
                else
                {
                    Console.WriteLine("  Persons count = " + persons.Length);
                    foreach (FusionApplicationAccelerator.PersonServiceReference.Person person in persons)
                    {
                        Console.WriteLine("  Person = " + person.PartyName);
                    }
                }
            }
            else
            {
                Console.WriteLine("  result null ");
            }
        }
        /// <summary>
        /// Tests a call to Opportunity Service
        /// </summary>
        static void TestOpportunityService()
        {
            Console.WriteLine("TestOpportunityService");
            System.ServiceModel.Channels.Binding binding      = FaBindingFactory.GetUsernameTokenOverSslBinding();
            EndpointAddress          endpointAddress          = new EndpointAddress(new Uri("Url to the service"));
            OpportunityServiceClient opportunityServiceClient = FaServiceFactory.GetOpportunityServiceClient(binding, endpointAddress, new NetworkCredential(userName, password));

            FusionApplicationAccelerator.OpportunityServiceReference.FindCriteria findCriteria = new FusionApplicationAccelerator.OpportunityServiceReference.FindCriteria();
            findCriteria.fetchSize  = 2;
            findCriteria.fetchStart = 0;

            string[] findAttributes = new string[2] {
                "OptyId", "CustomerAccountId"
            };
            findCriteria.findAttribute = findAttributes;

            FusionApplicationAccelerator.OpportunityServiceReference.FindControl findControl = new FusionApplicationAccelerator.OpportunityServiceReference.FindControl();
            Opportunity[] result = opportunityServiceClient.findOpportunity(findCriteria, findControl);
            if (null != result && result.Length > 0)
            {
                foreach (Opportunity opportunity in result)
                {
                    Console.WriteLine("  OptyId = " + opportunity.OptyId);
                }
            }
            else
            {
                if (null == result)
                {
                    Console.WriteLine("  result null ");
                }
                else
                {
                    Console.WriteLine("  result empty ");
                }
            }
        }