Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RESTful Services - WSDL Equivalent

Tags:

rest

wsdl

I have been reading about REST and SOAP, and understand why implementing REST can be beneficial over using a SOAP protocol. However, I still don't understand why there isn't the "WSDL" equivalent in the REST world. I have seen posts saying there is "no need" for the WSDL or that it would be redundant In the REST world, but I don't understand why. Isn't it always useful to programmatically bind to a definition and create proxy classes instead of manually coding? I don't mean to get into a philosophical debate, just looking for the reason there is no WSDL in REST, or why it is not needed. Thanks.

like image 881
skaz Avatar asked Nov 06 '10 02:11

skaz


People also ask

Does RESTful service have WSDL?

WSDL files exist only for SOAP web services, not for REST based services. REST services have a WADL file which you can see referenced in section 5 of the tutorial.

What is the difference between WSDL and REST API?

SOAP uses WSDL for communication between consumer and provider, whereas REST just uses XML or JSON to send and receive data. WSDL defines contract between client and service and is static by its nature.

Does Web API have WSDL?

There is no SOAP or WSDL support in WebApi.

Can SOAP service use RESTful web services?

SOAP can't use REST because it is a protocol.


2 Answers

The Web Application Description Language (WADL) is basically the equivalent to WSDL for RESTful services but there's been an ongoing controversy whether something like this is needed at all.

Joe Gregorio has written a nice article about that topic which is worth a read.

like image 101
joschi Avatar answered Sep 20 '22 08:09

joschi


WSDL describes service endpoints. REST clients should not be coupled to server endpoints (i.e. should not be aware of in URLs in advance). REST clients are coupled on the media-types that are transfered between the client and server.

It may make sense to auto generate classes on the client to wrap around the returned media-types. However, as soon as you start to create proxy classes around the service interactions you start to obscure the HTTP interactions and risk degenerating back towards a RPC model.

like image 36
Darrel Miller Avatar answered Sep 20 '22 08:09

Darrel Miller