IIS 7.5, Web Service and HTTP 405 error

32,845

Solution 1

After hours of struggling, this is final solution that helped me (tested from fiddler):

  1. On IIS 7.5 -> YourWebsite -> Handler Mappings
  2. Choose "Add module mapping" option on the right side of the panel
  3. In "Request path" field enter *.wsdl
  4. In "Module" field enter "ProtocolSupportModule"
  5. Click on "Request restrictions" and go to Verbs tab
  6. Enter POST verb
  7. Save changes

End voila, fiddler no longer answers with 405 but with happy 200.

Solution 2

The listed answer didn't work for me, but I was able to fix the problem by running

"%WINDIR%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -r

This re-registered the handler mapping for *.svc

Solution 3

Goto IIS Manager -> Select Web Site -> Handler Mapping -> Select the handler -> right-click and select edit -> Request restrictions -> verbs tab

Change the value there.

Depending on your extension, it could be a different handler.

Solution 4

For people who bump into this page but are making requests to a web application with aspx pages, instead of services, there's one important thing to note.

If you make a fiddler http post request to http://localhost/MyApplication, it will throw status 405. But if you specify http://localhost/MyApplication/Default.aspx instead, it will respond correctly (with status 200)

Hope this helps. I've been looking in the wrong place for an hour, debugging handlers, modules, webdav settings, http verbs, etc.

Share:
32,845
buhtla
Author by

buhtla

Updated on February 09, 2020

Comments

  • buhtla
    buhtla about 4 years

    I have a web service which I host on my machine. I use Windows 7 and IIS 7.5.

    Problem: When the client tries to consume the web service, he/she gets a HTTP 405 error.

    In the log file of IIS, I can see that this is refused because POST verb is not allowed.

    Question: How can I allow POST verb for those requests?
    Do I have to add mapping of the WSDL file? And if I do, how do I have to configure this mapping? I have checked, and in existing mappings I have nothing for WSDL extension.

    Is there maybe another thing to setup on IIS to allow those requests?

    Web service is built using WCF.