Learn about WCF-Basics

Source: Internet
Author: User

Windows Communication Foundation(WCF) is a comprehensive layered architecture for service-oriented programming. The top layer of the architecture is called the service model layer. Users can use the minimum time and experience to build their own software product and external communication models. It enables developers to build a secure, trusted, and transactional solution across platforms, and to be compatible with existing systems. I will use several articles to learn about WCF, hoping to help beginners learn about it.

From a functional perspective, WCF can be regarded as a union of asmx,. Net remoting, Enterprise Service, WSE, MSMQ, and other technologies:

WCF Service

An important principle of software design: software components must be specifically designed and optimized for specific tasks. If we want to build a management software, imagine that if a software is very dependent on external communication, we cannot consider the management software's logic of external communication within the management system. Therefore, the communication task must be delegated to different components. In terms of WCF, this component is called a WCF Service. In a more general sense, the WFC service is the software responsible for communicating with the outside world.

A WCF Service consists of the following three parts:

Service Class: A class marked with the [servicecontract] attribute, which may contain multiple methods. Except for marking some unique attributes of WCF, this class is no different from general classes.
HOST: it can be an application, such as a Windows service. It is the running environment of the WCF Service.
Endpoints: It can be either a group or a group. It is the core element of communication implemented by WCF.

In subsequent instance applications, I will also mention the above three concepts.

WCF endpoint

IEach WCF Service must provide different access points for different communication scenarios. These access points are called WCF endpoints. That is, the endpoint mentioned above. Each endpoint has a binding, an address, and a contract:

(1) binding: specify how the endpoint communicates with the outside world, that is, specify the communication protocol for the endpoint.

  • Transmission Protocol: the endpoint communicates with the client through the transmission protocol. HTTP and TCP are commonly used.
  • Encoding protocol: before entering the communication link, the endpoint and the Customer Code the communication through the encoding protocol. A common example is the binary code of an XML file.
  • Security protocol: the endpoint and the user use the security protocol to ensure communication security. For example, encrypted transmission channels are required for sensitive information. HTTPS and WS-Security are common.

    (2) Address: an endpoint address specifies the location of the endpoint. If you use the endpoint to communicate with WCF, you must specify the network address.

    (3) Contract: a contract on an endpoint specifies the operations that users using this endpoint can access the WCF Service.

    In WCF, The serviceendpoint class represents an endpoint. The endpoint, binding, and contractdescription types in the class correspond to the endpoint addresses, bindings, and contracts respectively.

    WCF Service Model

    Finally, let's briefly describe the service model of WCF.

    WCF is a layered architecture. The top layer of the architecture is called a service model, which is used for modeling WCF services.

    The WCF Service Model provides three important means to model your own WCF Service:

    (1) property-Oriented Programming: the WCF Service Model includes a set of metadata attributes, which can represent corresponding entities, such as attributes, interfaces, and classes.

    (2) configuration-Oriented Programming: the WCF Service Model comes with a convenient configuration language, which can be used for modeling in the configuration file.

    (3) conventional command programming: the WCF Service Model includes a set of convenient hosting classes that can be used to model services.

     

    Let's talk about the basic knowledge. The next article will introduce how to develop the WCF Service.

  • Author: Brian)
    Article Source: http://www.cnblogs.com/gaoweipeng/archive/2009/04/30/1447226.html

    You are welcome to reprint it. Please indicate the source when you reprint it. Thank you for your cooperation.

    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.