Skip to main content

New Features in WCF 4

1. New features in WCF4

a. Simplified configuration

b. Discovery

c. Routing Service

d. WCF WebHttp Services

e. Workflow Services

f. Advanced Features

2. WCF 3.x required at least one endpoint to be defined. WCF 4 comes with a default endpoint for each address/contract.

3. The moment you configure even a single endpoint for your service all the default endpoint will disappear.

4. You could also further add default endpoints in code after configuring your custom endpoints using AddDefaultEndpoints().

5. To modify default behaviors simply add a behavior and do not give any name to it.

6. We no longer need .svc files and instead use the configuration as follows

a. System.serviceModel/serviceHostingEnvironment/serviceActivations/Add

<add relativeAddress=”Greeting.svc” Service=”GreetingService” />

7. There are two types of Service Discovery

a. Adhoc – within local subnet (LAN) using UDP

b. Managed – outside but managed network using discovery proxy.

8. Also there are two scenarios –

a. Service comes up and announces over UDP, Client comes up and searches for the endpoint for the services, finds it and uses it.

b. Client is already up, Service comes up and announces itself, Client gets a notification of these announcements and uses it.

9. ManagedDiscoveryBase class can be used for implementing a managed service discovery for outside LAN scenarios.

10. Routing Service Capabilities include –

a. Protocol bridging (Client talks to Routing service over http and Routing service to actual service over tcp / named pipes)

b. Error handling (router can be configured with backup endpoints)

c. Multi-cast routing (router sends to multiple endpoints)

11. WCF Rest Starter kit is not WCF WebHttp Services in WCF 4

12. WebHttp now provides –

a. Automatic help page like a SOAP description page we now have one for REST Services.

b. Full support for HTTP Caching

c. Message format selection – so we can easily choose xml or json.

d. HTTP Faults – to send out http error/status codes instead of just the faults using WebFaultException.

e. Add support for routing

f. New REST Project templates

13. To enable Automatic help and format selections

a. User system.servicemodel/standardendpoints/webhttpendpoint/

StandardEndpoint with helpEnabled = true and automaticFormatSelectionEnabled = true

14. WebHttp uses following verbs whose semantics should not be changed –

a. GET with ID

b. GET for all

c. POST for Add

d. DELETE for delete

e. PUT for update

Comments

Popular posts from this blog

Notes on Castle MonoRail

  Sometime back I was doing a small POC on Castle MonoRail. So here are my quick notes on this. MonoRail is an MVC Framework from Castle inspired by ActionPack. MonoRail enforces separation of concerns with Controller handling application flow, models representing data and View taking care of the presentation logic. To work with MonoRail you need Castle Assemblies. It also utilizes nHibernate You can use Castle MonoRail Project Wizard or create the project manually. Project structure – Content Css Images Controllers HomeController.cs Models Views Home \ index.vm Layouts \ Default.vm ...

Workflow Foundation 4 - Part 3 - Data storage and management

This is my third post on WF4. First one was an introductory post on WF4 and in second one we focused on executing workflows. In the this post I am going to focus on the topic of data storage and management. Every business process or flow depends on data. When you think of data there are three elements to it as listed below - Variables - for storing data Arguments - for passing data Expressions - for manipulating data. Let us first look at the variables. Variables are storage locations for data. Variables are declared before using them just like in any other languages like C# or VB.Net. Variables are defined with a specific scope. When you create a variable in an activity the scope of the variable becomes that activity's scope. Variables can also have access modifiers like None, Mapped or ReadOnly. Let us look at an example where we will create two variables and assign a scope to them along with access modifiers. //Declare a sequence activitiy Sequence seqWf = new Sequence(); //de...

Introduction to Workflow Foundation 4 (WF4)

I finally decided to pick-up my blogging once more. Since I have been trying to learn Windows Workflow Foundation 4 (WF4) I thought I might as well start off with this topic. WF4 is a development framework that enables you to create a workflow and embed it in a .Net application. It is neither an executable application nor a language. It provides a set of tools for declaring a workflow, activities to create your logic and to define control flow and a runtime for executing the resulting application definition. It also provides services for persistence of state, tracking and bookmarking. You can create your workflow directly in code, in mark-up or in a combination of both. Workflow provide us with two major advantages - Creating unified application logic. Making application logic scalable. Workflow Authoring styles - Sequential Workflow executes a set of contained activities in a sequential manner. Workflow Foundation was introduced in the .Net 3.0 and updated in 3.5. In .net 4 it has bee...