PDA

View Full Version : 405 - HTTP verb used to access this page is not allowed.



Clive Richmond
11-Sep-2020, 04:42 AM
Hi,

Today I moved my working RESTful services locally onto a production server for further testing. All my verbs, GET, POST and PATCH work except DELETE.

I've combed everywhere, that I can think of, to see if there is something I've missed. The .WSO has all the verbs defined. I have even tried some others - HEAD - just to pass the time. Server has been rebooted but still no delete.

The message returned to POSTMAN is:


<fieldset>

<h2>405 - HTTP verb used to access this page is not allowed.</h2>
<h3>The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to
attempt access.</h3>
</fieldset>





As far as I can tell the module request restrictions are correct i.e. DELETE has been defined as acceptable.

13951

And the web.config also looks correct.


<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<location path="rest">
<system.webServer>
<dataflexHttpModule application="TriumphWS-6.2" enabled="true" object="oTriumphAPIs" verbs="GET,POST,DELETE,PATCH" errortype="0"></dataflexHttpModule>
</system.webServer>
</location>
<system.webServer>
<handlers>
<remove name="DataFlex 19.1 Web Services 32bit" />
<remove name="DataFlex 19.1 Web Services 64bit" />
<add name="DataFlex 19.1 Web Services 64bit" path="*.wso" verb="GET,POST,DELETE,PATCH" modules="IsapiModule" scriptProcessor="C:\Data\DataFlex 19.1\Bin64\waswsvc.dll" resourceType="Unspecified" requireAccess="Script" preCondition="bitness64" />
<add name="DataFlex 19.1 Web Services 32bit" path="*.wso" verb="GET,POST,DELETE,PATCH" modules="IsapiModule" scriptProcessor="C:\Data\DataFlex 19.1\Bin\waswsvc.dll" resourceType="Unspecified" requireAccess="Script" preCondition="bitness32" />
</handlers>
</system.webServer>
</configuration>


Is there anything else?

starzen
11-Sep-2020, 04:45 AM
Set psVerbs to "..."

in your WebHttpHandler?

Mike Peat
11-Sep-2020, 05:37 AM
Clive

I'm really not sure what is going on here, but just possibly this Stack Overflow article might point to a possible issue and resolution of it: https://stackoverflow.com/questions/6147181/405-method-not-allowed-in-iis7-5-for-put-method.

Mike

starzen
11-Sep-2020, 05:50 AM
tested this and this will not generate a 405 but rather a 404 so the issue is probably in IIS. Have you tried using IIS failed request tracing?

Clive Richmond
12-Sep-2020, 02:01 AM
Hi Mike,


I'm really not sure what is going on here, but just possibly this Stack Overflow article might point to a possible issue and resolution of it: https://stackoverflow.com/questions/6147181/405-method-not-allowed-in-iis7-5-for-put-method.

You're a goldmine of information :D. Many thanks.

The article mentions WebDAV trying to handle the requests. Removing the module using the lines suggested in the article addressed the issue. The lines I added to the website's web.config were as follows.:


<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<modules>
<remove name="WebDAVModule" />
</modules>
<handlers>
<remove name="WebDAV" />
</handlers>
<defaultDocument>
<files>
<clear />
<add value="index.html" />
<add value="Default.htm" />
<add value="Default.asp" />
<add value="index.htm" />
<add value="iisstart.htm" />
<add value="default.aspx" />
</files>
</defaultDocument>
</system.webServer>
</configuration>

Clive Richmond
12-Sep-2020, 02:03 AM
Hi Mike,

Many thanks for your replies. Dropping WebDAV in the article Mike pointed me to has addressed the issue.