views:

36

answers:

1

At the root of your Restlet web service, something like this:

http://localhost:8080/foobarwebservice/

My page is blank...

I suspect that when a user/programmer wants to find out resources available on the webservice and how they should be accessed e.g. url format and parameters to pass. Then it should be here - a REST form of a WSDL I think??? is it called WADL

What do you do? Is there a way of auto generating this for the root resource based on the resources you are publishing? I don't think that having a blank page is right. Am I even making sense to anyone???? :)

Please bear with me as it's been over a year since I looked at all this stuff.

+1  A: 

Restlet doesn't really enforce any conventions, just general REST principles, and the HTTP spec.

So if you want to have a resource at that URL, and make a representation of that resource available, that's cool, but it's up to you. You need to implement it and wire it up just like any other resource at any other URL.

That said, Restlet does include a WADL extension which can automatically generate a WADL representation of your application and make it available to clients as a representation of a resource — typically the "base resource" of the app, typically using the OPTIONS method, but I believe that's all customizable. Note that I wrote "automatically", but the extension relies on you subclassing certain classes when implementing your app, such as WadlApplication, and implementing certain methods, such as getApplicationInfo(). That's pretty easy to do however.

There's a good introduction to the WADL extension here.

Personally, I generally author a WADL document by hand, and make it available using a FileRepresentation. I also sometimes make it available in HTML, using a XSLT to transform the WADL to HTML. That's just me, though.

HTH!

Avi Flax
Hey thanks for that - kind of given up hope on anyone answering. But it's interesting to hear other people's implementations on Restlet and what you have said has confirmed many suspicions. I had tried that subclassing thing around 18 months ago, I got inot it but then left it as it seemed a bit wacky but I guess it's the way to go in this case. Cheers for your help mate.
Vidar