Hi.
Someone knows what's wrong with this picture in a Dynamics Nav 2009 R2 web-service test scenario.
Visual studio 2010 Service reference projekt has app.config that looks like this.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="TestWS_Binding" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Ntlm"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="allowDelegation">
<clientCredentials>
<windows allowedImpersonationLevel="Delegation"
allowNtlm="true"/>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
<client>
<endpoint address="http://10.0.0.144:7047/DynamicsNAV/WS/CRONUS%20Danmark%20A/S/Codeunit/TestWS"
binding="basicHttpBinding" bindingConfiguration="TestWS_Binding"
behaviorConfiguration="allowDelegation"
contract="WebServiceTest.TestWS_Port" name="TestWS_Port" />
</client>
</system.serviceModel>
</configuration>
The customsettings.config of the service has
<add key="WebServicesUseNTLMAuthentication" value="true"></add>
Everything is running on local machine.
SQL server, Web server Service runs under system account.
When this line
<transport clientCredentialType="Ntlm"/>
in app.config says "Windows" things are working.
When it says "Ntlm" like above this message is returned:
"The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The a
uthentication header received from the server was 'Negotiate'."
Question:
I obviously did something wrong but how on earth can the error message say
"received from the server was 'Negotiate'.""
when "Negoatiate" should not be an option in the webservice part of the equation due to the line
<add key="WebServicesUseNTLMAuthentication" value="true"></add>
in the "customsettings.config" and the comment in the file says "true: Use NTLM only".
Pointers highly appreciated.
Best regards.
AO