Press "Enter" to skip to content

WCF study notes

Windows Communication Foundation (WCF) is the framework for building service-oriented applications. With WCF, data can be sent from one service endpoint to another as an asynchronous message. A service endpoint can be part of a continuously available service hosted by IIS or a service hosted in an application. An endpoint can be a service client that requests data from a service endpoint. A simple message can be a single character or a single word sent as XML, and a complex message can be a binary data stream. Some example scenarios include:

  • A security service that handles corporate affairs.
  • A service that provides current data to other services, such as traffic reports or other monitoring services.
  • A chat service that enables two people to communicate or exchange data in real time.
  • A panel application that polls one or more services to find data and present it in a logical representation.
  • Workflows implemented using Windows Workflow Foundation are exposed as WCF services.
  • Poll the service to find the latest data source for the Silverlight application.

Although such applications can be created before WCF exists, WCF makes endpoint development easier than ever. In summary, WCF Design provides a manageable way to create Web services and Web service clients.

WCF features

WCF includes the following feature sets. For more information, see WCF Feature Details .

  • One result of service-oriented use of the WS standard is that WCF allows you to create service-oriented applications. Service-Oriented Architecture (SOA) relies on Web services to send and receive data. These services have the general advantage of loose coupling, rather than hard coding from one application to another. A loosely coupled relationship means that any client created on any platform can connect to all services as long as the basic agreement is met.
  • Interoperability

    WCF implements modern industry standards for Web services interoperability. For more information on supported standards, see Interoperability and Integration.

  • Multiple message modes

    exchange messages in one of several modes. The most common mode is the request/reply mode, where one endpoint requests data from another endpoint and the other endpoint replies. There are other modes, such as one-way messages, where only one endpoint sends a message and does not expect a reply. The more complex mode is the duplex switching mode, in which two endpoints establish a connection and send data back and forth, similar to an instant messaging program. For more information on how to implement different message exchange patterns using WCF, see Agreements .

  • Service Metadata

    WCF supports publishing service metadata in the format specified in industry standards such as WSDL, XML Schema, and WS-Policy. This metadata can be used to automatically generate and configure the client to access WCF services. Metadata can be published via HTTP and HTTPS, or published using the Web Services Metadata Exchange standard. For more information, see the metadata .

  • Data Contracts

    Because WCF is built using the .NET Framework, it also includes code-friendly methods for providing the protocols that you want to enforce. Data contracts are one of the common types of agreements. Essentially, when you code a service using Visual C# or Visual Basic, the easiest way to process the data is to create a class that represents the data entity using the attributes that belong to the data entity. WCF includes an integrated system that processes data in this easy way. After the class representing the data is created, the service automatically generates metadata that enables the client to conform to the type of data being designed. For more information, see Use Data Contracts

  • Security

    encrypts messages to protect privacy, and can require users to authenticate themselves before allowing messages to be received. Security can be achieved using well-known standards such as SSL or WS-SecureConversation. For more information, see Windows Communication Foundation security .

  • Multiple transmission and encoding methods

    can send messages through any of a variety of built-in transport protocols and encodings. The most common protocol and encoding is to send text-encoded SOAP messages using the Hypertext Transfer Protocol (HTTP) for use on the World Wide Web. In addition, WCF allows messages to be sent over TCP, Named Pipes, or MSMQ. These messages can be encoded as text or in an optimized binary format. Binary data can be efficiently transmitted using the MTOM standard. If the delivery or encoding method provided does not meet your needs, you can create your own custom transmission or encoding. For more information about the transport and encoding supported by WCF, see Transport in Windows Communication Foundation .

  • Reliable Queuing Messages

    WCF supports the use of reliable sessions through WS-ReliableMessaging and the use of MSMQ for reliable message exchange. For more information on reliable queued messaging support in WCF, see Queues and Reliable Sessions .

  • Persistent message

    persistence messages are never lost due to communication interruptions. Messages in persistent message mode are always saved to the database. If an outage occurs, the database will allow you to resume the message exchange after the connection is restored. Alternatively, you can use Windows Workflow Foundation (WF) to create persistent messages. For more information, see the workflow service .

  • Transaction

    WCF also supports transactions that use one of three transaction models: WS-AtomicTtransactions, APIs in the System.Transactions namespace, and Microsoft Distributed Transaction Coordinator. For more information on transaction support in WCF, seTransactions .

  • AJAX and REST support

    REST is an example of evolving Web 2.0 technology. You can configure WCF to handle “pure” XML data that is not wrapped in a SOAP envelope. In addition, WCF can be extended to support specific XML formats such as ATOM (a popular RSS standard) and even non-XML formats such as JavaScript Object Notation (JSON).

  • The extensibility

    WCF architecture has a number of extension points. It also provides a number of entry points that allow you to customize the behavior of your service if additional functionality is required. For more information on available extension points, see Extending WCF .

