Hi,
IOrganizationService _service = null;
try
{
ClientCredentials clientCredentials = new ClientCredentials();
clientCredentials.UserName.UserName = "<UserName>@<OrgName>.onmicrosoft.com";
clientCredentials.UserName.Password = "Password;
_service! = (IOrganizationService)new OrganizationServiceProxy(new Uri("https://<OrgName>.api.crm8.dynamics.com/XRMServices/2011/Organization.svc"),
null, clientCredentials, null);
if (_service!= null)
{
Guid userid = ((WhoAmIResponse)_service.Execute(new WhoAmIRequest())).UserId;
if (userid != Guid.Empty)
{
Console.WriteLine("Connection Successful!...");
}
}
else
{
Console.WriteLine("Failed to Established Connection!!!");
}
}
catch (Exception ex)
{
Console.WriteLine("Exception caught - " + ex.Message);
}
Console.ReadKey();
I tried this code to connect to CRM but i'm unable to connect to that and getting this exception.
"An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail"
Can anyone help me in finding out the reason.
Thank you,
I'll try using this
Hello,
Don't use this approach. It won't work because it's deprecated. My recommendation - start using XrmTooling:
docs.microsoft.com/.../use-xrm-tooling-execute-actions
docs.microsoft.com/.../use-connection-strings-xrm-tooling-connect
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,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156