Hello Everyone,
Am trying to write Console Application using C# to connect to CRM system
String url = "">company.crm.dynamics.com/.../Organization.svc";
try
{
ClientCredentials clientCredentials = new ClientCredentials();
clientCredentials.UserName.UserName = "company@company.com;
clientCredentials.UserName.Password = "CompanyPassword";
// For Dynamics 365 Customer Engagement V9.X, set Security Protocol as TLS12
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
organizationService = (IOrganizationService)new OrganizationServiceProxy(new Uri(url), null, clientCredentials, null);
if (organizationService != null)
{
QueryExpression querExp1 = new QueryExpression()
{
EntityName = "EntityName",
ColumnSet = new ColumnSet("Col1", "Col2")
};
querExp.Criteria.AddCondition("name", ConditionOperator.Equal, value1);
EntityCollection EntityList= organizationService.RetrieveMultiple(querExp); ------Error Throw
}
If i try using the above code am getting "An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail."
if i see FaultException i can see "Authenticate Failure" Error
If i try using the same username and password i can able to Access the CRM System( USING AUTHENTICATION app)
Any Help
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156