Difference between Remoting and Webservice: remotingwebservice
Differences between Remoting and Webservice
There is no essential difference in its implementation principle, and there are the following differences in application development:
1. Remoting can flexibly define the Protocol it is based on. If it is defined as HTTP, it is no different from Web Service. Generally, you like to define it as TCP, which is a little more efficient than Web Service.
2. Remoting is not a standard, whereas Web Service is a standard;
3. Remoting generally needs to be started through a WinForm or Windows Service, while Web Service requires IIS to be started.
4. In the VS.net development environment, Web Service calls are encapsulated, which is easier to use than Remoting.
I suggest using Web Services, which is easier to control for development.
Remoting is generally used in C/S systems, while Web Service is used in B/S systems.
The latter is also a common interface for various languages
In the same way, they are all based on XML
- To clearly describe the differences between Web Service and Remoting, I plan to start with their architecture:
Web services are divided into five levels:
1. Http Transmission Channel
2. XML data format
3. SOAP Encapsulation Format
4. Description of WSDL
5. UDDI
In general, the Web Service structure under. NET is relatively simple and easy to understand and apply:
Generally, WebService applications in the. NET structure are based on the. net framework and IIS architecture, so it is relatively easy to deploy (Dispose.
From the implementation perspective,
First, WebService must inherit the class of the method exposed to the client from the base class: System. Web. Services. WebService.
Second, the exposed methods must be preceded by [WebMethod] or [WebMethodAttribute].
Running Mechanism of WebService
First, the client uses the WSDL from the server to the WebService, and claims a Proxy Class on the client)
This proxy class is responsible for Request and Response with the WebService Server
When a data (in XML format) is encapsulated into a data stream in SOAP format and sent to the server, a process object is generated and the SOAP packet that receives the Request is parsed, then, the transaction is processed. After the processing is completed, the computation result is packaged with SOAP, and then the package is used as a Proxy Class sent to the client as a Response. Similarly, this proxy class also parses the SOAP package and then performs subsequent operations.
This is a running process of WebService.
The following is a summary of. net Remoting:
. Net Remoting is a technology developed on the basis of DCOM. Its main purpose is to achieve cross-platform, cross-language, and penetration of Enterprise Firewall, which is also its basic feature, different from WebService, WebService supports HTTP and TCP channels. It can not only transmit SOAP packets in XML format, but also transmit binary streams in the traditional sense, this makes it more efficient and flexible. In addition, it does not depend on IIS. Users can develop and deploy their own host servers (Dispose). Therefore, WebService is actually used in these aspects. net Remoting is a special case.
Two Remoting Channels
There are two main Remoting channels: Tcp and Http. In. Net, the IChannel interface is defined in System. Runtime. Remoting. Channel. The IChannel interface includes the TcpChannel and Http channel types. They correspond to the two types of Remoting channels respectively.
1. remoting is based on callback byreference. You can directly operate on the server object by passing a variable reference. Fast, suitable for intranet (intranet ).
Webservice is nested byvalue and the object value must be passed. Slow speed, can pass FIREWALL, simple configuration, suitable for internet (internet ).
2. In general, remoting is platform-related and requires both the client and server to be. NET. However, the configurable features are better and the protocols can be customized. Web services can communicate across platforms, but must adopt the SOAP protocol.
3. There are two types of Soap messages: rpc and document. The body element of the Document Style contains one or more elements, which can be any content, as long as the recipient understands it. The body element of the rpc style contains the name of the called method or remote procedure, and the element representing the method parameters.
. Net implements the web service and remoting.
In summary, the difference between Remoting and Web Services is:
(1) Support both TCP and HTTP channels, fast transmission speed
(2) xml soap packets can be transmitted and binary streams can be transmitted, with High Efficiency
(3) Remoteing is mainly used for C/S structure projects.
(4) You do not have to rely on the IIS server