Let's talk about ABC and ABC.
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!
There will be results when you fall in love with ABC
Be cautious! I don't want to tell you for sure that he doesn't really love you.
However, such feelings cannot be tested.
Really love, not like this
What are the letters ABC and so on when you fall in love?
A. It is best for your beloved to treat him very well and considerate.
B. Keep the people you love happy, even if they cannot be together.
C. Playing is not very serious.
Select me. Thank you.