views:

220

answers:

1

Hello everybody!

I know that WSDL is for defining SOAP based web services but in most of the WSDLs I saw on net, in the WSDL is defined also RESTful "web service"-http:binding.

To generate client for the SOAP I used wsimport tool from JAX-WS (it also generates client classes for the REST but it doesnt work).

So the question is, how to generate REST client based on the WSDL?

+2  A: 

I've never heard of anyone using WSDL for generating REST clients. WADL yes, but not WSDL.

Anyway, generating clients for REST services does not make sense. If you think you want to do that then you are missing the benefits of REST and trying to follow the REST constraints is going to make you do extra work for nothing.

Darrel Miller
I had also read on net that WSDL isn't supposed to be for defining REST. But in many(really many) I found REST described. For example:http://services.aonaware.com/DictService/DictService.asmx?WSDLhttp://www.webservicex.net/ValidateEmail.asmx?WSDLhttp://www.webservicex.com/globalweather.asmx?WSDLhttp://www.webservicex.net/WeatherForecast.asmx?wsdl
Milan
That's interesting to know. I had heard that recent versions of WSDL could describe HTTP apis but I had never seen it used. I still personally think that metadata documents like this are completely unnecessary and potentially harmful for REST systems.
Darrel Miller
A big +1 to Darrel's answer. If clients depend on service descriptions obtained at design time your system is anything but RESTful.
Jan Algermissen