Hi,
I was gettng this error when trying to call the crm’s webservice from my asp.net page
The resolution for this is putting the following code in the web.conig
i.e. enable impersonation and deny anonymous access
<authentication mode=”Windows” />
<identity impersonate=”true”/>
<authorization>
<!–Deny all unauthenticated users–>
<deny users=”?”/>
</authorization>
Bye
Discover more from Nishant Rana's Weblog
Subscribe to get the latest posts sent to your email.

Yipeeee…It works. It works better than asp.net forums.
LikeLike
Is the code placed in the web.config of the calling application or the web.config of the webservice?
LikeLike
Web.config of the calling application!!!
LikeLike
Still same error. Grrr…
LikeLike
me two….grrrr….i have been struggling w/this same error. anyone configure with IFD?
LikeLike
this web page have failed to open code 417 or 401 how do i fix this
LikeLike
hi nishant,
truely very useful post.
one more thing i want add here is when we reference webservice to any application we have to set
Webservice.PreAuthenticate = true;
Webservice.Credentials = System.Net.CredentialCache.DefaultCredentials;
to code. other wise it will throw an access denied erro.
thanks
LikeLike
Thanks al lot. This post did the trick for me.
LikeLike
Hi
Please use your credentials instead of using default credentials.
In my case it works fine.
Thanks
LikeLike
Thanks for sharing the information.
If you are valid CRM user it will work for you credential. For other users also it would use your credentials.
LikeLike