What are WSDL, SOAP and REST?

217,667

Solution 1

A WSDL is an XML document that describes a web service. It actually stands for Web Services Description Language.

SOAP is an XML-based protocol that lets you exchange info over a particular protocol (can be HTTP or SMTP, for example) between applications. It stands for Simple Object Access Protocol and uses XML for its messaging format to relay the information.

REST is an architectural style of networked systems and stands for Representational State Transfer. It's not a standard itself, but does use standards such as HTTP, URL, XML, etc.

Solution 2

Example: In a simple terms if you have a web service of calculator.

WSDL: WSDL tells about the functions that you can implement or exposed to the client. For example: add, delete, subtract and so on.

SOAP: Where as using SOAP you actually perform actions like doDelete(), doSubtract(), doAdd(). So SOAP and WSDL are apples and oranges. We should not compare them. They both have their own different functionality.

Why we use SOAP and WSDL: For platform independent data exchange.

EDIT: In a normal day to day life example:

WSDL: When we go to a restaurant we see the Menu Items, those are the WSDL's.

Proxy Classes: Now after seeing the Menu Items we make up our Mind (Process our mind on what to order): So, basically we make Proxy classes based on WSDL Document.

SOAP: Then when we actually order the food based on the Menu's: Meaning we use proxy classes to call upon the service methods which is done using SOAP. :)

Solution 3

Every time someone mentions SOAP/WSDL, I think of objects and classes defined in xml...

"You use SOAP just the same way that you would any PHP class. However, in this case the class does not exist in the local applications file system, but at a remote site accessed over http." ... "If we think of using a SOAP service as just another PHP class then the WSDL document is a list of all the available class methods and properties. "

http://www.doublehops.com/2009/07/07/quick-tutorial-on-getting-started-with-soap-in-php/comment-page-1/

..and whenever someone talks about REST I think of HTTP's commands (request methods) like POST, GET and DELETE

Solution 4

SOAP -> SOAP(Simple object access protocal) is the application level protocal created for machine to machine interaction. Protocol defines standard rules. All the parties who are using the particular protocol should adhere to the protocol rules. Like TCP, It unwinds at transport layer, The SOAP protocol will be understood by Application layer( any application which supports SOAP - Axis2, .Net).

WSDL -> SOAP message consist of SoapEnevelope->SoapHeader and SoapBody. It doesn't define what would be message format? what are all the transports(HTTP,JMS) it supports? without this info, It is hard for any client who wants to consume the particular web service to construct the SOAP message. Even if they do, they won't be sure, it'll work all the time. WSDL is the rescue. WSDL (Web Service description Language) defines the operations, message formats and transport details for the SOAP message.

REST -> REST(Representational state transfer) is based on the Transport. Unlike SOAP which targets the actions, REST concerns more on the resources. REST locates the resources by using URL (example -http://{serverAddress}/employees/employeeNumber/12345) and it depends on the transport protocol( with HTTP - GET,POST, PUT, DELETE,...) for the actions to be performed on the resources. The REST service locates the resource based on the URL and perform the action based on the transport action verb. It is more of architectural style and conventions based.

Solution 5

You're not going to "simply" understand something complex.

WSDL is an XML-based language for describing a web service. It describes the messages, operations, and network transport information used by the service. These web services usually use SOAP, but may use other protocols.

A WSDL is readable by a program, and so may be used to generate all, or part of the client code necessary to call the web service. This is what it means to call SOAP-based web services "self-describing".

REST is not related to WSDL at all.

Share:
217,667

Related videos on Youtube

javaguy
Author by

javaguy

Updated on May 06, 2020

Comments

  • javaguy
    javaguy about 4 years

    What is WSDL? How is it related to SOAP? Where does REST fit in all of that?

  • John Saunders
    John Saunders over 13 years
    -1: sorry, but I disagree with associating SOAP with RPC. What about message-style services? Also, there's no standard that says a request ending in .wsdl or ?wsdl will generate a WSDL.
  • keith_c
    keith_c over 13 years
    I meant to put SMTP or HTTP as examples of protocols that SOAP can be used over. I didn't intend it to mean HTTP is the only protocol that can be used (was just using it as an example).
  • duffymo
    duffymo over 13 years
    Are you saying that you can't do RPC with SOAP? I know that might not encompass the entire standard, but it was certainly the original motivation. As far as whether or not the WSDL URL is part of the standard, I'll admit that you have me there. It's usually the way I see it done, but I can't cite anything in the standard that mandates it.
  • John Saunders
    John Saunders almost 13 years
    You may have been confusing the fact that SOAP was derived from XML-RPC with the idea that SOAP was originally intended as an RPC. Yet note that WSDL, from the start, was able to describe document-style services, in addition to RPC style services. If RPC were the original motivation behind SOAP and WSDL, then one would expect that document-style services would have been absent from the original standard.
  • kingAm
    kingAm almost 9 years
    Representational State Transfer (REST) is an architectural style that specifies constraints, such as the uniform interface, that if applied to a web service induce desirable properties, such as performance, scalability, and modifiability, that enable services to work best on the Web. In REST style, data and functionality are considered resources and are accessed using Uniform Resource Identifiers (URIs). The resources are acted upon by using a set of simple, well-defined operations. it follows client/server architecture and is designed to use a stateless communication protocol,typically HTTP.
  • Sparkzz
    Sparkzz over 6 years
    Isn't the 'D' in WSDL stand for "Description" instead of "Definition"?
  • Ojonugwa Jude Ochalifu
    Ojonugwa Jude Ochalifu about 6 years
    "A WSDL is an XML document that describes a web service. It actually stands for Web Services Definition Language." This really doesn't explain what it is...
  • Bochu
    Bochu almost 5 years
    @Sparkzz according to wikipedia: The current version of WSDL is WSDL 2.0. The meaning of the acronym has changed from version 1.1 where the "D" stood for "Definition".
  • Minh Nghĩa
    Minh Nghĩa almost 4 years
    Why is wsdl needed? REST doesnt need it. Developer can see the documentation. Why is advertising the capability along with input and output argument necessary?
  • David Waterworth
    David Waterworth over 3 years
    It isn't needed, it does provide the ability for the developer to automatically generate the client classes they need to interact with the service though.
  • James Murphy
    James Murphy over 2 years
    A WSDL just makes it significantly easier to manage and auto-generate the SOAP client. WSDL's are essentially the contract between two SOAP endpoints. We can keep them in sync by versioning the WSDL and storing WSDL somewhere publicly available (or secured if required).