What is WSDL equivalent in restful WS . If nothing,how consumer generates required client side classes?
One important concept of REST is HATEOAS or Hypermedia as the Engine of Application State. What this means is that your client interacts with the REST service through hypermedia links that the service hands it.
Your REST web service has an entry point, say http://yourhost.com/rest
. Your client will start by sending the request to that URL. Your service will respond with a resource that describes some or all the accessible resources and how to access them. You keep discovering and following links. This is how the API is published (and discovered).
Here's an awesome video describing this concept: Hypermedia APIs.
Through HATEOAS you can make your service API completely discoverable by just following hypermedia links.
There is no concept of top down/bottom up design in REST.
REST is about resources, not about method calls, which is basically what a WSDL describes.
Even if client has to do it manually, how client will know what is the class definition of EmployeeData class without wsdl or wadl?
It won't need to create an EmployeeData
class. Say you needed to create a new Employee
, you would send a GET request to /employees
which would possibly return a response containing how to do that. That might be an XHTML response like so (among other things)
<form class="new-employee" action="/context/employees" method="PUT" >
<input type="text" name="employee_name" />
<input type="text" name="employee_age" />
<input type="submit" name="submit" />
</form>
The response contains the exact format you need to follow to create a new employee. You need to submit the form to /context/employees
with an HTTP PUT request containing those form parameters. This is HATEOAS. The hypermedia link is the /context/employees
. The engine is following this link with a PUT request. The application state is that after this request, a new employee will exist.