Document Exchange VS. RPC Models Use RPC-Encoded or Document-Style to interacting one of the things that first determined in the process of creating an architecture. This option will affect the coupling level in the architecture.
RPC (Remote Procedure Call) is actually a call to a remote method, although web services is based on XML, but you can still use a similar RPC to interact with the background service. This interaction is usually a simple request / response process. The client sends a SOAP message containing method calls. The application server receives this request. After conversion is passed to the background object (for example, Java Object, EJB Method, or C # Method). Creating RPC-based web services does not require developers to do anything, because the required work is just a mapping relationship. Note that even if this is adopted, the XML file is only the carrier as a call request.
Using Document-Style, "Business Documents" is transmitted via network lines in XML format. "Business Documents" is not directly mapped to the background method, because they are actually complete, self-contained in business documents. After the web service is received, it may be pre-processed first, and some tasks are executed, then create a response returns. There is usually no direct mapping relationship between XML documents and background objects. In fact, a request is likely to activate several backup components to complete service tasks. Developers must complete a lot of work to implement the processing and mapping of XML data, and the market is basically unable to automate this work. Document-Style often sets a stable, loosely coupled architecture with asynchronous communication protocols.
You can call the RPC vs. Document Style ratio for calling and sending emails. One is a synchronized request response mode, one is an asynchronous event queue processing mode.
In general, you should use the Document Style message in the system architecture. Although RPC mode allows you to quickly implement Web Services, this model often does not provide sufficient support when you work with customers, suppliers and partners exceeding your control. You need an architecture to protect you (and your client application), so you don't receive remote services.
The impact of specific implementation.
The Document Style message has the following advantages:
You can make full use of XML's ability to describe and verify business data, while using RPC mode, XML is only called method and its parameters. There is no need to adopt a closely coupled service protocol between the client and service providers, and the RPC is typically static. When the Signature change of the method called, the client needs to change. Document Style does not have such a strict requirements. Because it is self-contained, Document Style is more suitable for asynchronous processing.
Document Style's largest shortcomings are more difficult, despite this, the flexibility it brings makes money on the cost payment, and more and more platform providers begin to support this way. Organizations such as WS-i are also advocating this way.