0

i have Web api WCF RESTfull Server on IIS 7.5 on windows 7 64-bit. i am tring to update one record via PUT method, but i get error 405. i have tried allowing PUT verb in my Web.Config like this:

  <system.webServer>
<modules>
  <remove name="WebDAVModule" />
</modules>
<handlers>
    <remove name="WebDAV" />
    <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
        <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
        <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
        <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified" requireAccess="Execute" preCondition="integratedMode,runtimeVersionv4.0" />
        <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Execute" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
        <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Execute" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
  <remove name="OPTIONSVerbHandler" />
  <remove name="TRACEVerbHandler" />
</handlers>

....

i also disabled WebDAV as you can see, but still getting 405. any one has a suggestion?

Amin Alinezhad
  • 132
  • 1
  • 8
  • Try to inform iis to apply the remove WebDAV in all modules, modifying these lines: I'd a similar issue and with this sintax worked fine. Here is an question about runAllManagedModulesForAllRequests: http://stackoverflow.com/questions/11048863/modules-runallmanagedmodulesforallrequests-true-meaning – Ricardo Pontual Jul 24 '15 at 10:13
  • thanks but that didn't work. – Amin Alinezhad Jul 24 '15 at 10:28
  • Does it happen with all verbs, or can you execute a GET call? I checked out my web.config and it's almost equals your, only difference is that I specified the verbs instead "*", like this: I don't think it's the issue here, but you can try out. – Ricardo Pontual Jul 24 '15 at 10:45
  • I've already tried specific verbs, and GET and POST do work. maybe my problem is more basic. In my IIS i've added my server as a site and set the binding (i can use GET and POST with no problem) I send and receive JSON to my server, should add MIME Type or something?... – Amin Alinezhad Jul 24 '15 at 10:53
  • I never had to configure MIME, but can be a point to check out. I've found in my bookmarks this link that maybe can help, although I think you already tried configure directly on IIS: http://evolutionarydeveloper.blogspot.com.br/2012/07/method-not-allowed-405-on-iis7-website.html – Ricardo Pontual Jul 24 '15 at 13:38

1 Answers1

0

Try removing the webdav module manually from GUI of IIS. 1) Goto the iis. 2) Goto the respective site. 3) Open "Handler Mappings" 4) Select WebDav. Right click on it and delete it.

Note: this will also update your web.config of the web app.

Naveen Kumar G C
  • 1,332
  • 1
  • 10
  • 12