WCF integration with other Microsoft technologies

WCF is a flexible platform. Because of this extreme flexibility, WCF is also available in several other Microsoft products. If you are also using any of these products, you will benefit immediately by understanding the basics of WCF.

The first technology paired with WCF is Windows Workflow Foundation (WF). Workflow simplifies application development by encapsulating the steps in the workflow as “active.” In the first version of Windows Workflow Foundation, developers had to create a host for the workflow. The next version of Windows Workflow Foundation is integrated with WCF, allowing any workflow to be easily hosted in WCF services; this can be achieved by automatically selecting WF/WCF as the project type in Visual Studio 2010 and Visual Studio 2010.

Microsoft BizTalk Server R2 also leverages WCF as a communication technology. BizTalk is designed to receive data in a standardized format and then convert it to another format. Messages must be passed to their central message box, where you can use strict mapping or you can convert messages by using one of the BizTalk features, such as its workflow engine. Currently, BizTalk can use a WCF Line of Business (LOB) adapter to deliver messages to message boxes.

Microsoft Silverlight is a platform for creating interoperable, rich web applications that allow developers to create media-intensive websites such as streaming video. Starting with version 2, Silverlight has joined WCF as a communication technology to connect Silverlight applications to WCF endpoints.

Microsoft .NET Services is a cloud computing initiative that uses WCF to build Internet-enabled applications. Use .NET Services to create WCF services that operate across trust boundaries.

The hosting application server for Windows Server AppFabric is specifically generated for deploying and managing applications that use WCF to communicate. Hosting features include a wealth of tools and configuration options specifically designed to enable WCF-enabled applications.

WCF architectureWCF architecture

Agreement and description

