iis 7 - Sharepoint 2010 Custom Web Service - The HTTP request is unauthorized with client authentication scheme 'Ntlm' -


i have 2 custom web services built on top of sharepoint. switched servers , upgraded site 2008 2010 on weekend. following errors on each web service when viewed through .net web service wrapper.

system.servicemodel.security.messagesecurityexception: http request unauthorized client authentication scheme 'ntlm'. authentication header received server 'ntlm'. ---> system.net.webexception: remote server returned error: (401)  

and

system.net.webexception: request failed http status 401: unauthorized. 

the web services have dlls live in gac , asmx files live in layouts hive folder. these worked fine before upgrade/server move.

what think happening default windows credentials aren't being passed service. web service calls sharepoint web services list content.

here's example of 1 of calls returns 401:

<webmethod()> _ public function testgetuserinfo() string     dim userservice new sharepointuser.usergroup     userservice.credentials = system.net.credentialcache.defaultcredentials      dim userinfoxml xmlnode = userservice.getuserinfo(user.identity.name)      return userinfoxml.childnodes(0).attributes("name").value end function 

this call goes against: http://{domainname}/_vti_bin/lists.asmx?wsdl

i've verified user.identity.name returns correct logged in user info. think it's system.net.credentialcahche.defaultcredentials that's not working. i've tried .defaultnetworkcredentials no luck.

this have in web.config:

  <system.servicemodel> <servicehostingenvironment aspnetcompatibilityenabled="true" /> <bindings>   <basichttpbinding>     <binding name="projectbasichttpconf" closetimeout="00:01:00" opentimeout="00:01:00" receivetimeout="00:10:00" sendtimeout="00:01:00" allowcookies="true" maxbuffersize="4194304" maxreceivedmessagesize="500000000" messageencoding="text" transfermode="streamedresponse">       <security mode="transportcredentialonly">         <transport clientcredentialtype="windows" proxycredentialtype="none" realm="" />         <message clientcredentialtype="username" algorithmsuite="default" />       </security>     </binding>     <binding name="basichttpbindingwithwindowsauthentication">       <security mode="transportcredentialonly">         <transport clientcredentialtype="windows" proxycredentialtype="none" />         <message clientcredentialtype="username" algorithmsuite="default" />       </security>     </binding>     <binding name="spfilesaccessservicesoap" 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="windows" proxycredentialtype="none" realm="" />         <message clientcredentialtype="username" algorithmsuite="default" />       </security>     </binding>   </basichttpbinding> </bindings> <behaviors>   <endpointbehaviors>     <behavior name="clientendpointbehavior">       <clientcredentials>         <windows allowedimpersonationlevel="impersonation" />       </clientcredentials>     </behavior>   </endpointbehaviors> </behaviors> 

under system.web:

<authentication mode="windows" /> <identity impersonate="true" /> 

i've gone , forth anonymous authentication no luck.

in iis have windows authentication enabled , ntlm provider.

any ideas on how fix this? reading.

-nate

i never figured out. did workaround called microsoft.sharepoint namespace stuff directly instead of calling web service. bypassed security issues.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -