user2303196
user2303196

Reputation: 1

Difference between soap and xml over http?

I understand that we can encode any object in xml and send the xml in post request over http.So What extra advantage did we have using soap and why it became popular.

Upvotes: 0

Views: 991

Answers (1)

Red Boy
Red Boy

Reputation: 5739

Your question is very generic and broad, hence there could long discussion/debate on whether SOAP is popular, and its pros vs cons. Even not sure if its duplicate question.

I would like to answer it shortly.

Because SOAP is standard because accepted/published by W3.org, hence widely accepted, and XML RPC or just XML over HTTP is not, hence would be less acceptable to organizations/service providers/developers.

SOAP as per wiki

SOAP (originally Simple Object Access Protocol) is a messaging protocol specification for exchanging structured information in the implementation of web services in computer networks. Its purpose is to induce extensibility, neutrality and independence. It uses XML Information Set for its message format, and relies on application layer protocols, most often Hypertext Transfer Protocol (HTTP) or Simple Mail Transfer Protocol (SMTP), for message negotiation and transmission.

XML over HTTP as per wiki,

XML-RPC is a remote procedure call (RPC) protocol which uses XML to encode its calls and HTTP as a transport mechanism.1 "XML-RPC" also refers generically to the use of XML for remote procedure call, independently of the specific protocol. This article is about the protocol named "XML-RPC".

Hence, XML over HTTP is subset of SOAP. Meaning, every SOAP transaction is also XML over HTTP/HTTPS, but every XML over HTTP/HTTPS can't be SOAP.

SOAP Example XML,

<?xml version="1.0"?>

<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">

<soap:Header>
...
</soap:Header>

<soap:Body>
...
  <soap:Fault>
  ...
  </soap:Fault>
</soap:Body>

</soap:Envelope>

XML over HTTP example:

<array>
  <data>
    <value><i4>1404</i4></value>
    <value><string>Something here</string></value>
    <value><i4>1</i4></value>
  </data>
</array>

I would suggest you to do googling to more details, both are wide topics and I think can't be 100% in stack-overflow answer.

Upvotes: 1

Related Questions