WCF Service programming-common bindings

Source: Internet
Author: User
Tags msmq

WCF defines the bindings that are commonly used in 5.

A. Binding

1. Basic bindings:

Corresponds to the BasicHttpBinding class. Basic binding enables the WCF service to be exposed as a traditional ASMX Web service, enabling the original client to collaborate with the new service. If the client uses a basic binding, the new WCF client can collaborate with the original ASMX service. The basic binding makes the service look like a traditional Web service that can communicate based on basic Web service information. When the client uses binding, the binding allows the new WCF client to collaborate with the original ASMX service.

2.TCP bindings:

Corresponds to the NetTcpBinding class. TCP bindings use the TCP protocol to enable cross-machine communication across the intranet, supporting a variety of features, including reliability, transactional, security, and optimization of communication between WCF. The premise is that WCF must be used by both the client and the server.

3.IPC bindings:

Corresponds to the NetNamedPipeBinding class. It uses named pipes for the transmission of the same machine communication. This is the safest way to bind because it cannot accept calls from outside the machine. The attributes supported by the IPC binding are similar to those supported by the TCP binding, which is also the best-performing binding because the IPC protocol is simpler than the TCP protocol.

4.Web Service (WS) bindings:

Corresponds to the Wshttpbinding class. WS-Bindings are transmitted using HTTP or HTTPS, providing multiple features for Internet-based communication, such as reliability, transactional, and security, all of which follow the WS-* standard.

This binding is used to interoperate with systems that are self-sustaining WS-* standards.

5.MSMQ bindings:

Corresponds to the NetMsmqBinding class. It is transmitted using MSMQ to support broken queue calls.

Two. Format and encoding

Each standard binding uses a different transport protocol than the encoding format, and each binding can use one or more encodings, and the default encoding format is as follows:

name transmission Protocol encoding Type interoperability
BASICHTTPB inding text , MTOM yes
nettcpbind ing tcp binary no
netnamedpi pebinding IPC binary no
wshttpbind ing http/https text , MTOM yes
NetMsmqBinding Msmq Binary No

The text encoding format typically allows a WCF service (client) to communicate with other services (clients) over the HTTP protocol, regardless of the technology it uses and the scope of the communication transmission. The binary encoding format provides the best performance through TCP, IPC, or MSMQ, but it is at the expense of interoperability, because it only supports WCF-to-WCF communication, where TCP, IPC, and MSMQ bindings do not typically require interoperability.

Three. Select Bindings

WCF Service programming-common bindings

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.