Microsoft windows communications foundation

What Is Windows Communication Foundation

Windows Communication Foundation (WCF) is a framework for building service-oriented applications. Using WCF, you can send data as asynchronous messages from one service endpoint to another. A service endpoint can be part of a continuously available service hosted by IIS, or it can be a service hosted in an application. An endpoint can be a client of a service that requests data from a service endpoint. The messages can be as simple as a single character or word sent as XML, or as complex as a stream of binary data. A few sample scenarios include:

A secure service to process business transactions.

A service that supplies current data to others, such as a traffic report or other monitoring service.

A chat service that allows two people to communicate or exchange data in real time.

A dashboard application that polls one or more services for data and presents it in a logical presentation.

Exposing a workflow implemented using Windows Workflow Foundation as a WCF service.

A Silverlight application to poll a service for the latest data feeds.

While creating such applications was possible prior to the existence of WCF, WCF makes the development of endpoints easier than ever. In summary, WCF is designed to offer a manageable approach to creating Web services and Web service clients.

Features of WCF

WCF includes the following set of features. For more information, see WCF Feature Details.

Service Orientation

One consequence of using WS standards is that WCF enables you to create service oriented applications. Service-oriented architecture (SOA) is the reliance on Web services to send and receive data. The services have the general advantage of being loosely-coupled instead of hard-coded from one application to another. A loosely-coupled relationship implies that any client created on any platform can connect to any service as long as the essential contracts are met.

Interoperability

WCF implements modern industry standards for Web service interoperability. For more information about the supported standards, see Interoperability and Integration.

Multiple Message Patterns

Messages are exchanged in one of several patterns. The most common pattern is the request/reply pattern, where one endpoint requests data from a second endpoint. The second endpoint replies. There are other patterns such as a one-way message in which a single endpoint sends a message without any expectation of a reply. A more complex pattern is the duplex exchange pattern where two endpoints establish a connection and send data back and forth, similar to an instant messaging program. For more information about how to implement different message exchange patterns using WCF see Contracts.

Service Metadata

WCF supports publishing service metadata using formats specified in industry standards such as WSDL, XML Schema and WS-Policy. This metadata can be used to automatically generate and configure clients for accessing WCF services. Metadata can be published over HTTP and HTTPS or using the Web Service Metadata Exchange standard. For more information, see Metadata.

Data Contracts

Because WCF is built using the .NET Framework, it also includes code-friendly methods of supplying the contracts you want to enforce. One of the universal types of contracts is the data contract. In essence, as you code your service using Visual C# or Visual Basic, the easiest way to handle data is by creating classes that represent a data entity with properties that belong to the data entity. WCF includes a comprehensive system for working with data in this easy manner. Once you have created the classes that represent data, your service automatically generates the metadata that allows clients to comply with the data types you have designed. For more information, see Using Data Contracts.

Security

Messages can be encrypted to protect privacy and you can require users to authenticate themselves before being allowed to receive messages. Security can be implemented using well-known standards such as SSL or WS-SecureConversation. For more information, see Security.

Читайте также:  Windows home premium sony

Multiple Transports and Encodings

Messages can be sent on any of several 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. Alternatively, WCF allows you to send messages over TCP, named pipes, or MSMQ. These messages can be encoded as text or using an optimized binary format. Binary data can be sent efficiently using the MTOM standard. If none of the provided transports or encodings suit your needs you can create your own custom transport or encoding. For more information about transports and encodings supported by WCF see Transports.

Reliable and Queued Messages

WCF supports reliable message exchange using reliable sessions implemented over WS-Reliable Messaging and using MSMQ. For more information about reliable and queued messaging support in WCF see Queues and Reliable Sessions.

Durable Messages

A durable message is one that is never lost due to a disruption in the communication. The messages in a durable message pattern are always saved to a database. If a disruption occurs, the database allows you to resume the message exchange when the connection is restored. You can also create a durable message using the Windows Workflow Foundation (WF). For more information, see Workflow Services.

Transactions

WCF also supports transactions using one of three transaction models: WS-AtomicTransactions, the APIs in the System.Transactions namespace, and Microsoft Distributed Transaction Coordinator. For more information about transaction support in WCF see Transactions.

AJAX and REST Support

REST is an example of an evolving Web 2.0 technology. WCF can be configured to process «plain» XML data that is not wrapped in a SOAP envelope. WCF can also 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).

Extensibility

The WCF architecture has a number of extensibility points. If extra capability is required, there are a number of entry points that allow you to customize the behavior of a service. For more information about available extensibility points see Extending WCF.

WCF Integration with Other Microsoft Technologies

WCF is a flexible platform. Because of this extreme flexibility, WCF is also used in several other Microsoft products. By understanding the basics of WCF, you have an immediate advantage if you also use any of these products.

