SOAP binding style – RPC versus Document

If SOAP web services are to be used, there are additional design considerations. SOAP, as a specification created by committee, has several variations (known as bindings) that are possible. The two main variations in use are called RPC/encoded and Document/literal, with the latter being extended to Document/literal wrapped.

The Remote Procedure Call (RPC) pattern is used in situations where the consumer views the web service as a single logical application or component with encapsulated data. The request and response messages map directly to the input and output parameters of the procedure call. Examples of this type the RPC pattern might include a payment service or a stock quote service.

The document-based pattern is used in situations where the consumer views the web service as a longer running business process where the request document represents a complete unit of information. In fact, this type of web service might involve human interaction. An example of this type of service would be a credit application request document with a response document containing bids from lending institutions. Because longer running business processes may not be able to return the requested document immediately, the document-based pattern is more commonly found in asynchronous communication architectures. The Document/literal variation of SOAP is used to implement the document-based web service pattern.

The RPC/encoded SOAP variation was the initial SOAP mechanism to implement the RPC design pattern. However, inefficiencies and other difficulties in large scale enterprise systems have led to RPC/encoded falling into disuse; it is most likely that eventually this variation will be deprecated by the web standardization committee responsible. A form of the Document/literal variation, called 'document/literal wrapped', has been developed and has become the de facto standard for RPC pattern web services.