SOAP - jellyfish-tom/TIL GitHub Wiki
[SOURCES]
Simple Object Access Protocol
SOAP can be used by a variety of transport protocols in addition to HTTP, for example, FTP and SMTP. (A conventional pattern is to use HTTP for synchronous data exchange and SMTP or FTP for asynchronous interactions).
In order to support consistency when structuring data, SOAP uses a standard XML schema (XSL) to encode XML. In addition, developers can create their own XML schemas to add custom XML elements to SOAP messages.
SOAP is typically used with the Web Service Description Language (WSDL). The significance of using WSDL is that developers and machines can inspect a web service that supports SOAP to discover the specifics of the information exchange over the network. In addition, the WSDL describes how to structure the SOAP request and response messages that the given service supports. Discovery via WSDL simplifies programming web services using SOAP.
- messaging protocol specification for exchanging structured information in computer network
- 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.
- it consists of three parts:
- an envelope, which defines the message structure and how to process it
- a set of encoding rules for expressing instances of application-defined datatypes
- a convention for representing procedure calls and responses
SOAP has three major characteristics
- extensibility
- neutrality (SOAP can operate over any protocol such as HTTP, SMTP, TCP, UDP, or JMS)
- independence (SOAP allows for any programming model)
SOAP specification can be broadly defined to be consisting of the following 3 conceptual components: protocol concepts, encapsulation concepts and network concepts
Protocol concepts
- SOAP: The set of rules formalizing and governing the format and processing rules for information exchanged between a SOAP sender and a SOAP receiver.
- SOAP nodes: These are physical/logical machines with processing units which are used to transmit/forward, receive and process SOAP messages. These are analogous to nodes in a network.
- SOAP roles: Over the path of a SOAP message, all nodes assume a specific role. The role of the node defines the action that the node performs on the message it receives. For example, a role "none" means that no node will process the SOAP header in any way and simply transmit the message along its path.
- SOAP protocol binding : A SOAP message needs to work in conjunction with other protocols to be transferred over a network. For example, a SOAP message could use TCP as a lower layer protocol to transfer messages. These bindings are defined in the SOAP protocol binding framework.[13]
- SOAP features: SOAP provides a messaging framework only. However, it can be extended to add features such as reliability, security etc. There are rules to be followed when adding features to the SOAP framework.
- SOAP module : A collection of specifications regarding the semantics of SOAP header to describe any new features being extended upon SOAP. A module needs to realize zero or more features. SOAP requires modules to adhere to prescribed rules.[14]
Data encapsulation concepts
- SOAP message: Represents the information being exchanged between 2 SOAP nodes.
- SOAP envelope : As per its name, it is the enclosing element of an XML message identifying it as a SOAP message.
- SOAP header block: A SOAP header can contain more than one of these blocks, each being a discrete computational block within the header. In general, the SOAP role information is used to target nodes on the path. A header block is said to be targeted at a SOAP node if the SOAP role for the header block is the name of a role in which the SOAP node operates. (ex: A SOAP header block with role attribute as ultimateReceiver is targeted only at the destination node which has this role. A header with a role attribute as next is targeted at each intermediary as well as the destination node.)
- SOAP header : A collection of one or more header blocks targeted at each SOAP receiver.
- SOAP body : Contains the body of the message intended for the SOAP receiver. The interpretation and processing of SOAP body is defined by header blocks.
- SOAP fault: In case a SOAP node fails to process a SOAP message, it adds the fault information to the SOAP fault element. This element is contained within the SOAP body as a child element.
Message sender and receiver concepts
- SOAP sender: The node that transmits a SOAP message.
- SOAP receiver : The node receiving a SOAP message. (Could be an intermediary or the destination node.)
- SOAP message path : The path consisting of all the nodes that the SOAP message traversed to reach the destination node.
- Initial SOAP sender: This is the node which originated the SOAP message to be transmitted. This is the root of the SOAP message path.
- SOAP intermediary: All the nodes in between the SOAP originator and the intended SOAP destination. It processes the SOAP header blocks targeted at it and acts to forward a SOAP message towards an ultimate SOAP receiver.
- Ultimate SOAP receiver: The destination receiver of the SOAP message. This node is responsible for processing the message body and any header blocks targeted at it .