The first technology to pair with WCF was the Windows Workflow Foundation (WF). Workflows simplify application development by encapsulating steps in the workflow as «activities.» In the first version of Windows Workflow Foundation, a developer had to create a host for the workflow. The next version of Windows Workflow Foundation was integrated with WCF. That allowed any workflow to be easily hosted in a WCF service. You can do this by automatically choosing the WF/WCF project type in Visual Studio 2012 or later.

Microsoft BizTalk Server R2 also utilizes WCF as a communication technology. BizTalk is designed to receive and transform data from one standardized format to another. Messages must be delivered to its central message box where the message can be transformed using either a strict mapping or by using one of the BizTalk features such as its workflow engine. BizTalk can now use the WCF Line of Business (LOB) adapter to deliver messages to the message box.

Microsoft Silverlight is a platform for creating interoperable, rich Web applications that allow developers to create media-intensive Web sites (such as streaming video). Beginning with version 2, Silverlight has incorporated WCF as a communication technology to connect Silverlight applications to WCF endpoints.

The hosting features of Windows Server AppFabric application server are specifically designed for deploying and managing applications that use WCF for communication. The hosting features include rich tooling and configuration options specifically designed for WCF-enabled applications.

Разработка ориентированных на службы приложений с помощью WCF Develop Service-Oriented Applications with WCF

В этом разделе документации приводятся сведения о Windows Communication Foundation (WCF) — унифицированной модели программирования для сборки сервисноориентированных приложений. This section of the documentation provides information about Windows Communication Foundation (WCF), which is a unified programming model for building service-oriented applications. Она позволяет разработчикам построить безопасные надежные решения с поддержкой транзакций и возможностью межплатформенной интеграции и взаимодействия с существующими инвестициями. It enables developers to build secure, reliable, transacted solutions that integrate across platforms and interoperate with existing investments.

Читайте также:  Mercury virtual comport драйвер windows 10

Содержание раздела In this section

Новые возможности Windows Communication Foundation 4,5 What’s New in Windows Communication Foundation 4.5
Описывает новые возможности в Windows Communication Foundation. Discusses features new to Windows Communication Foundation.

Возможности упрощения WCF WCF Simplification Features
Описывает новые возможности, которые упрощают написание приложений WCF. Discusses new features that make writing WCF applications simpler.

Руководство по документации Guide to the Documentation
Описание документации WCF A description of the WCF documentation

Обзор концепции Conceptual Overview
В этом разделе собраны сведения о системе обмена сообщениями Windows Communication Foundation (WCF) и классах, поддерживающих ее использование. Summarizes information about the Windows Communication Foundation (WCF) messaging system and the classes that support its use.

Учебник по начало работы Getting Started Tutorial
Пошаговый учебник, рассказывающий о создании WCF-службы и соответствующего клиента A step by step tutorial to create a WCF service and client

Базовое программирование WCF Basic WCF Programming
Описывает основные принципы создания приложений Windows Communication Foundation. Describes the fundamentals for creating Windows Communication Foundation applications.

Сведения о функции WCF WCF Feature Details
Содержит разделы, которые позволяют выбрать, какие функции или компоненты WCF необходимо применить. Shows topics that let you choose which WCF feature or features you need to employ.

Расширение WCF Extending WCF
Описывает, как изменять и расширять WCF-компоненты времени выполнения Describes how to modify and extend WCF runtime components

Рекомендации и рекомендации Guidelines and Best Practices
Содержит рекомендации по созданию приложений Windows Communication Foundation (WCF). Provides guidelines for creating Windows Communication Foundation (WCF) applications.

Администрирование и диагностика Administration and Diagnostics
Описание возможностей отладки библиотеки WCF Describes the diagnostic features of WCF

Ресурсы операционной системы, необходимые для WCF Operating System Resources Required by WCF
Описывает ресурсы операционной системы, необходимые для библиотеки WCF Describes operating system resources required by WCF

Устранение неполадок при установке Troubleshooting Setup Issues
Содержит рекомендации по устранению проблем, возникающих при установке WCF Provides guidance for fixing WCF setup issues

Переход с удаленного взаимодействия .NET на WCF Migrating from .NET Remoting to WCF
Сравнивает удаленное взаимодействие .NET с WCF и предоставляет инструкции по миграции для использования в рамках стандартных сценариев. Compares .NET Remoting to WCF and provides migration guidance for common scenarios.

Использование средств разработки WCF Using the WCF Development Tools
Описание средств разработки Visual Studio Windows Communication Foundation, которые могут помочь при разработке служб WCF. Describes the Visual Studio Windows Communication Foundation development tools that can assist you in developing your WCFservice.

Средства Windows Communication Foundation Windows Communication Foundation Tools
Описание средств WCF, разработанных с целью упрощения создания, развертывания приложений WCF и управления ими. Describes WCF tools designed to make it easier to create, deploy, and manage WCF applications

Примеры Windows Communication Foundation Windows Communication Foundation Samples
Образцы с инструкциями по различным аспектам использования Windows Communication Foundation Samples that provide instruction on various aspects of Windows Communication Foundation

