Web service - returning 405 Method Not Allowed

Using Servoy to administrate the content of your website? Discuss all webrelated Servoy topics on this forum!

Web service - returning 405 Method Not Allowed

Postby AlanBourke » Mon Nov 14, 2011 3:07 pm

Here's my ws_create() function:

Code: Select all
function ws_create(content)
{
   //application.output("param1:" + content);
   return true;
}


It doesn't do much!

What I'm sending in the HTTP BODY is the string:

{"parm1": "hello","parm2": "world"}


However it just returns a HTTP 405 all the time.
-------------------------------------------------------------------------------------------
Servoy SAN Developer
User avatar
AlanBourke
 
Posts: 198
Joined: Tue Aug 02, 2011 3:32 pm
Location: Dublin, Ireland

Re: Web service - returning 405 Method Not Allowed

Postby AlanBourke » Mon Nov 14, 2011 4:48 pm

Seems I needed to return null or something other than true!

Gah.
-------------------------------------------------------------------------------------------
Servoy SAN Developer
User avatar
AlanBourke
 
Posts: 198
Joined: Tue Aug 02, 2011 3:32 pm
Location: Dublin, Ireland

Re: Web service - returning 405 Method Not Allowed

Postby rgansevles » Tue Nov 15, 2011 11:32 am

Alan,

You get the 405 Method Not Allowed when Servoy cannot find the ws_xxx method in your form.

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1927
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL

Re: Web service - returning 405 Method Not Allowed

Postby AlanBourke » Wed Nov 16, 2011 12:17 pm

Rob

Thanks ...

Not in this case though - it was literally just returning 'true' that caused the problem. If I sent in a HTTP body that it didn't recognise as XML or JSON, it would give the expected 'unsupported media type' error (or whatever the wording is), so it was definitely finding ws_create().
-------------------------------------------------------------------------------------------
Servoy SAN Developer
User avatar
AlanBourke
 
Posts: 198
Joined: Tue Aug 02, 2011 3:32 pm
Location: Dublin, Ireland


Return to Web Development

Who is online

Users browsing this forum: No registered users and 5 guests