Page 1 of 1
Publishing Web Service (PUT/DELETE) 405- Method Not Allowed
Posted: Wed Mar 27, 2024 2:54 am
by Speedlime
Afternoon
Hope someone can help with this. Not sure if it is the API definitions in LANSA or Postman is the issue.
I have setup my path and Operations as per default template generated code.

- 2
- apiPath-OP.png (20.08 KiB) Viewed 25863 times
It is my understanding that when calling this API with the Delete method it is picked up by the verb set to Delete and the API knows what routine to run.

- 2
- apiPath-OP.png (20.08 KiB) Viewed 25863 times
Issue only happens on PUT and DELETE methods (GET and POST work fine) Not sure if I need to configure something else in the definition in the SM or if there is something missing in POSTMAN.
I am hoping someone has had this issue before.
Thanks for the help
Re: Publishing Web Service (PUT/DELETE) 405- Method Not Allowed
Posted: Wed Mar 27, 2024 12:33 pm
by Dino
Look for the webmodules.conf file in the lansa/run/conf folder and confirm that the correct entries for that are there, once. Recompiling should recreate the entries.
Re: Publishing Web Service (PUT/DELETE) 405- Method Not Allowed
Posted: Wed Mar 27, 2024 9:50 pm
by Speedlime
Thanks Dino, Conf file looks good.

- WebModules.png (21.8 KiB) Viewed 25817 times
Interesting thing, I added the debug entry into the delete endpoint, however it does not get to the server module when I call API through Postman. Works fine on the GET and POST endpoints. which leaves me with is the server blocking it or is Postman .
I can write the create update and delete using POST and unique endpoints for each, but that LANSA generated template code implies that the PUT and DELETE methods should work.
Re: Publishing Web Service (PUT/DELETE) 405- Method Not Allowed
Posted: Wed Mar 27, 2024 10:53 pm
by Dino
Those verbs work, I use them in this exercise with v15 150050
viewtopic.php?f=4&t=2617
What version are you using?
Re: Publishing Web Service (PUT/DELETE) 405- Method Not Allowed
Posted: Thu Mar 28, 2024 1:19 am
by Speedlime
I have got it to work by doing this.
Removed Native WebDAVModule from the Modules section in the IIS on the windows web server.
I also added the verbs into the web.config
<verbs>
<add verb="Delete" allowed="true" />
<add verb="Put" allowed="true" />
<add verb="Post" allowed="true" />
<add verb="Get" allowed="true" />
</verbs>
I used CURL a utility in Windows to call API outside of Postman to verify that access was being denied at server level, this was backed up by the logs in the IIS.
Thanks to Stack Overflow the resolution to the issue was applied and worked.
Re: Publishing Web Service (PUT/DELETE) 405- Method Not Allowed
Posted: Thu Mar 28, 2024 1:27 am
by Speedlime
Thanks Dino,
We are on the same version, example is great and close to how I have developed my solution.
Not being a web developer or web admin it is all a bit of a dark art. Thanks for looking. Solution to my issue above.