I was having a WCF webservice which was supposed to be called via HTTP PUT method. I wrote my PUT method handlers using REST support in WCF ie WebInvoke(method="POST") and was hoping that things will go smooth. But suddenly I started getting 403 forbidden errors from IIS whenever I started making requests to this service using Fiddler.
I ensured that IIS is having “Scripts and Executables” permission on the Virtual Directory which hosted the service and Worker Process user was having full rights on the Folder where service is present. What else does the IIS require?
Finally after doing some research, I found out the PUT requests are served by WebDAV in IIS 6.0. So first thing I did was to enable WebDAV service extension in IIS by setting it to “Allowed” from “Prohibited” as shown below
Next I found that I have to allow PUT verb for the .svc extension in the IIS configuration. This is how it is done.
1.Right click Virutal Directory
2.Goto Properties and click on Configuration button
3.Select .svc extension from the Application Extensions list
4.Append the PUT verb to the list of allowed verbs for this extension as shown in the figure below
That was it and my service was getting hit now.
2 comments:
Thank you, Thank you, Thank You ...
after 3 days of research i have the right explanation.
Just ran into a similar issue where PUT requests to a WCF/REST web service were coming back "Unauthorized". Got around it by setting authentication to None in ASP.Net. Apparently Windows authentication is used by default if nothing is in the web.config file.
Post a Comment