SOAP - What's the point?

I mean, really, what's the point of SOAP?

Web services have been around for a long time, and for a while it seemed that the terms “SOAP” and “Web service” are pretty much interchangeable. However, SOAP has always seemed cumbersome and massively complex to me.

Then came REST, and unexpectedly web services made sense.

As Joel Spolsky says, give the programmer the URL REST, and they will immediately start playing with the service, figuring this out.

SOAP gets confused by WSDL and massively verbose XML, and while you are a website, you cannot do anything as simple as accessing a SOAP service using a web browser.

So the gist of my question is:

  • Is there any good reason to ever choose SOAP over REST?
  • Are you working with SOAP now? Would it be better if the interface were REST?
  • I'm wrong?
+50
soap rest
Mar 26 '09 at 16:50
source share
11 answers

Well, it now seems that WSI agrees that SOAP no longer makes sense, as they announced that they would cease to exist as an independent entity.

An interesting article about the announcement and some comments here: http://blogs.computerworlduk.com/simon-says/2010/11/the-end-of-the-road-for-web-services/index.htm

Edited completely exactly in response to John Saunders.

+2
Jan 11 2018-11-11T00:
source share

As Joel Spolsky says, give the programmer the URL REST, and they will immediately start playing with the service, figuring this out.

If the service had a well-defined, machine-readable contract, then the programmer would not have to waste time understanding this.

(not that WSDL / SOAP is necessarily an example of a good implementation of a well-defined contract, but it was the point of WSDL)

SOAP was originally a simple protocol that allowed you to add a header to a message and had a standardized mapping of object instances to XML structures. Putting processing metadata in a message simplified the client code and meant that you could very easily transfer and queue messages.

I never needed the details of header processing when I created SOAP services back in 2001. This was a preliminary WSDL, and then it was normal to use GET to retrieve information and requests (no different from most applications that claim to be REST; REST has more options for using hyperlinks to discover services) and POST with a SOAP payload to perform actions . Those actions that created the resources will return the URL of the created resource to the client, and the client can then receive the resource. I believe that WSDL made it easier to think only in terms of RPC, and not with actions that create resources that cause SOAP to lose plot.

+11
Mar 26 '09 at 17:20
source share

The topic is well discussed in Why soap is considered thick .

+6
Mar 26 '09 at 16:56
source share

As I see it, SOAP may be more “flexible,” but the result is too complex (you mentioned WSDL, which is always a stumbling block for me personally).

I get a REST. It is simple . The only drawback that I can notice is that you limit yourself to these four main actions against a single resource, which may not quite correspond to the way you view your data.

+6
Mar 26 '09 at 16:56
source share

Having done some research to understand some of the answers here (especially John Saunders), I found this http://harmful.cat-v.org/software/xml/soap/simple SOAP post more crazy than I thought ...

+6
Mar 27 '09 at 9:53
source share

The point of WSDL was automatic detection. The idea was that you would not have to write client code, it would be automatically generated.

BTW. the next step beyond WSDL Semantic Web Services .

+4
Mar 26 '09 at 16:56
source share

If you do not need the functions of the WS- * protocol series; if you do not need self-describing services; if your service cannot be fully described as resources, as defined by the HTTP protocol; if you don’t like creating XML for each interaction with the service and analyze it later; then you will need SOAP.

Otherwise, be sure to use REST.




There was a question about the value of a self-describing service. My imagination fails when it comes to how someone might not understand this. It is on me. However, I should think that anyone who has ever used a service that is much more complex than "Hello, world" would know why it is important that someone else write code that takes parameters, creates XML for sending to the service, sends it receives a response, then accesses the objects.

Now, I suppose, this might not be necessary when using the RESTful service; at least not using a RESTful service that does not handle complex objects. Even with a relatively simple service such as http://www.earthtools.org/webservices.htm (which I used as an example of calling a RESTful service), you can benefit from understanding the structure of the returned data. Even the aforementioned service provides an XML schema - it unfortunately does not describe the whole answer. Given this schema, you still need to manually process the XML or use the tool to create serializable classes from the schema.

All this happens for you when the service is described in WSDL, and you use a tool such as Add Service Link in Visual Studio or the svcutil.exe program, or I-forget-what-the-command -is-in-Eclipse.

If you need examples, start with EarthTools services and go to any other services with more complex messaging.

BTW, another thing that requires self-description is the description of the messaging patterns and protocols supported by the service. Perhaps this is not required when the only options are HTTP verbs over HTTP or HTTPS. Life gets harder if you use WS-Security and friends.

+3
Mar 26 '09 at 17:52
source share

I have found that SOAP is most appropriate when there is a high probability that the service will be consumed by enterprise software (COTS). Due to the well-defined contract used by SOAP / WSDL, most COTS packages have built-in functionality for consuming such services. This will simplify the use of BPM / workflow tools, etc., to simply use certain services without configuration. Other than this use case, REST service tends to be my version of the goo web service for applications.

+2
Jul 04 '09 at 7:13
source share

I think SOAP addresses a crowd of Java and .net, who may be more familiar with the old CORBA and COM and less familiar with Internet technologies.

REST also has one major drawback: very little guidance on how to actually implement such a system. You will find significant differences in how many of the common RESTful APIs have been developed. In fact, many violate key aspects of REST (e.g. using GET for manipulation or POST for retrieval), and there is disagreement over the fundamental use (POST / GET vs POST / GET / PUT / DELETE).

+1
Jul 04 '09 at 6:18
source share

I'm wrong?

"You are not mistaken, Walter, you are just ... :)"

Is there any good reason to ever choose SOAP over REST?

SOAP, in my understanding, refers to the contract, so you can check the type.

0
Mar 26 '09 at 16:59
source share

SOAP is a lightweight, structured XML-based protocol specification that will be used when deploying services. It is used to exchange structured information in a decentralized distributed environment. SOAP uses XML technology to exchange information over any transport layer protocol. It does not depend on any particular programming model or other specific implementation semantics. Learn more about XML SOAP Messaging Framework

An XML-based messaging framework that 1) Extensibility: Simplicity remains one of the main goals of SOAP in SOAP. SOAP defines a communications infrastructure that allows features such as security, routing, and reliability to be added later as layered extensions

2) Inter operable: SOAP can be used over any transport protocol, such as TCP, HTTP, SMTP. Today, SOAP provides explicit binding for HTTP.

3) Independent: SOAP allows any programming model and is not tied to a remote procedure call (RPC). SOAP defines a model for processing individual one-way messages. SOAP also allows you to use any number of messaging patterns (MEPs). Learn more about SOAP

0
Oct 05 '16 at 8:05
source share



All Articles