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.
John Saunders Mar 26 '09 at 17:52 2009-03-26 17:52
source share