I am facing below issue while calling _service.update(entityObj);
Unhandled Exception: System.ServiceModel.Security.MessageSecurityException: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail. ---> System.ServiceModel.FaultException: The security context token is expired or is not valid. The message was not processed. --- End of inner exception stack trace ---
Code:
private static void RefreshService()
{
try
{
string orgServiceUrl = Default.CRMServiceUrl;
Uri organizationUri = new Uri(orgServiceUrl);
Uri homeRealmUri = null;
ClientCredentials credentials = new ClientCredentials();
credentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials;
OrganizationServiceProxy orgProxy = new OrganizationServiceProxy(organizationUri, homeRealmUri, credentials, null);
orgProxy.Timeout = new TimeSpan(1, 0, 0);
_service = (IOrganizationService)orgProxy;
}
catch (Exception)
{
throw;
}
}
*This post is locked for comments