Wednesday, November 18, 2009

Unleashed – Winodws Communication Foundation 4.0

The .NET Framework 4 comes with some compelling new features and welcomed improvements in the area of Windows Communication Foundation (WCF).

These WCF enhancements focus primarily on simplifying the developer experience, enabling more communication scenarios, and providing rich integration with one of the good foundation called Windows Workflow Foundation (WF).
WCF in .NET 4 comes with a wide range of specific features. Let us look them at the broader level.

Simplified Configuration

To make WCF configuration as much as easy for developer, the .NET 4 releases comes with a new “default” configuration model that completely removes the need for any WCF configuration.

If you don’t provide any WCF configuration for a particular service, the WCF runtime will automatically configure your service with some standard endpoints and default binding and behavior configurations.

Isn’t it a cool feature which they offered?
Simplification of the WCF configuration section through support for default endpoints, binding and behavior configurations.

These changes make it possible to host configuration-free services, greatly simplifying the developer experience for the most common WCF scenarios.

Discovery

WS-Discovery is an OASIS specification that defines a SOAP-based protocol for dynamically discovering the location of service endpoints at run time.

WS-Discovery defines two primary modes of operation: ad hoc mode and managed mode. In ad hoc mode, clients probe for services by sending multicast messages.

With managed service discovery, you provide a discovery proxy on the network that “manages” the discoverable service endpoints.

WCF in .NET 4 provides a complete implementation of the WS-Discovery protocol, and it provides support for both the ad hoc and managed discovery modes.


Routing Service

WCF in .NET 4 comes with a new class called Routing Service, which provides a generic WCF routing implementation for use within your applications.

The Routing Service can handle routing messages over any WCF-supported protocol using a variety of different messaging patterns.
New framework support for a configurable routing service that you can use in your WCF solutions. Provides features for content-based routing, protocol bridging, and error handling.

REST Improvements


REST is Representational State Transfer. It is the architectural style of building web services.Here they have introduced two things:

1. Automatic help page that describes Restful services to consumers of the service.
2. Support for declarative caching.These features were first introduced by the WCF REST Starter Kit last year and are now making it into the official framework.

Enhances the WCF 3.5 Web programming model with some additional features that simplify REST service development.


Workflow Services

This is the feature which received most attention in .NET 4.0. Here in .net 4.0 they have provided many improvements in integration of WCF and WF.

Although this has been possible since .NET 3.5, .NET 4 has made huge strides in improving the developer experience and providing some of the needed features that were missing in .NET 3.5.For example .NET 4 comes with new-and-improved hosting infrastructure for workflow services.
It also provides a standard workflow control endpoint for managing workflow instances remotely.
Rich new framework support for integrating WCF with WF to implement declarative long-running workflow services. This new programming model gives you the best both frameworks have to offer (WCF & WF).

Tuesday, December 18, 2007

Architecture of Windows communication foundation

Architecture at glance
Here I am talking about the Architecture of WCF in brief.
Architecture of Windows Communication Foundation consists of five layers. These layers from top to down are:
· Application: In this level application is located.
· Contracts: This is the contract layer which is all about the contract between service and clients.In this layer service, data and message contracts and policies are present. In this level services describe themselves to clients.
· Runtime: Behaviors are located in this layer. It is basically used to load all the services.
· Messaging: Different types of channels as well as encoders are here. This layer enables communications channel for services and clients. That means you can define the communication channel for services over here.
· Host: This layer is where host services in different manners, but there are two common ways to host a service.
You can host a service in Internet Information Services (IIS) which is easier than the second approach and which you usually do for any other service. It starts and stops your services automatically.
The second approach is to create executable files (.EXE) for services and start and stop them manually by writing more codes.
This layering allows developers to work on Windows Communication Foundation with different skills because each layer needs different skills.

Programming Approaches
Windows Communication Foundation has simple and easy to write/understand codes. It has many APIs, but beside this only a small amount of these API's is common.
There are three programming approaches in Windows Communication Foundation:
· Imperative: You use programming codes in different languages to accomplish a task. That means you can use different Programming languages.
· Configuration Based: You use configuration files to do things.
· Declarative: You use attributes to declare something.
You can use all this approaches to build the complete application in WCF.
In general, you will declare contracts and behaviors using attributes, configure endpoints, security and some other settings in configuration files and will implement service methods logic in codes using different programming languages.

You can work with the two types of services here:
1) Typed services
2) Untyped services.
In typed services you pass normal objects and data types and/or get normal objects and data types, but in untyped services you pass and get messages to work directly with messages at a lower level.

Thursday, December 6, 2007

Basics of Windows Communication Foundation

Windows Communication foundation is one of the four major features introduced in the Microsoft .Net 3.0 freamework.

Windows Communication Foundation (formerly code-named "Indigo") is a set of .NET technologies for building and running connected systems. It is a new breed of communications infrastructure built around the Web services architecture.
Let us see what all enhancements are made by Microsoft in this coming version:

Windows Communication Foundation has some important enhancements in comparison with preceding technologies.
· It merges all older separate technologies in one place and allows you to do things easier.
· It has rich communication capabilities.
· It comes with many powerful and ready to use enterprise features.
· It can be integrated with other technologies and has great interoperability.

Fundamental Concept

In Windows Communication Foundation your services can have communication with clients by sending and receiving messages.

Windows Communication Foundation consists of three main concepts:
· Services: Programs that respond to clients. They can send or receive messages.
· Clients: Programs that ask for a service. They can send or receive messages.
· Intermediaries: Programs that sit between services and clients. They can work as a firewall or can rout messages. In all cases neither services nor clients need to be aware of intermediaries.

Most of the time, developers deal with services and clients and do not need to work much with intermediaries.
Services and clients have communications by sending and receiving messages, but again most of the time you do not work directly with messages and Windows Communication Foundation does this for you.

Here you should learn that a service can have more than one client and each service can be a client of another service itself.

Each of these main concepts has important concepts in its core or beside it. Some other concepts that you will deal with frequently are Channels, Bindings, Contracts, Behaviors, Addresses and Endpoints.