What would be the format of the data transmitted by a SOAP web service?

Asked

Viewed 180 times

2

In web services that use the REST architecture, the format of the data that is trafficked by the network is XML or JSON, in some cases may be both. However, I don’t know what is the format of the data that is trafficked in a SOAP web service.

Therefore, I would like to know the format of the data traffic through the network through a SOAP web service?

  • 2

    Any suggestions for improvement in the downvoter question?

  • 1

    Follows a question with interesting contents your doubt.

1 answer

2

A web service SOAP traffic XML

More info here: https://www.w3schools.com/xml/xml_soap.asp

A SOAP message MUST be encoded using XML

That is, the messages SOAP always traffic in XML

A SOAP message is an ordinary XML Document

That is, always an XML document.

Here, the basic skeleton of a message SOAP and its format:

<?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>
     ... Aqui vai o corpo da mensagem em XML
    <soap:Fault>
       ...
    </soap:Fault>
  </soap:Body>
</soap:Envelope>
  • 2

    Only the reference that is not reliable. w3schools is considered a great joke, where you tried to count how many errors there were on a random page that you opened

  • Ah, neither is any xml that can be trafficked. Inside xml, it has a specific format

  • @hugocsl the most relevant part of the link was included in the reply "A SOAP message MUST be encoded using XML"

  • Just did the Review, but I’ve already removed considering your Reply Edition.

  • 3

    The protocol specification really says that the message should be in XML format. But only to add fuel to the fire: https://en.m.wikipedia.org/wiki/Soapjr (Okay, you can argue that Soapjr is not SOAP). I’ve seen some absurd things too, like an "XML" body with a single CDATA field and some other completely crazy format (e.g., positional file) as content. Again we can argue that this is valid XML, but...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.