SOAP: Difference between revisions

From DataFlex Wiki
Jump to navigationJump to search
2,347 bytes added ,  22 November 2007
m
Adding
mNo edit summary
m (Adding)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''SOAP''' is a [[XML]]-based protocol for exchanging data over a network.  It used to stand for ''Simple Object Access Protocol''.
'''[http://www.w3.org/TR/soap/ SOAP]''' is a [[XML]]-based protocol for exchanging data over a network.  It used to stand for ''Simple Object Access Protocol'', but since it was not all that simple and not in any meaningful way [http://en.wikipedia.org/wiki/Object-oriented_programming object oriented] it has been, by consensus, retrospectively stripped of its acronym status. It is often proposed that it should now stand for ''Service Oriented Architecture Protocol'', however this is only a little better, as [[SOA|Service Oriented Architectures]] require many other protocols than SOAP, and indeed can be built entirely without it.


SOAP is the basis of [[Web Service|Web Services]] within [[Visual DataFlex]].
SOAP is the basis of [[Web Service|Web Services]] within [[Visual DataFlex]].
A SOAP message is composed of an outer element, the '''Envelope''', which then contains an optional '''Header''' element and a required '''Body''' element.  Many simple SOAP services make no use of the Header element, but it is required for most of the more advanced [[Web_Services#Web_Service_Protocols|web service protocols]].
An example of a SOAP message might be (from [http://www.w3.org/TR/2007/REC-soap12-part1-20070427/#firstexample]):
<env:Envelope xmlns:env="<nowiki>http://www.w3.org/2003/05/soap-envelope</nowiki>">
  <env:Header>
  <n:alertcontrol xmlns:n="<nowiki>http://example.org/alertcontrol</nowiki>">
    <n:priority>1</n:priority>
    <n:expires>2001-06-22T14:00:00-05:00</n:expires>
  </n:alertcontrol>
  </env:Header>
  <env:Body>
  <m:alert xmlns:m="<nowiki>http://example.org/alert</nowiki>">
    <m:msg>Pick up Mary at school at 2pm</m:msg>
  </m:alert>
  </env:Body>
</env:Envelope>
In addition to the three elements mentioned above, SOAP defines a '''Fault''' element, which will appear within the response Body, with additional sub-elements, for returning failure information from the server (from [http://www.w3.org/TR/2007/REC-soap12-part1-20070427/#faultcodes]):
<env:Envelope xmlns:env="<nowiki>http://www.w3.org/2003/05/soap-envelope</nowiki>"
              xmlns:m="<nowiki>http://www.example.org/timeouts</nowiki>"
              xmlns:xml="<nowiki>http://www.w3.org/XML/1998/namespace</nowiki>">
<env:Body>
  <env:Fault>
    <env:Code>
      <env:Value>env:Sender</env:Value>
      <env:Subcode>
      <env:Value>m:MessageTimeout</env:Value>
      </env:Subcode>
    </env:Code>
    <env:Reason>
      <env:Text xml:lang="en">Sender Timeout</env:Text>
    </env:Reason>
    <env:Detail>
      <m:MaxTime>P5M</m:MaxTime>
    </env:Detail>   
  </env:Fault>
  </env:Body>
</env:Envelope>


[[Category:Web Services]]
[[Category:Web Services]]

Navigation menu