6

There are 2 types of web-services as I know. First one is custom xml formatted messages and the second one SOAP standard xml messages. What are the differences between them? Which one is better, what are pros and cons of each of that two approaches?

dhblah
  • 9,751
  • 12
  • 56
  • 92
  • i think below two link may help you. http://www.eggheadcafe.com/community/xml/4/82443/difference-between-xml-and-soap.aspx http://stackoverflow.com/questions/80112/whats-the-difference-between-xml-rpc-and-soap – Arpi Patel Dec 27 '11 at 12:28

3 Answers3

27

By "ordinary" I assume you mean RESTful services. This discussion would be a long one, so I'll try to give you some key points:

  1. RESTful services are the most used flavor of Web Services. They are closely linked to the functionality and principles of HTTP and can be accessed as simple as a GET request (other operations are POST, DELETE and PUT). The core concept is the "resource" which is identified by an URI. Common formats for REST are XML and JSON. It's a pretty straightforward and easy to use technology, which is what makes it so widely available.

  2. SOAP web services are based on XML, most of them adhering to the RPC-style of app design (calling remote methods on a server and getting a response), and use 3 main pillars:

    • WSDL - Web Service Description Language - used to describe a service in terms of available operations, parameters, etc.
    • SOAP - Simple Object Access Protocol - used to construct interaction messages between the entities involved (client, server).
    • UDDI - Universal Description, Discovery and Integration - used to classify and publish available web services to a repository and enable discovery by potential users.

SOAP Web Services tend to have high overhead and generally have very verbose messages, but may be good if you need to implement more complex functionality and interaction in your application.

Tudor
  • 61,523
  • 12
  • 102
  • 142
11

Strictly speaking only the Soap services are webservices. They are based on the WS-* Specs standardisized by W3C and Oasis. Sometimes a also reffered as Webservice are so called POX-Endpoint (Plain old XML) or REST Endpoint, which allows you to simply get a raw XML via HTTP GET.

SOAP Services carry their schema in form of a wsdl endpoint (usualy append ?wsdl to the service endpoint), so there a lots of tools to create proxy objects and hide the complexity of the webservice call. With POX Services you need to know which schema to use from e.g. the documentation.

SOAP Services carry the payload inside the SOAP Envelope (an XML Schema with header and body with the payload in the body). Having a header independent from the payload allows to reroute the content, sign and encrypt, authenticate etc. without knowing the content. But you pay by additional overhead in the message itself.

POX on the other hand leaves all that to the webserver and relies usualy on HTTP for authentification and compression. Encription and signing had to be done by your system. It is low overhead but also low discoverability.

Whats works best for you depends a lot on your scenario. If you work in a .Net or Java World, you often find it simplest to create a proxy and use that to work with the webservices as remote objects. You get a well build infrastructure and a comfortable programming experience. If youre environment does not support the proxy generation or if it had to be called from anything, POX might the very much more lightweight way to go.

gbegerow
  • 133
  • 1
  • 7
5

"Web Service" refers to a more abstract and general concept. We can say that anything that can be served on web is a Web Service. SOAP Web Services or RESTful services are special kind of Web Services which has wide acceptance and has their own standards. While SOAP services are built on a new XML based standard, RESTful approach makes use of existing HTTP methods, hence more widely accepted (to my experience).

anilsinaci
  • 386
  • 1
  • 4
  • "There is a compact comparison in [link given]". No there's not! –  Aug 27 '13 at 15:37
  • It seems that the link is dead; moderators removed the page. I deleted that sentence referring to the dead page. – anilsinaci Nov 06 '13 at 14:29