Reputation: 3070
I have a WCF Service which also consumes a sharepoint userprofile service. I am getting this error when i try to run the service on IIS.
The authentication schemes configured on the host ('IntegratedWindowsAuthentication') do not allow those configured on the binding 'WSHttpBinding' ('Anonymous'). Please ensure that the SecurityMode is set to Transport or TransportCredentialOnly. Additionally, this may be resolved by changing the authentication schemes for this application through the IIS management tool, through the ServiceHost.Authentication.AuthenticationSchemes property, in the application configuration file at the element, by updating the ClientCredentialType property on the binding, or by adjusting the AuthenticationScheme property on the HttpTransportBindingElement.
Here is my web.config
<bindings>
<basicHttpBinding>
<binding name="UserProfileServiceSoap" 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" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
<wsHttpBinding>
<binding name="HttpBinding1" maxReceivedMessageSize="2147483647" receiveTimeout="10:00:00" openTimeout="10:00:00"
sendTimeout="10:00:00" closeTimeout="10:00:00" bypassProxyOnLocal="false" transactionFlow="false"
hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288000" allowCookies="false">
<security mode="None"/>
</binding>
<binding name="WSHttpBinding_MessageSecurity" maxReceivedMessageSize="2147483647" receiveTimeout="10:00:00"
openTimeout="10:00:00" sendTimeout="10:00:00" closeTimeout="10:00:00" bypassProxyOnLocal="false"
transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288000" allowCookies="false">
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="">
<extendedProtectionPolicy policyEnforcement="Never"/>
</transport>
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
services>
<service name="UserProfileWcf.UserProfileService" behaviorConfiguration="UserProfileWcf.UserProfileServiceBehavior">
<!-- Service Endpoints -->
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="HttpBinding1" contract="UserProfileWcf.ServiceContract.IUserProfileService" name="UserProfileServiceEndpoint">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="UserProfileWcf.UserProfileServiceBehavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true"/>
<dataContractSerializer maxItemsInObjectGraph="65536000"/>
<serviceThrottling maxConcurrentSessions="2147483647"/>
</behavior>
</serviceBehaviors>
</behaviors>
<client>
<endpoint address="http://xyz/_vti_bin/userprofileservice.asmx"
binding="basicHttpBinding" bindingConfiguration="UserProfileServiceSoap"
contract="SharePointUserProfileService.UserProfileServiceSoap"
name="UserProfileServiceSoap" />
</client>
The same configuration works fine on my local machine. Where are my bindings going wrong ?
Upvotes: 0
Views: 14054
Reputation: 1695
I think the configuration that you have used to define one for one of the end points with wsHttpBinding is HttpBinding1 which has security mode set to none. It seems when you have hosted the service in IIS (so IIS acts as service host), you have used Windows Authentication. Try to set security mode to Transport for HttpBinding1 or perhaps try to change IIS authentication to anonymous to see if it works.
Upvotes: 1