Original link: Three kinds of sending acceptance protocols in Web services soap/http get/http POST
I. Three kinds of sending acceptance protocols in Web services soap/http get/http POST
In Web services, there are three options for sending and receiving information: Soap,http get,http POST, but SOAP supports a wider range of data types
Soap=rpc+http+xml
Soap simple understanding, is such an open protocol Soap=rpc+http+xml: The use of HTTP as the underlying communication protocol; RPC as a consistent call path, XML as a data transfer format, Allows service providers and service customers to communicate over the Internet through a firewall. RPC's descriptive might not be accurate, since soap was conceived to be agnostic and independent of the platform, and each remote invocation through the network could be encapsulated by soap, including DCE (distributed Computing Environment) RPC calls,com/dcom CALLS, CORBA CALLS, JAVA calls,etc.
SOAP uses HTTP to deliver XML, although HTTP is not an efficient communication protocol, and XML requires additional file parsing (parse), both of which make trading much slower than other scenarios. However, XML is an open, robust, and semantically informative mechanism, and HTTP is a wide range of issues that can be avoided by many firewalls, so that soap is widely used. But if efficiency is important to you, then you should think more about other ways than SOAP.
There are 3 ways to call WebService
1). HttpGet
2). HttpPost
3). HttpSoap
Second, the difference between Web Service and remoting
There is no essential difference between the principle of implementation and the following differences in the application development level:
1, remoting can flexibly define the protocol on which it is based, if it is defined as HTTP, then there is no difference with Web service, generally like to be defined as TCP, which is slightly more efficient than Web service
2, remoting is not a standard, and Web service is the standard;
3, remoting generally need to start through a WinForm or Windows services, and Web service requires IIS to start.
4, in the Vs.net development environment, dedicated to the invocation of the Web service is encapsulated, using more than remoting convenient
I recommend using a Web service better, which is easier to control for development
Remoting generally used in the system of C/s, Web service is used in B/s system
The latter is also the universal interface of each language
The same is all based on XML
A) from their architecture:
A WEB service is broadly divided into 5 levels:
1. HTTP Transport Channel
2. Data format FOR XML
3. SOAP Encapsulation Format
4. How WSDL is described
5. UDDI
Generally speaking, the WEB service structure under. NET is relatively simple and easy to understand and apply:
Generally speaking in. NET architecture, WebService applications are based on the. NET Framework and the IIS architecture, so deploying (Dispose) is relatively easy.
b) from the perspective of implementation,
First webservice must inherit from the class of the method exposed to the client: System.Web.Services.WebService this base class
The next exposed method must be preceded by [WebMethod] or [WebMethodAttribute]
Operation Mechanism of WebService
First the client obtains the WebService WSDL from the server, while the client claims a proxy class
This proxy class is responsible for request and response with the WebService server
When a data (XML format) is encapsulated in a SOAP-formatted stream to the server, a process object is generated and the SOAP packet that receives the request is parsed, then the thing is processed, and the result is soap-wrapped after processing ends. And then the package as a response sent to the client proxy class, similarly, the proxy class will also parse the SOAP packet, followed by subsequent operations. This is a running process for webservice.
The following is a summary of the. NET Remoting:
. NET Remoting is a technology developed on the basis of DCOM, its main purpose is to achieve cross-platform, cross-language, penetrate the enterprise firewall, which is also his basic features, and WebService is different, it supports HTTP and TCP channels, And it can transfer not only the XML-formatted SOAP packet, but also the traditional binary stream, which makes it more efficient and more flexible. And it does not depend on IIS, users can develop (development) themselves and deploy (Dispose) their favorite host server, so in terms of these aspects webservice is actually a special case of. NET Remoting.
Two kinds of channels of remoting
There are two main types of remoting channels: TCP and HTTP. In. NET, the IChannel interface is defined in System.Runtime.Remoting.Channel. The IChannel interface includes the TcpChannel channel type and the HTTP channel type. They correspond to each of these two types of remoting channels
1. Remoting is marshbyreference and can be used to refer to a variable and operate directly on the server object. Fast, suitable for intranet (intra-enterprise Internet).
WebService is Marshbyvalue, the value of the object must be passed. Slow, can over firewall, configuration is relatively simple, suitable for the internet (Internet).
2. Generally speaking, remoting is related to the platform, requiring both the client and the server to be. NET, but the configurable features are better and the protocols can be customized. Web service can communicate across platforms, but the SOAP protocol must be used.
3. SOAP message has both RPC and document styles. the BODY element of a document style contains one or more elements, which can be anything, 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 that represents the method parameter.
The implementation of. NET for these two styles is Web service and remoting.
The difference between remoting and Web services in general is that:
(1) Support both TCP channel and HTTP channel, fast transmission speed
(2) A SOAP packet that can transmit XML and a binary stream, high efficiency
(3) remoteing is mainly used for C/s structure project
(4) Do not necessarily rely on the IIS server
Transfer to-web service three kinds of send accept protocol SOA, HTTP GET, HTTP POST