What is the difference between a regular web service and a soap based web service?

There are two types of web services that I know. The first is custom XML formatted messages, and the second is standard XML SOAP messages. What are the differences between the two? Which one is better, what are the pros and cons of each of these two approaches?

+6
source share
3 answers

By "normal" I mean that you mean RESTful services. This discussion would be long, so I will try to give you some key points:

  • RESTful services are the most commonly used flavor of web services. They are closely related to the functionality and principles of HTTP and can be accessed as easily as a GET request (other operations are POST, DELETE and PUT). The basic concept is a “resource” that is identified by a URI. Common REST formats are XML and JSON. This is a fairly simple and easy to use technology that makes it so widely available.

  • SOAP web services are XML-based, most of which adhere to the RPC application development style (by invoking remote methods on the server and receiving a response) and use 3 main pillars:

    • WSDL - Web Service Description Language - used to describe the service in terms of available operations, parameters, etc.
    • SOAP - Simple Object Access Protocol - is used to create interaction messages between participating objects (client, server).
    • UDDI, a universal description, discovery, and integration, is used to classify and publish available web services to the repository and to enable potential users to discover it.

SOAP web services have high overhead and usually have very verbose messages, but can be good if you need to implement more complex functions and interactions in your application.

+24
source

Strictly speaking, only Soap services are web services. They are based on WS- * Specs , a standardized W3C and Oasis. Sometimes also called a Webservice, the so-called POX-Endpoint (plain old XML) or REST endpoint, which allows you to simply get the raw XML through an HTTP GET.

SOAP services carry their scheme as a wsdl endpoint (usually adds? Wsdl to the service endpoint), so there are many tools to create proxies and hide the complexity of the webservice call. Using POX services, you need to know which scheme to use, for example. documentation.

SOAP services carry the payload inside the SOAP envelope (XML schema with header and body with payload in the body). The presence of the header, independent of the payload, allows you to redirect the contents, sign and encrypt, authenticate, etc. Without knowing the contents. But you pay the extra overhead in the message itself.

POX, on the other hand, leaves it all on the web server and typically uses HTTP for authentication and compression. Signing and signing must be done by your system. This is low overhead as well as low openness.

What works best for you depends on your scenario. If you are working in .NET or Java World, it is often easier for a proxy to create a proxy and use it to work with web services as remote objects. You get a well-developed infrastructure and convenient programming experience. If youre doesn't support proxy generation, or if you needed to call it from something, POX can do a much easier way.

+11
source

"Web service" refers to a more abstract and general concept. We can say that all that can be served on the Internet is a web service. SOAP Web Services or RESTful is a special kind of web service that is widely recognized and has its own standards. Although SOAP services are built on the new XML-based standard, the RESTful approach uses existing HTTP methods, which is why it is more widespread (in my experience).

+5
source

Source: https://habr.com/ru/post/904530/


All Articles