SOAP
SOAP is an RPC protocol allowing transmission of messages (expressed in XML) between a client and server over a transport (usually HTTP). Work began in 1999.
Key characteristics
- Extensibility of the protocol through namespaced tags.
- Neutrality of the underlying transport allows different use cases.
- Independence of language or platform allows services to be written in the most appropriate language.
Concepts
- WSDL describes the format of messages.
- Senders send Messages to Receivers.
- Receivers receive Messages from Senders.
- Messages are passed between Senders and Receivers.
- Envelope element identifies the root of a SOAP message.
- Headers don't use HTTP headers; both request and response.
- Body element contains the data or Fault information.
- Extensions
- Service Provider
- Service Requester
- WSDL schema
- Types define rules around values in messages:
- Scalar types:
string
boolean
float
double
decimal
binary
integer
nonPositiveInteger
negativeInteger
nonNegativeInteger
long
int
short
byte
unsignedLong
unsignedInt
unsignedShort
positiveInteger
date
time
- Compound types:
array
struct
- Complex types are entities that combine the above types.
- Literal XML
encodingStyle
forgoes SOAP encoding, deferring schema to the XML schema.
- Scalar types:
WSDL
WSDL is a machine-processable specification of a web service's interface used to generate stub implementations of clients and servers. It defines the message types and their component parts.
Binding styles
document
is geared toward returning representations of entities.rpc
is geared toward performing operations.
Exchange patterns
Messages can be exchanged through a number of patterns:
- One-way messaging allows a Sender to Message a Receiver without a response.
- Request/response messaging follows the traditional Sender Messages a Receiver, and the Receiver returns a response to the Sender.
- Notification messaging allows an asynchronous design where a Receiver sends a Message to a Sender.
- Solicit/response messages enable a Receiver to solicit a Message from a Sender by initiating a flow with a Message, reversing the request/response flow.
Abstract part
The abstract portion defines concepts, avoiding implementation detail.
wsdl:definition
lists XML namespaces (xmlns:example
) used to identify sources of schema objects.wsdl:types
declares types used in messages.xs:element
defines named elements.xs:complexType
wsdl:message
declares request/response/error messages.wsdl:part
descries a partial section of a message.
wsdl:portType
declare "ports" into the application from the outside, and can be bound to transports iun the concrete section.wsdl:operation
outlines a mode of operation for a service, outlined by the presence and order of input, output and fault sections:wsdl:input
defines an inbound request Message.wsdl:output
defines an outbound response Message.wsdl:fault
defines an outbound error Message.
Concrete part
The concrete part assigns transports to port types.
wsdl:binding
definesname
andtype
pairs that reference ports for binding.soap:binding
bind WSDL bindings to transports with astyle
andtransport
.
Common transports:
- HTTP, using
POST
with aSOAPAction
header. - SMTP, using
Message-Id
andIn-reply-to
headers for message correlation.
Extensions
Extensions define reusable implementations of behaviours that span services. They're usually implemented by middleware on the client and server side that is not tied to individual services.
WS-Security
Defines signing and encryption of SOAP messages to assure integrity and confidentiality respectively, and allows attachment of security tokens to identify Senders.
WS-Federation
Allows brokering security realms from products like ADFS and SAML IdPs.
WS-Addressing
Declares a standardised way of attaching message routing data with SOAP headers.
WS-ReliableMessaging
WS-ReliableMessaging defines a protocol allowing for reliable delivery of SOAP messages between distributed systems in spite of failures in the network between them.
An Application Source sends a Message to a Reliable Messaging Source which transmits it to a Reliable Messaging Destination, which acknowledges receipt and transmits the Message to an Application Destination.
WS-RM defines a number of delivery assurances:
AtLeastOnce
, but maybe more than once.AtMostOnce
, but may go undelivered.ExactlyOnce
with no duplicates and missed deliveries without errors in the RMS or RMD.InOrder
guarantees ordered delivery in addition to of any of the above assurances.
WS-Transaction
A specification providing coordination types used in the WS-Coordination
specification:
- Atomic Transactions cover individual operations.
- Business Activities cover longer-running operations.
WS-Coordination
Provides coordination of distributed operations across systems.
Backlinks