IT Portal CompaniesGet

Code to get a list of Company names in IT Portal

C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using System.ServiceModel;

using DemoItPortal.ItPortalService;

namespace DemoItPortal
{
    public class CompaniesGet
    {
        /*
         * Instructions
         * 
         * 1. Disable Authentication and SSL.
         * 2. Add a Service Reference to the ITPortal Service, name the reference ITPortalService.
         *    The uri will generally be http://localhost:11111/ITPortal.
         * 3. With new releases you may have to update the Service Reference.
         */
        public static void Main()
        {
            Console.WriteLine("CompaniesGet: Start");

            ItPortalClient client = new ItPortalClient();
            (client.ChannelFactory.Endpoint.Binding as BasicHttpBinding).MaxReceivedMessageSize = int.MaxValue;
            (client.ChannelFactory.Endpoint.Binding as BasicHttpBinding).MaxBufferSize = int.MaxValue;
            (client.ChannelFactory.Endpoint.Binding as BasicHttpBinding).ReceiveTimeout = new TimeSpan(0, 10, 0);

            CompaniesGetRequestQuery requestQuery = new CompaniesGetRequestQuery();

            CompaniesGetResponseBody responseBody = client.CompaniesGet(requestQuery);

            foreach (CompaniesGetResponseBody_result result in responseBody.data.results)
            {
                Console.WriteLine(result.name);
            }
            
            Console.WriteLine("CompaniesGet: Finished");
            Console.ReadKey();
        }
    }
}