WCF study note _ 1

Source: Internet
Author: User

 

① Like the traditional distributed communication framework, WCF essentially provides a cross-process, cross-machine, and cross-network service call.

 

② The WCF Service cannot exist in isolation and must be hosted in a running process. We call the process that carries the WCF Service as the host, the process of specifying a host for a service is called service hosting ). Service hosting includes self-hosting and IIS hosting.

 

③ WCF uses contract-based interaction to implement service autonomy and loose coupling between the client and the server. WCF includes four types of contracts: service contract, data contract, message contract, and error contract.

 

④ In terms of functions, the Service Contract abstracts all operations provided by the Service. From the perspective of message exchange, the service contract defines the message exchange process based on service calls, structure of the request message and reply message, and the message exchange mode.

 

⑤ Define an interface as a service contract by applying the [servicecontract] feature on the interface, and the Members use [operationcontract].

 

⑥ The WCF Service depends on a running process (host). The service host specifies a host for the service. WCF is a message-based communication framework that uses an endpoint-based communication method. An endpoint consists of address, binding, and contract.

 

7. The purpose of service boarding is to start a process and provide a running environment for the WCF Service. Add one or more endpoints for the service to expose them to potential service consumers. The service consumer finally calls the service through a matched endpoint. We can useCodeTo complete all the services.

 

The description of the external WCF Service is published in the form of metadata (metadata. The publishing of metadata in WCF is implemented through servicemetadatabehavior, a special service behavior.

 

When developing a real WCF application, worker generally does not add endpoints and define service behavior directly by coding, but is configured.

Httpgeturl: The address SERVICE_NAME = namespace + class name contract = namespace + interface used to add service references

 

 

 

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.