Hi,
Iam trying to integrate CRM with My Custom Application. This code is working in CRM4.0 and 2011. Now Iam getting error in CRM2013 integration when calling Execute method from MetdataService.
static void Main(string[] args)
{
try
{
RetrieveEntityRequest entityRequest = new RetrieveEntityRequest();
entityRequest.LogicalName = EntityName.contact.ToString();
entityRequest.RetrieveAsIfPublished = false;
entityRequest.EntityItems = EntityItems.All;
ConsoleApplication1.metdataservice.CrmAuthenticationToken token1 = new ConsoleApplication1.metdataservice.CrmAuthenticationToken();
token1.AuthenticationType = 0;
token1.OrganizationName = "CRM13";
MetadataService serv = new MetadataService();
serv.CrmAuthenticationTokenValue = token1;
serv.UseDefaultCredentials = false;
serv.Credentials = new System.Net.NetworkCredential("username", "password", "domain");
RetrieveEntityResponse entityResponse = (RetrieveEntityResponse)serv.Execute(entityRequest);
//serv.ExecuteAsync(entityRequest);
Console.WriteLine("Working");
}
catch (Exception error)
{
Console.WriteLine(error.Message);
}
Thanks
vijeesh