Глоссарий Windows Communication Foundation Windows Communication Foundation Glossary
Отображает список терминов, относящихся к WCF Shows a list of terms specific to WCF

Общий справочник General Reference
В разделе описаны элементы, используемые для настройки клиентов и служб Windows Communication Foundation. The section describes the elements that are used to configure Windows Communication Foundation clients and services.

Сведения о конфиденциальности Privacy Information
Сведения о конфиденциальности, касающиеся использования WCF Information regarding WCF and Privacy

Учебник. Начало работы с Windows Communication Foundation приложениями Tutorial: Get started with Windows Communication Foundation applications

В приведенной ниже серии руководств представлены инструкции по программированию Windows Communication Foundation (WCF). The following series of tutorials introduce you to the Windows Communication Foundation (WCF) programming experience. При работе с этими учебниками вы получите вводные сведения о шагах, необходимых для создания приложений WCF. Working through these tutorials in order will give you an introductory understanding of the steps required to create WCF applications. После завершения работы у вас будет работающая служба WCF и клиент WCF, который вызывает службу. After you finish, you’ll have a running WCF service and a WCF client that calls the service.

Читайте также:  Динамики вместо наушников windows 10

В учебнике предполагается, что вы используете Visual Studio в качестве среды разработки. The tutorial assumes you’re using Visual Studio as the development environment. Если вы используете другую среду разработки, пропустите инструкции, относящиеся к Visual Studio. If you’re using another development environment, ignore the Visual Studio-specific instructions.

Примеры приложений WCF, которые можно скачать и запустить, см. в разделе Windows Communication Foundation Samples. For sample WCF applications that you can download and run, see Windows Communication Foundation samples. Общие сведения о примерах см. в статье Приступая к работе. For an introduction to the samples, see Getting started sample.

Более подробные сведения о создании служб и клиентов см. в разделе Базовая программирование WCF. For more in-depth information about creating services and clients, see Basic WCF programming.

Учебники по WCF WCF tutorials

В первых трех руководствах описывается, как определить контракт службы WCF, как его реализовать и как разместить его. The first three tutorials describe how to define a WCF service contract, how to implement it, and how to host it. Создаваемая служба является саморазмещенной в консольном приложении. The service that you create is self-hosted within a console application. Службы также можно размещать в Microsoft службы IIS (IIS). You can also host services under Microsoft Internet Information Services (IIS). Дополнительные сведения см. в разделе инструкции. размещение службы WCF в IIS. For more information, see How to: Host a WCF Service in IIS. Хотя для настройки службы в этом учебнике используется код, можно также настроить службы в файле конфигурации. Although you use code to configure the service in the tutorial, you can also configure services within a configuration file.

Вы создаете контракт WCF с определяемым пользователем интерфейсом. You create a WCF contract with a user-defined interface. Этот контракт определяет функциональные возможности, предоставляемые службой. This contract defines the functionality that the service exposes.

После определения контракта его необходимо реализовать с помощью класса службы. After you define a contract, you must implement it with a service class.

Настройте конечную точку для службы и разместите ее в консольном приложении. Configure an endpoint for the service and host the service in a console application. Чтобы служба стала активной, ее необходимо настроить и разместить в среде выполнения. For a service to become active, you must configure it and host it within a run-time environment. Эта среда времени выполнения создает службу и управляет ее контекстом и временем существования. This run-time environment creates the service and controls its context and lifetime.

В следующих двух учебниках описывается создание, Настройка и использование клиентского приложения для вызова операций, предоставляемых службой. The next two tutorials describe how to create, configure, and use a client application to call the operations the service exposes. Службы публикуют доступные метаданные, определяющие сведения, необходимые клиентским приложениям для взаимодействия со службой. Services publish metadata that define the information a client application needs to communicate with the service. Visual Studio автоматизирует процесс доступа к этим метаданным и использует его для создания клиентского приложения для службы. Visual Studio automates the process of accessing this metadata and uses it to construct the client application for the service. Если вы решили не использовать Visual Studio, вместо этого можно использовать средство служебной программы метаданных ServiceModel (Svcutil.exe) . If you decide not to use Visual Studio, you can use the ServiceModel Metadata Utility tool (Svcutil.exe) instead.

Получите метаданные для создания прокси клиента WCF из службы WCF. Retrieve metadata for creating a WCF client proxy from a WCF service. Метаданные извлекаются с помощью Visual Studio для добавления ссылки на службу или можно использовать средство служебной программы метаданных ServiceModel. You retrieve metadata by using Visual Studio to add a service reference or you can use the ServiceModel Metadata Utility tool. Укажите конечную точку, которую клиент использует для доступа к службе. You specify the endpoint that the client uses to access the service.

Используйте прокси клиента WCF для вызова операций службы. Use the WCF client proxy to call the service operations.

Оцените статью