Now available Download the AppFabric WCF Service Template C#
Windows Communication Foundation (WCF) is Microsoft’s unified programming model for building service-oriented applications. Windows Server AppFabric provides tools for managing and monitoring your web services and workflows.
The AppFabric WCF Service template brings these two products together providing the following features:
To build and test an AppFabric WCF Service you will need the following:
1: public string SayHello(string name)
2: {
3: // Output a warning if name is empty
4: if (string.IsNullOrWhiteSpace(name))
5: AppFabricEventProvider.WriteWarningEvent(
6: "SayHello",
7: "Warning - name is empty");
8: else
9: AppFabricEventProvider.WriteInformationEvent(
10: "SayHello",
11: "Saying Hello to user {0}",
12: name);
13:
14: return "Hello " + name;
15: }
1: <microsoft.applicationServer>
2: <monitoring>
3: <default enabled="true" connectionStringName="ApplicationServerMonitoringConnectionString" monitoringLevel="EndToEndMonitoring" />
4: </monitoring>
5: </microsoft.applicationServer>
6:
7: <system.serviceModel>
8: <diagnostics etwProviderId="830b12d1-bb5b-4887-aa3f-ab508fd4c8ba">
9: <endToEndTracing propagateActivity="true" messageFlowTracing="true" />
10: </diagnostics>
11: <behaviors>
12: <serviceBehaviors>
13: <behavior>
14: <etwTracking profileName="EndToEndMonitoring Tracking Profile" />
15: <serviceMetadata httpGetEnabled="true" />
16: </behavior>
17: </serviceBehaviors>
18: </behaviors>
19: </system.serviceModel>
To see the events in Windows Server AppFabric you need to deploy the Web project to IIS or modify your project to host the solution in the local IIS Server. For this example you will modify the project to host with the local IIS server.
Run Visual Studio as Administrator
If you are not running Visual Studio as Administrator, exit and restart Visual Studio as Administrator and reload your project. For more information see Using Visual Studio with IIS 7.
Happy Coding! Ron Jacobs http://blogs.msdn.com/rjacobs Follow me on twitter: http://twitter.com/ronljacobs