IT Portal Create Contact
An example of creating a contact in IT Portal
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using DemoItPortal.ItPortalService;
namespace DemoItPortal
{
class ContactsPost
{
public static void Main()
{
Console.WriteLine("ContactsPost: 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);
ContactsPostRequestBody requestBody = new ContactsPostRequestBody
{
company = new ContactsPostRequestBody_company
{
name = "Test Company",
},
firstName = "TestName",
type = new ContactsPostRequestBody_type
{
name = "Users"
}
};
client.ContactsPost(requestBody);
Console.WriteLine("ContactsPost: Finished");
Console.ReadKey();
}
}
}