Hello
I get this message bellow infrequently when I invoke web service in crm plugin after creating or updating record.
Unexpected exception from plug-in (Execute): System.ServiceModel.Security.MessageSecurityException: The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate,NTLM'
this is my web server binding configuration
<bindings> <basicHttpsBinding> <binding> <security mode="Transport"> <transport clientCredentialType="Windows"> <extendedProtectionPolicy policyEnforcement="Always"></extendedProtectionPolicy> </transport> <message clientCredentialType="UserName"/> </security> </binding> </basicHttpsBinding> </bindings>
And I called it from plugin :
BasicHttpsBinding binding = new BasicHttpsBinding(); binding.Name = "BasicHttpsBinding_IServiceIntegration"; binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows; binding.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.Windows; binding.Security.Mode = BasicHttpsSecurityMode.Transport; EndpointAddress myEndpoint = new EndpointAddress("https://myurlwebservice/ServiceIntegration.svc"); ServiceClient = new ServiceIntegrationClient(binding, myEndpoint); ServiceClient.ClientCredentials.Windows.ClientCredential.Domain = "domain"; ServiceClient.ClientCredentials.Windows.ClientCredential.UserName = "user name"; ServiceClient.ClientCredentials.Windows.ClientCredential.Password = "password";
The IIS server configuration
Thanks in advance
*This post is locked for comments