Writing REST Server?

Is there an example of a rest server?
I want to know how to write one in Xojo.
I began with a simple web app and assumed I could simply parse the url parameters…
but an example would be nice.

You should look at the HandleSpecialUrl and HandleURL events. They’ll do a lot of the heavy lifting for you so you can focus on your api.

HandleSpecialUrl is perfect for this, looking at the passed in WebRequest.Path and WebRequest.Method will get you a long way.

Please understand that HandleURL gives you much more flexibility about the root url, so if you actually wanted it to be /myAPI, you could do that too.

Thanks everyone. wadda bout wadl files?

WSDL files are for SOAP which is just a protocol that may be implemented as part of a RESTful service. If you want information about implementing a SOAP Webservice then that is what you should have asked about.

I understood WSDL was for SOAP but that WADL was for REST…

I am an idiot. Sorry I went into that looking at it as a typo and I know better. Not enough coffee is my excuse and I’m sticking to it.

Xojo will not generate WADL files for you but it should not be a problem for you to generate it in HandleURL. It is just another request of the server.

:slight_smile: I need coffee too… :slight_smile:
I laughed my a$$ off when I heard of WSDL / WADL…

Perhaps a better question is… Is the only purpose of the WSDL file to document the interface to those who might want to use it?

That is pretty much it in a nutshell.

It makes things much easier for development environments designed to consume them.

Does Xojo Consume them?
It seems to me that as the author of the server i would want to test it and do a client as well…

Xojo neither creates nor consumes them.