web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Issue when invoking SOAP WCF web service from plugin Dynamics CRM 365

(0) ShareShare
ReportReport
Posted on by 30

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

21_2D00_03_2D00_2018-11_2D00_01_2D00_53.png


Thanks in advance

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
  • srknhcgl Profile Picture
    2 on at
    you are setting basicHttpsBinding/clientCredentialType="UserName" and binding.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.Windows;
    basic authentication and windows authentication are two different things.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans