开发者

Do you need an Interface by RESTful webservice?

I'm busing to build a simple RESTful webservice for my thesis, maybe开发者_StackOverflow社区 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


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:

  • What is the reason for using wadl?
  • WADL/WSDL 2.0 for RESTful services in Ruby on Rails
  • Why the slow WADL uptake?

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.


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.


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.


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