Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WSDL for SOAP and WSDL for REST and REST based on JSON

when a company wants to release a web services, does it release a separate WSDL for SOAP and separate for REST based web services or they are merged in the same WSDL? Can a WSDL only represent REST web services based on JSON (not XML) ?

Assume web services clients are Java based.

If SOAP and REST are merged in the same WSDL, does wsimport generates separate classes (for binding XML to Java objects) for SOAP and separate for REST?

like image 421
ace Avatar asked May 09 '11 11:05

ace


People also ask

Is WSDL for SOAP or REST?

WSDL, or Web Service Description Language, is an XML based definition language. It's used for describing the functionality of a SOAP based web service. WSDL files are central to testing SOAP-based services.

Can WSDL be JSON?

Users can also convert WSDL File to JSON by uploading the file. WSDL and WSDL wsdl data can we converted to JSON online. Once you are done with WSDL to JSON converting.

Is there WSDL for REST API?

HI, REST doesn't require WSDL. You will only need endpoints and HTTP methods. Hope this helps and answers your query. SOAP uses WSDL for communication between consumer and provider, whereas REST just uses XML or JSON to send and receive data.


1 Answers

You need WSDL 2.0 (or WADL) to describe REST service. Support for WSDL 2.0 is currently very limited and wsimport doesn't support it. I'm not Java developer but I think that wsimport is only for SOAP services (JAX-WS and it doesn't support WSDL 2.0 as well).

Edit:

Check this extension. It should allow you exposing JAX-WS service with JSON encoding. It should also expose "JavaScript proxy" for calling the JSON service. To more precisely answer your question - I don't think that you can describe REST service without WSDL 2.0 or WADL. So you cannot merge SOAP and REST service to single WSDL 1.1 supported by most stacks. For further reference about describing JSON service check this question.

like image 52
Ladislav Mrnka Avatar answered Oct 27 '22 06:10

Ladislav Mrnka