Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get OData DELETE to work?

I've created an OData service (WCF Data Service), and a consumer to test it.

Previously, when I attempted to delete, I got the WebDAV 405 error message, "Method Not Allowed".

So I googled and found:

http://nikhilthaker86.wordpress.com/2010/03/27/issue-hosting-restful-services-on-iis-7/

I followed the instructions and removed the WebDav module from my website (service) in IIS 7.

Now I get this error message instead:

"HTTP Error 500.21 - Internal Server Error

Handler "WebDAV" has a bad module "WebDAVModule" in its module list

Module: IIS Web Core Notification: ExecuteRequestHandler"

If you have a solution that will make this problem go away, I would really appreciate it... otherwise, if you're an IIS guru, and you're thinking "This guy has no idea what he's doing", please point me in the direction of some useful online reading material.

Thanks in advance.

like image 685
Stephen Oberauer Avatar asked Jul 14 '11 17:07

Stephen Oberauer


1 Answers

The WebDAV module will block both the DELETE and PUT (update) verbs for IIS. You can either uninstall WebDAV (recommended) or simply remove it from the Handlers of the site. More details can be found here: http://forums.iis.net/t/1166025.aspx

One way to do this is to add the following remove lines to your site's web.config:

<system.webServer>
    <modules>
        <remove name="WebDAVModule" />
    </modules>
    <handlers>
        <remove name="WebDAV" />
    </handlers>
</system.webServer>
like image 79
TRayburn Avatar answered Sep 25 '22 16:09

TRayburn