Briefly describe the differences between WebService and. Net remoting and their application scenarios .)

Source: Internet
Author: User
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.

Comparison
Again, we will make a comparison between WebService and remoting.
WebService features platform-independent, cross-language (any language that supports XML), and enterprise firewall penetration;
Net WebService is HTTP-based and stateless;
However, its disadvantage is that a Web server needs to be deployed, and the speed is relatively slow;

. Net remoting features
The advantage is that users can use both TCP-based binary stream communication and HTTP-based soap-based communication.
The efficiency is much higher than that of WebService;
Remoting can be used in stateful situations;
However, it has obvious disadvantages.. Net remoting can only be applied to the. NET Framework of Ms.

Usage
If both parties support the. NET technology environment and provide a consistent verification mechanism in the operating system, and pay great attention to the efficiency of communication between the two parties, it is the time for. Net remoting to come on stage. On the contrary, if both parties are in a heterogeneous environment, or the communication mode is stateless, and there is no association before and after ongoing interactions, Web Service is the ideal choice.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.