Dear Team,
I am writing a CRM WebService for CRM 2016 Onpremise with IFD Configuration but i am unable to Create the Account with the following code. What was the Problem, please help me on this.
Error: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.
Code:
ClientCredentials credentials = new ClientCredentials();
credentials.UserName.UserName = "domainname\admin";
credentials.UserName.Password = "password";
Uri OrganizationUri = new Uri("location.domain.com/.../Organization.svc");
Uri HomeRealUri = null;
try
{
using (OrganizationServiceProxy serviceProxy = new OrganizationServiceProxy(OrganizationUri, HomeRealUri, credentials, null))
{
IOrganizationService service = (IOrganizationService)serviceProxy;
Entity Account=new Entity("account");
Account["name"]="Contoso";
Guid AccountId=service.Create(Account);
}
}
catch (Exception ex)
{
throw ex;
}