/// <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 ");
            }
        }
Exemple #2
0
        /// <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 ");
            }
        }