Search Wiki:

WCF Samples

Windows Communication Foundation (formerly code-named "Indigo") is a set of .NET technologies for building and running connected systems. This section contains articles, samples and presentations on this technology.

Technology Samples

AzMan Authorization
Shows how to enable server to use AzMan for authorization using custom authorization manager. The sample requires the installation of the AzMan component on the machine. For information on how to install AzMan, please see

BizTalk Services Picture Syndication
This sample shows how to integrate the PictureServices sample with BizTalk Services. It is based on the R10 release of BizTalk Services, and version 1.2 of PictureServices.
Prerequisites: Picture Services 1.2, the BizTalk Services R10 SDK, and an account on BizTalk Services.

Credentials per Channel
Shows how to configure client credentials on a per-channel basis instead of a per-ChannelFactory basis.

CredMan UI - Inside Timeout
Shows how to pop-up the CredMan UI to obtain username and password using custom client credentials. This sample displays the CredMan dialog inside the sending timeout

CredMan UI - Outside Timeout
Shows how to pop-up the CredMan UI to obtain username and password using custom client credentials. This sample displays the CredMan dialog outside of the sending timeout using the new RC1 feature - InteractiveChannelInitializers collection

Custom Security Algorithm Suite
This sample illustrates how one can implement a custom SecurityAlgorithmSuite. In particular, the custom suite implemented in the sample enables a service to enforce a minimum client cert key size of 2048 bits (all WCF SecurityAlgorithmSuites provided out-of-the-box enforce a minimum of 1024 bits).

Custom Token Issuance
Shows how to create a custom token and issue a custom token to a client. It also demonstrates using transport security for obtaining security token and issuence of SAML token.

Logon Token Cache
Shows how to enable server to cache the logon token. The sample also shows how to remove an existing token from the cache or flush the token cache completely.

Pictures Services
Pictures Services is a simple Windows Communication Foundation (WCF) service that is returns pictures from the computer in which the service is being hosted.

Reserialize SAML
STS issues a SAML 1.1 token to a client. The Client presents the token to a proxy service. The Proxy Service uses the SAML token to secure the message to the real service at the backend.

SAML Token
STS issues a SAML 2.0 token to a client. Client presents the token to a service. Client code has no custom code to receive and forward a SAML 2.0 token.

WCF Architecture Code
The code samples from the TechEd 2007 Barcelona session titled: "SBP401 - Architecture of Microsoft Windows Communication Foundation and Common Extensibility Points".

WCF Dynamic Proxy
The DynamicProxy allows you to create the dynamic WCF client at runtime by specifying the WSDL URI of the service. The DynamicProxy does not depend on the precompiled proxy or configuration. The DynamicProxy uses the MetadataResolver to download the metadata from the service and WsdlImporter to create the contract and binding at runtime. The compiled dynamic proxy can be used to invoke the operations on the service using reflection.

The example shows how you can the dynamic proxy to invoke operations that use simple types and complex types. The flow of usage is as following.
1. Create the ProxyFactory specifying the WSDL URI of the service.
DynamicProxyFactory factory = new DynamicProxyFactory("http://localhost:8080/WcfSamples/DynamicProxy?wsdl");
2. Browse the endpoints, metadata, contracts etc. factory.Endpoints factory.Metadata factory.Contracts factory.Bindings
3. Create DynamicProxy to an endpoint by specifying either the endpoint or contract name. DynamicProxy proxy = factory.CreateProxy("ISimpleCalculator");
DynamicProxy proxy = factory.CreateProxy(endpoint);
4. Invoke operations on the DynamicProxy dobule result = (dobule)proxy.CallMethod("Add", 1d ,2d);
5. Close the DynamicProxy proxy.Close();
To run the example: Compile the solution, run the CalculatorService.exe and then run the CalculatorDynamicClient.exe

WCF WS-Discovery Protocol Implementation
This sample demonstrates how to use the Windows Communication Foundation to enable run-time discovery of services within ad-hoc networks using the WS-Discovery protocol. Clients can search for available services based on a Type and/or Scope (Probe), or search based on a specific Endpoint Reference (Resolve). A matched service will then respond using a ProbeMatch or ResolveMatch, as appropriate. New services can also announce their arrival on the network (Hello) or declare their departure from the network (Bye). These operations are defined as part of the WS-Discovery specification.

X509 Certificate Tool
With this tool, developers can:
  • easily inspect their certificate stores, i.e., find matching certificates (by part of their names, “RegEx search”)
  • easily view cert details, such as all the various key identifier flavors
  • Use one of the various key identifiers to find a cert (“Crypto value search”)
  • Scope (with the “Select search location”) in which stores they want to look
  • View the certificates using the regular UI
  • View private key properties (Filesystem UI)
  • Grant the ASPNET user read-only access to the private key (if the key is in LocalMachine).


SBP06-IS_Windows Communication Foundation Performance
This deck is from TechEd 2007 in Barcelona. The goal of this session was to walk through several of the key points that can improve the performance of your WCF application. The deck starts with some test data (the reward), then progresses from simple tweaks to more invasive ones.

SBP401_Architecture of Microsoft Windows Communication Foundation
This is the deck from TechEd 2007 Barcelona session titled: "SBP401 - Architecture of Microsoft Windows Communication Foundation and Common Extensibility Points". It's a 400 level presentation that describes WCF architecture, with a particular focus on the channel layer.

T-26-Building Applications and Services with .Net Framework 3.5
This talk covers the web-centric features of WCF in the .NET Framework 3.5. Specifically, it covers the new HTTP API, JSON messaging support, and the new syndication features.
Last edited Nov 26 2008 at 2:12 AM  by KSharkey, version 6
Page view tracker