Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between XML and SOAP

Tags:

soap

xml

What is the difference between XML and SOAP? I've been reading some introductory articles about SOAP but I am very confused. This is the first time I am reading about SOAP so maybe that's natural.

Could somebody please explain to me what SOAP is and what it is used for? Maybe give me some examples of its usage?

like image 826
Richard Knop Avatar asked Mar 11 '10 15:03

Richard Knop


People also ask

Is SOAP an XML?

SOAP relies exclusively on XML to provide messaging services. Microsoft originally developed SOAP to take the place of older technologies that don't work well on the internet such as the Distributed Component Object Model (DCOM) and Common Object Request Broker Architecture (CORBA).

Is SOAP message XML?

A SOAP message is encoded as an XML document, consisting of an <Envelope> element, which contains an optional <Header> element, and a mandatory <Body> element.

Why SOAP uses XML?

SOAP uses an XML data format to declare its request and response messages, relying on XML Schema and other technologies to enforce the structure of its payloads.

What is SOAP and how does it relate to XML?

SOAP is an acronym for Simple Object Access Protocol. It is an XML-based messaging protocol for exchanging information among computers. SOAP is an application of the XML specification.


1 Answers

After reading all of the other good answers, I thought it might be helpful to provide a "super laymans" version. I hope it helps.


SOAP is like the computer version using the postal service. A message (like a letter) is placed in an envelope and sent off to the person it is intended for.

Primarily, SOAP is an XML vocabulary. It defines a language, using the XML specification, for how to address and send send messages.

Specifically, it standardizes what we refer to as:

  • "an envelope" (actually called a SOAP envelope)
  • "the letter" (called "the body")
  • various annotations (called "headers" - think of these like stamps, signature request, sender information, etc - which the post-office uses to route the message)

In addition, SOAP defines a type-system, much like the type definitions you find in .Net, Java or XSD. I won't elaborate on this - as there is plenty of documentation out there as mentioned in previous answers.

The primary design focus of this language/vocabulary was to allow interoperability across platforms. So, Java calling COM, calling .Net, calling J2EE and the rest while remaining extendable for the foreseeable future. Instead of building yet another bridge between a COM object and a Java class, we can simply use SOAP to expose the functionality of our object so that other platforms can use them without the need for bridges. Or, to put it differently - SOAP was one last bridge, designed to replace all of the previous bridges.

By now, all major development toolkits have some form of SOAP support. This has made interoperability more and more available - but in most environments, a certain level of configuration is still necessary in order to make communication truly seamless.

I should note also that SOAP no longer stands for what its original intent was. At some point, I think some important person will (re)name it: Service Oriented Access Protocol.

I hope this helps!

like image 133
Marvin Smit Avatar answered Nov 30 '22 13:11

Marvin Smit