Cainiao learning WCF note-Address, wcf note-address

Source: Internet
Author: User
Tags msmq

Cainiao learning WCF note-Address, wcf note-address

 

The endpoint is the most core object of WCF because it carries all the communication functions. The service is released through the corresponding endpoint, and the client calls the service through the endpoint that matches it. The endpoint consists of three elements: Address, binding, and contract ABC.

Address

As one of the three elements of an endpoint, Address is not only used to locate services, but also provides additional addressing information in WCF-based communication, it also contains the Service identity information used for service authentication.

The URL rules of the address are as follows:

[Transfer Protocol (Scheme)]: // [host name | Domain Name | IP address]: [Optional port]/request resources

Example: http://test.com: 81/testservices. svc

The transmission protocol is http.

Host Name: test.com

Port: 81

Request resource path: testservices. svc

 

Typical transfer protocols in WCF:

HTTP/HTTPS (simple request reply, stateless, and connectionless)

Net. Tcp (connected transmission protocol (handshake between client and server), stateful, supporting duplex communication and reliable communication)

Net. Pipe Named Pipe (standard implementation of cross-process communication IPC on Windows and UNIX systems)

Net. Msmq Message Queue MSMQ

 

EndpointAddress

The endpoint is represented by the ServiceEndpoint type in WCF application programming. It has three core attributes: endpoint address, binding, and contract.

The Address attribute of the endpoint Address is an object of the System. ServiceModel. EndpointAddress type. The Address has three typical functions (service identification and positioning. Secondary addressing and Service Identity) correspond to three read-only attributes: URL, Headers, and Identity.

 

ServerHost

WCF uses serverHost to host services, and the hosted services expose them as resources that can be callable and called by adding the endpoints to ServiceHost.

 

Service call

The client uses the Service proxy‑proxy (svcutil.exe) and add Service references. The production core class is inherited from ClientBase <TChannel>.

ClientBase <TChannel> calls to services are actually implemented through the read-only attribute Channel, which indicates the internal proxy. This internal proxy is created through the ChannelFactory <TChannel> object returned by the read-only attribute ChannelFactory.

 

HTTP. SYS

Iis6.0is a new monitoring mechanism (inetinfo.exe) introduced by http.sys2. HTTP. SYS is not in the scope of IIS. It is a network driver used to listen to network requests. HTTP. SYS runs in kernel mode, which greatly improves IIS performance and stability compared with earlier versions.

IIS and other WEB applications can use it as their own listeners to achieve Port Sharing.

The Port Sharing of HTTP. SYS is only for the HTTP protocol. For services using TCP, it must be implemented through other boarding methods.

 


What is the difference between writing a configuration file in the WCF Address Binding Contract and writing it directly in the class?

These are written in the configuration file

Cainiao assists WCF in serializing dataset

Why not? That's right.

The following is a list of features not supported by the WCF test client:

Type: Stream, Message, XmlElement, XmlAttribute, XmlNode, IXmlSerializable interface (including relevant XmlSchemaProviderAttribute attributes), XDocument, XElement, and ADO. NET able type and DataSet type (and its typed Derived classes ).

Duplex protocol.

Transaction.

Security: CardSpace, certificate, and user name/password.

Binding: WSFederationbinding, any context binding and Https binding, and WebHttpbinding (Json Response Message support ).

The WCF test client does not support calling or using a client application. We recommend that you add a reference to the Service in the client application and try again.

Related Article

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.