Windows desktop code samples

Contributions
Favorites
Sort by:

This sample shows how to implement support for CORS (Cross-Origin Resource Sharing) in WCF, a protocol which allow for CORS-enabled browsers to make requests to a WCF service which resides in a different domain than the one from which the HTML page originated.
Example showing how WCF message formatters can be used to support different serialization formats (in this case, the JSON.NET serializer) for operation parameters.
This sample shows how a WCF message encoder can be used to customize the XML prefixes in outgoing requests / responses from clients / servers, to allow communication with platforms which aren't namespace-aware.
An IDispatchMessageInspector implementation which shows how to get the actual message body for non-XML messages (i.e., JSON, binary) in a WCF REST service.
This sample shows how another way to enable CORS (Cross-Origin Resource Sharing) in an ASP.NET Web API project, both on a global level (using a message handler) or on a per-action basis (using a filter and an action selector).
The System.Diagnostics tracing is a great way to discover problems in WCF services, but the "typical" case of writing traces to a file doesn't work in some scenarios (such as shared hosting). This sample shows an in-memory trace listener, which exposes the traces as a WCF service
An implementation of a custom serializer for WCF services, using a contract behavior to hook it up on the client and the server.
A sample showing how to implement a custom help page for WCF endpoints, similar to the one enabled in .NET 4.0 for REST endpoints.
An implementation of a custom serializer hooked up to the WCF pipeline in Silverlight, working around the limitation that the DataContractSerializerOperationBehavior is not public on that platform.
This sample shows how to enable CORS (Cross-Origin Resource Sharing) in an ASP.NET Web API project
1 - 10 of 49 Items   
No favorites have been added.