开发者

Difference between XML and SOAP

开发者 https://www.devze.com 2022-12-22 10:59 出处:网络
What is the difference between XML 开发者_C百科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\'

What is the difference between XML 开发者_C百科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?


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!


Wikipedia has a wonderful article, including a good example.

SOAP, originally defined as Simple Object Access Protocol, is a protocol specification for exchanging structured information in the implementation of Web Services in computer networks.

A really good practical example:

As a layman's example of how SOAP procedures can be used, a SOAP message could be sent to a web-service-enabled web site (for example, a house price database) with the parameters needed for a search. The site would then return an XML-formatted document with the resulting data (prices, location, features, etc). Because the data is returned in a standardized machine-parseable format, it could then be integrated directly into a third-party site.


SOAP is a messaging protocol used over networks to invoke web-services.
The message formats use XML, and are described by WSDL's - pronounced wizdil.

WSDL's are also XML documents.

XML is a document format that uses tags to identify the contents of the file, its usage is wider than SOAP and WSDL which are specific types of XML.
See the w3schools tutorial for XML at http://www.w3schools.com/xml/default.asp

0

精彩评论

暂无评论...
验证码 换一张
取 消