/// <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 ");
                }
            }
        }
Ejemplo n.º 2
0
        /// <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 ");
                }
            }
        }