[Pin to top] Establishment of a WCF framework application in ASP. NET and understanding of the Framework Concept

Source: Internet
Author: User
Windows Communication Foundation (WCF) is used to build service-oriented applications. Program . It is a group of data communication application development interfaces developed by Microsoft and can be translated as windows communication interfaces. It is part of the. NET Framework and introduced by. NET Framework 3.0. Features of WCF A result of service-oriented usage of WS standards is that WCF allows us to create service-oriented applications. Service-Oriented Architecture (SOA) relies on web services to send and receive data. These services have the common advantages of loose coupling, rather than hard coding from one application to another. Loose coupling means that any client created on any platform can connect to all services as long as it complies with the Basic Agreement. Ø interoperability WCF implements the modern industry standard for Web Service interoperability, that is, the intention of the WebService we mentioned earlier, a communication specification. Various message modes exchange messages in multiple modes. The most common mode is the request/reply mode. One of the endpoints requests data from the other endpoints and the other endpoints replies. There are other modes, such as one-way messages, where only one endpoint sends messages without expecting a reply. The more complex mode is the duplex switching mode. In this mode, two endpoints establish a connection and send data back and forth, similar to the instant messaging program. Service metadata WCF supports Publishing Service metadata in the format specified in industry standards (such as WSDL, XML architecture, and WS-policy. This metadata can be used to automatically generate and configure the client to access the WCF Service. Metadata can be published through HTTP and https, or metadata can be published using the Web Service metadata exchange standard. Ø data contract (Data contract) Because WCF is generated using. NET Framework, it also includes Code A friendly method used to provide the protocol to be enforced. Data protocols are a common type of protocols. Essentially, when we use Visual C # Or Visual Basic to encode the service, the simplest way to process data is to create a class that represents the data entity using the attributes of the data entity. WCF includes a comprehensive system that processes data in this simple way. After a data class is created, the service automatically generates metadata that allows the client to conform to the designed data type. Persistent messages are never lost due to communication interruption. Messages in persistent message mode are always stored in the database. If the connection is interrupted, the database allows us to resume message exchange after the connection is restored. You can also use Windows Workflow Foundation (WF) to create persistent messages. Security-multiple transmission and encoding methods-reliable queuing of messages-Support for transactions-Ajax and rest-Support for extensibility Public class helloservice: Ihelloservice { Public void dowork () { } } The Code defines a class named helloservice, which implements Interface . This interface is called in WCF Contract (contract or agreement ") . Below is Ihelloservice Code in: Ihelloservice. CS: Namespace wcfserver { // Note: You can use the "RENAME" command on the "refactoring" menu to change the Interface Name "ihelloservice" in the Code and configuration file at the same time ".   [Servicecontract] // Service Contract Public interface ihelloservice { [Operationcontract] // Contract publication Method Void dowork (); } } [Servicecontract] Public interface ihelloservice { [Operationcontract] Void dowork (); [Operationcontract] String Hello (); // Do not write public } Release of the WCF Application Release steps: 1. Right-click the WCF server program and choose publish" 2. Select the release method-"File System" 3. Select the target location, for example, D: \ wcfweb. 4. Click publish. 5. Create a new website in IIS in the same way as the General website publishing method.

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.