The agreement defines various aspects of the messaging system. A data contract describes each parameter that makes up each message that a service can create or use. Message parameters are defined by an XML Schema Definition Language (XSD) document, which allows any system that understands XML to process the document. Message contracts use the SOAP protocol to define specific message parts that can be implemented when interoperability requires finer control over certain parts of the message. The service contract specifies the actual method signature of the service and is distributed as one of the supported programming languages ​​(for example, Visual Basic or Visual C#).

Policies and bindings specify the conditions required to communicate with a service. For example, a binding must (at least) specify the transport (such as HTTP or TCP) and encoding used. Policies include security requirements and other conditions that must be met in order to communicate with the service.

Service runtime

The service runtime layer contains behavior that occurs only during the actual operation of the service, that is, the runtime behavior of the service. Contains the number of messages processed by the control, and the number of messages changes if the demand for the service grows to a preset limit. The error behavior specifies the action that should be taken when the service has an internal error, such as controlling the information passed to the client (too much information will provide an opportunity for the malicious user to attack). Metadata behavior controls whether and how metadata is provided to the outside. The instance behavior specifies the number of service instances that can be run (for example, a singleton specifies that all messages can only be processed with a single instance). With transaction behavior, you can roll back transactions that have already been processed on failure. Scheduling behavior is used to control how the WCF infrastructure processes messages.

Runtime processes can be customized with extensibility features. For example, the message checking function is used to check various parts of a message, and the parameter filtering function can be used to perform a preset operation based on a filter acting on the message header.

Messaging

The messaging layer consists of channels. A channel is a component that processes a message in some way (for example, by authenticating a message). A set of channels is also known as a “channel stack.” The channel operates on messages and message headers. This is different from the service runtime layer, which mainly deals with the processing of the message body content.

There are two types of channels: transport channels and protocol channels.

The transport channel reads and writes messages from the network (or some other communication point externally). Some transport channels use an encoder to convert a message (represented as an XML Infoset) into a representation of the byte stream used by the network, or to convert a byte stream representation into a message. Examples of transport channels include HTTP, Named Pipes, TCP, and MSMQ. Examples of encoding include XML and optimized binaries.

Protocol channels often implement message processing protocols by reading or writing other headers of the message. Examples of such protocols include WS-Security and WS-Reliability.

The messaging layer describes the possible formats and exchange patterns of the data. WS-Security is an implementation of the WS-Security specification that enables security at the message layer. Message delivery is guaranteed through the WS-Reliable Messaging channel. The encoder provides a large number of encodings that can be used to meet the needs of the message. The HTTP channel specifies that the message should be delivered using the Hypertext Transfer Protocol. Similarly, the TCP channel specifies the TCP protocol. The transaction flow channel controls the message mode that has been transacted. Interprocess communication is possible through named pipe channels. Use the MSMQ channel to interoperate with MSMQ applications.

Hosting and activation

The final form of service is the program. Similar to other programs, the service must be run in an executable. This is called a “self-hosting” service.

Some services, such as IIS or Windows Activation Service (WAS), are “hosted,” that is, run in an external agent-managed executable. With WAS, you can automatically activate a WCF application when it is deployed on a computer running WAS. The service can also be run manually in the form of an executable (.exe file). The service can also run automatically as a Windows service. COM+ components can also be hosted as WCF services.

30 Comments

  1. site site June 5, 2026

    Hi there very nice blog!! Man .. Beautiful ..
    Amazing .. I will bookmark your site and take the feeds additionally?
    I’m glad to seek out numerous useful information here within the publish, we need work out extra techniques on this regard, thank you for sharing.
    . . . . .

  2. nipple clamps UK nipple clamps UK June 5, 2026

    When someone writes an article he/she keeps the image
    of a user in his/her mind that how a user can be aware of
    it. Thus that’s why this paragraph is outstdanding.
    Thanks!

  3. Everyone loves what you guys are up too. This sort of clever work and reporting!

    Keep up the very good works guys I’ve added you guys to my blogroll.

  4. 456BD 456BD June 6, 2026

    স্লট গেম সবসময়ই 456 bd ক্যাসিনোর সবচেয়ে জনপ্রিয় গেম ধরণের একটি। তাই 456BD-এ আমরা সেরা স্লট গেম প্রদানকারী বেছে নিই – 456BD-এর স্লট পণ্যসমূহ কোম্পানির সৃজনশীলতা ও উত্তেজনার সীমানা অতিক্রম করার প্রতিশ্রুতির প্রমাণ। বৈচিত্র্যময় থিম, মনোমুগ্ধকর গ্রাফিক্স এবং উদ্ভাবনী বৈশিষ্ট্যসহ 456BD স্লট খেলোয়াড়দের একটি অতুলনীয় রোমাঞ্চকর অভিজ্ঞতা প্রদান করে। প্রাচীন সভ্যতা থেকে ভবিষ্যতের জগৎ, ক্লাসিক ফল মেশিন থেকে বর্ণনামূলক অ্যাডভেঞ্চার পর্যন্ত, 456BD গেমসের স্লট পণ্য বিভিন্ন পছন্দ পূরণ করে।

  5. payday loan immediate payday loan immediate June 7, 2026

    Spot on with this write-up, I really feel this site needs far more attention. I’ll probably be back again to read more, thanks for the info!

  6. barbecue and cooking barbecue and cooking June 8, 2026

    I visited various blogs but the audio feature for
    audio songs existing at this web page is in fact wonderful.

  7. 비아그라 구매 비아그라 구매 June 9, 2026

    At this moment I am going away to do my breakfast,
    afterward having my breakfast coming yet again to read other news.

  8. 456BD 456BD June 9, 2026

    স্লট গেম সবসময়ই 456bd ক্যাসিনোর সবচেয়ে জনপ্রিয় গেম ধরণের একটি। তাই 456BD-এ আমরা সেরা স্লট গেম প্রদানকারী বেছে নিই – 456BD-এর স্লট পণ্যসমূহ কোম্পানির সৃজনশীলতা ও উত্তেজনার সীমানা অতিক্রম করার প্রতিশ্রুতির প্রমাণ। বৈচিত্র্যময় থিম, মনোমুগ্ধকর গ্রাফিক্স এবং উদ্ভাবনী বৈশিষ্ট্যসহ 456BD স্লট খেলোয়াড়দের একটি অতুলনীয় রোমাঞ্চকর অভিজ্ঞতা প্রদান করে। প্রাচীন সভ্যতা থেকে ভবিষ্যতের জগৎ, ক্লাসিক ফল মেশিন থেকে বর্ণনামূলক অ্যাডভেঞ্চার পর্যন্ত, 456BD গেমসের স্লট পণ্য বিভিন্ন পছন্দ পূরণ

  9. Hey There. I found your weblog the use of msn. This is a really neatly written article.

    I’ll make sure to bookmark it and come back to read extra of your helpful information. Thank you
    for the post. I will definitely comeback.

  10. ibosport ibosport June 10, 2026

    I was skeptical, but after several months of learning crypto basics, the stable performance convinced me.

  11. CH加密中心学院 CH加密中心学院 June 10, 2026

    对于新手用户,建议把Cryptify Hub当作“币圈工具入门索引”。先从它的导航链接里访问一些知名度高、历史悠久的工具(如Etherscan、DefiLlama、RabbitHole等),熟悉各类工具的基本功能。但请记住,它不负责教你用这些工具——教学不在它的职责范围内。

  12. RR88 RR88 June 11, 2026

    RR88 chơi game tại RR88 uy tín số 1 việt nam

  13. RR88 RR88 June 11, 2026

    RR88 chơi game tại RR88 uy tín số 1 việt nam, tặng 1 tỷ

  14. uu88 uu88 June 11, 2026

    uu88tham gia nhà cái này là được tặng 1 tỷ , cam kết uy tín 100%

  15. 爱APP 爱APP June 11, 2026

    Right now it seems like BlogEngine is the best blogging platform out there right now. (from what I’ve read) Is that what you’re using on your blog?

  16. rr 88 rr 88 June 11, 2026

    chơi rr 88tham gia nhà cái này là được tặng 1 tỷ , cam kết uy tín 100% nhận được

  17. 프리카지노 프리카지노 June 12, 2026

    I switched from another service because of the stable performance and intuitive UI. The mobile app makes daily use simple.

  18. 8kbet 8kbet June 12, 2026

    vào 8kbet chơi vui mỗi ngày, nhận quà vip luôn

  19. 伯爵体育赛事平台 伯爵体育赛事平台 June 12, 2026

    Hello there, You have done a great job. I’ll certainly digg it and in my opinion suggest to my friends. I’m sure they will be benefited from this site.

  20. j88 j88 June 12, 2026

    tham gia j88 chơi là thắng, thua tự chịu chứ kêu kêu cl

  21. 乐博体育彩票官网 乐博体育彩票官网 June 12, 2026

    Hi there, You’ve performed a great job. I will certainly digg it and individually suggest to my friends. I’m confident they will be benefited from this web site.

  22. ma túy ma túy June 13, 2026

    buy ma túy bấm vô đây, có đủ loại để lựa chọn

  23. cu giả cu giả June 13, 2026

    mua cu giả bấm vô đây, có đủ loại để lựa chọn rung 7 cấp độ

  24. 123b 123b June 14, 2026

    mua 123b bấm vô đây, có đủ loại để lựa chọn rung 7 cấp độ vip

  25. trx wallet trx wallet June 18, 2026

    This text is worth everyone’s attention. Where can I find out more?

  26. 世足轉播免費看 世足轉播免費看 June 18, 2026

    世足轉播免費看
    世足直播線上看是許多球迷在世界盃期間最常搜尋的關鍵字之一。相比只看比分或賽後新聞,直播能讓觀眾即時感受比賽節奏,從開場哨響到補時結束,每一個攻防轉換都充滿張力。世界盃之所以吸引人,就是因為比賽結果難以預測,強隊可能失常,黑馬也可能一路晉級,這正是足球最迷人的地方。

    想要順利世足直播線上看,首先要掌握完整賽程。世界盃比賽場次多,時間分散,如果沒有事先規劃,很容易錯過自己支持的球隊。RG直播整理世界盃賽事與直播資訊,讓使用者可以快速查看熱門對戰、比賽時間與觀看重點,不論是在家、通勤或休息時間,都能更方便追蹤賽事動態。

    線上看直播時,穩定度與操作便利性非常重要。熱門賽事開打時,觀眾流量通常會瞬間增加,如果直播頁面不清楚或載入不順,就會影響看球情緒。透過 RG直播掌握世足直播線上看資訊,可以減少搜尋時間,把注意力放在比賽本身。對球迷來說,能即時看到進球、VAR 判決、紅黃牌與關鍵撲救,才是完整的觀賽體驗。

    世界盃不只是體育賽事,也是朋友聚會、社群討論與球迷交流的重要話題。從小組賽到冠軍戰,每一階段都有不同看點。想要掌握世足直播線上看資訊,可以透過 RG直播追蹤最新賽程與熱門比賽,輕鬆享受世界盃每一場精彩對決。

Leave a Reply

Your email address will not be published. Required fields are marked *