Let's talk about ABC.

Source: Internet
Author: User
Tags msmq

I have been reading the 13 articles on my WCF journey by instructor Jiang recently. I have finally finished reading the articles, but it is very slow. I remember the Technical Director suggested me to see them when I first came out of work, I started reading 13 articles a few months ago. I wrote the first WCF blog post when I was designing my graduation project. Now I have only published the second blog about WCF. I have graduated for a year and I have changed my work.

The most basic thing about WCF is that I still remember the three elements that constitute an ending point, which can be abbreviated as ABC, namely address, binding, and contract. This can be obtained through the endpoint node when the configuration file is used to configure WCF

<endpoint address="" binding ="ws2007HttpBinding" contract=" Logic.ILogic.IServiceLogic" />

In instructor Jiang's blog post, we mentioned that in addition to address, binding, and contract, there is also a behavior, which appears in the service node, it also works for the entire WCF Service. Let's talk about the following to deepen understanding and understanding.

Address: Any resource on the network must have a location for others to access.UriLocate the endpoint so that the client can find the path when it needs the WCF Service. Similar to socket communication, you need to establish an endpoint. Uri is a very basic Member of the address, and also used to authenticate whether the peer endpoint wants to communicate with the endpoint.Identity.HeadersIt is a member of the public who thinks that the endpoint positioning is the most flexible and scalable.SlaveHeadersIt can be seen that it is a set that contains one or more headers.These headers are added to the header of the SOAP message (soap: Simple Object Access Protocol). Most headers store the address information and play a role in filtering the address. There are two application scenarios: one is the routing of the WCF Service (Routing) and the other is the client authentication. To perform these two operations, you can add the relevant content to the header.

Binding: As a communication framework, communication is essential. c In WCF is short for communication, which means communication and interaction. Binding is mainly responsible for communication, it is responsible for all aspects of the underlying communication. WCF communication is based on the message transmission mode.Encoding(Text/XML, binary, MTOM), messageTransmission Mode(TCP, HTTP, named pipe, MSMQ), differentSecurity Mechanism(SSL, message level security), interoperability (basic profile 1.1, WS, WS-Federation,. net, peer, MSMQ), SupportSession, SupportedTransactions, SupportedDuplexCommunication. You can set different bindings on the binding. The following table describes the binding provided by each WCF by default and their respective descriptions.

Bind

Interoperability

Security

Session

Transactions

Duplex

Transmission Protocol

Encoding format

Description

Basichttpbinding

Basic profile 1.1

(None), Transport, message

None, (none)

None

N/

HTTP/https

Text,

MTOM

One binding, applicable to Web services that comply with WS-basic profile

(For example, Services Based on ASP. NET web services (asmx)

. This binding uses HTTP as the transmission protocol and uses text/XML

As the default message encoding.

Wshttpbinding

WS

Transport, (Message), mixed

(None), Transport, reliable session

(None), yes

N/

HTTP/https

Text,

MTOM

A secure and interoperable binding is suitable for non-duplex service conventions.

Wsdualhttpbinding

WS

(Message)

(Reliable session)

(None), yes

Yes

HTTP

Text,

MTOM

A secure and interoperable binding, applicable to duplex service agreements or

Communication performed by the soap media.

Wsfederationhttpbinding

WS-Federation

(Message)

(None), reliable session

(None), yes

No

HTTP/https

Text,

MTOM

A secure and interoperable binding that supports the WS protocol and enables

Organizations can efficiently Authenticate and authorize users.

Nettcpbinding

. Net

(Transport), message

Reliable session, (Transport)

(None), yes

Yes

TCP

Binary

A secure and optimized binding is used across WCF applications.

Computer Communication.

Netnamedpipebinding

. Net

(Transport)

None, (Transport)

(None), yes

Yes

IPC

Binary

A secure, reliable, and optimized binding for WCF applications

Communication between computers.

Netmsmqbinding

. Net

Message, (transport), both

(None)

(None), yes

No

MSMQ

Binary

One queuing binding is applicable to cross-Computer Communication Between WCF applications.

Netpeertcpbinding

Peer

(Transport)

(None)

(None)

Yes

P2P

Binary

A binding that supports secure communication between multiple computers.

Msmqintegrationbinding

MSMQ

(Transport)

(None)

(None), yes

N/

MSMQ

Binary

One binding, applicable to WCF applications and existing message queues

(Also known as MSMQ) communication between applications across computers.

Ws2007httpbinding

WS

Transport, (Message), mixed

(None), Transport, reliable session

(None), yes

N/

HTTP/https

Text,

MTOM

A secure and interoperable binding can be used for security reliablesession

And the transactionflow binding element.

Ws2007federationhttpbinding

WS

Transport, (Message), mixed

(None), Transport, reliable session

(None), yes

N/

HTTP/https

Text,

MTOM

A secure and interoperable binding derived from ws2007httpbinding

And supports joint security.

Contract: In terms of endpoint configuration, contract is a fully qualified name for an interface. Methods Using the optioncontract feature in this interface can be accessed by the client through WCF, that is to say, contract exposes the operations that can be performed by the WCF Service and tells the client what the WCF Service can do. It is optioncontract. In addition, the data format datacontract that the server and client communicate with is the communication mode (request response mode, one-way mode, and duplex mode) used for message interaction during communication) it is through the configuration of the optoncontract feature. We need additional settings for the data types used in the communication process, which can be set through the datacontract and datamember features, these settings will affect data serialization and deserialization, and ultimately make the data take effect after transmission. The contract configuration has little to do with the config file. Instead, it uses more code than the program.

Behavior: Behavior is not one of the three elements of an endpoint, but its configuration also affects the communication between endpoints, such as the timeout time when the client is called back, used to verify the client identity credenior to the service, service debugging for the specified WCF callback object.

I am not fully familiar with WCF at present. If you have any mistakes above, please kindly advise. Thank you!

Let's talk about ABC.

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.