Xiabili
Xiabili

Reputation: 486

Do you need an Interface by RESTful webservice?

I'm busing to build a simple RESTful webservice for my thesis, maybe this is a dome quetion but I just want to know, do you really need an interface (WADL or WSDL) to create clients? Likely by SOAP webservice! Thanks

Upvotes: 1

Views: 1104

Answers (4)

Bruno
Bruno

Reputation: 122649

In the REST model, the "interface" will be the hypermedia (see http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven).

For example, on a web site, the interface will be the web-page (HTML) itself.

WADL is an attempt to provide something similar for machine consumption. There could also be other forms of interfaces: XForms, RDF (and RDF forms). In some cases, SOAP may also arguably be suitable (e.g. combined with WSRF).

Upvotes: 0

Nick Daniels
Nick Daniels

Reputation: 922

SOAP: Yes. REST: No. You can always use something like RestSharp to consume them.

To use SOAP your client needs to understand SOAP and what objects it's receiving via SOAP so WSDL is required.

Upvotes: 0

carlosfigueira
carlosfigueira

Reputation: 87228

No, you don't. Even with SOAP you don't really need an interface - you can just ship a "client SDK" which knows how to talk to your service, but there are a few standards (WSDL and MEX) for declaring an interface in SOAP.

With REST services, since WADL isn't widely adopted, the most common scenario is that you'd present the users of your service with a human-readable set of examples of how to use your service.

Upvotes: 1

Matt Ball
Matt Ball

Reputation: 359786

A SOAP web service is typically not RESTful. If you're providing a SOAP API: yes, you need to provide a WSDL file. This enables consumers of the web service to generate consumer code from the WSDL.

Whether or not WADL is really needed for a RESTful service is less clear-cut:

You do need to document the service in some way if anyone is going to be able to use it. Personally, I think there are better ways to document a RESTful API than WADL.

Upvotes: 1

Related Questions