web services - WCF Authentication Binding Errors -


i have wcf service consumes sharepoint userprofile service. getting error when try run service on iis.

the authentication schemes configured on host ('integratedwindowsauthentication') not allow configured on binding 'wshttpbinding' ('anonymous'). please ensure securitymode set transport or transportcredentialonly. additionally, may resolved changing authentication schemes application through iis management tool, through servicehost.authentication.authenticationschemes property, in application configuration file @ element, updating clientcredentialtype property on binding, or adjusting authenticationscheme property on httptransportbindingelement.

here 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"> <!-- avoid disclosing metadata information, set value below false , remove metadata endpoint above before deployment --> <servicemetadata httpgetenabled="true"/> <!-- receive exception details in faults debugging purposes, set value below true.  set false before deployment 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 local machine. bindings going wrong ?

i think configuration have used define 1 one of end points wshttpbinding httpbinding1 has security mode set none. seems when have hosted service in iis (so iis acts service host), have used windows authentication. try set security mode transport httpbinding1 or perhaps try change iis authentication anonymous see if works.


Comments