Building a Data Contract Serializer Behavior

In configuration there’s a DataContractSerializer behavior that I can add to my service, but the class it uses is internal. How do I get the same behavior programmatically? The DataContractSerializer behavior is a shortcut for setting the MaxItemsInObjectGraph and IgnoreExtensionDataObject options on endpoints. You can get a similar effect by looping over the operations in…


Federating from Silverlight

I’ve had a few people ask whether the WCF subset in Silverlight supports message-level security. The answer currently is not very much. The security support is limited to basically the facilities that you’d expect to have for any other browser based application, primarily HTTPS and common browser HTTP authentication modes. Dominick Baier though has put…


Ten More PDC 2009 Talks for Web Service Developers

I covered earlier the WCF and WF PDC talks that the team is doing, but there are many other groups coming to PDC to talk about web services. Here is a sample of ten of those other talks that I think WCF developers may find interesting. Developing REST Applications with the .NET Framework by Don…


Finding CLR Types from Schema

How can I found out what CLR type a particular XML schema definition will map to when using data contracts? Ask the type system what type it thinks the schema will map to. static string ClrTypeForXmlType(XmlQualifiedName xmlType){ return new XsdDataContractImporter().GetCodeTypeReference(xmlType).BaseType;}static void Main(string[] args){ Console.WriteLine(ClrTypeForXmlType(new XmlQualifiedName(“duration”, “”))); Console.WriteLine(ClrTypeForXmlType(new XmlQualifiedName(“token”, “”))); Console.WriteLine(ClrTypeForXmlType(new XmlQualifiedName(“dateTime”, “”))); Console.WriteLine(ClrTypeForXmlType(new XmlQualifiedName(“anyURI”, “”)));…


Application Auto Start in IIS

Application auto start is the ability for an application to be automatically started up before receiving any requests. In addition to priming the application for the first request, application auto start is also a way to have applications that start automatically and run continuously. One example where this is useful is service discovery, where an…


WCF Samples for .Net 4 Beta 2

The Windows SDK samples for WCF and WF are now available updated for .Net 4 Beta 2. These are only the samples that are new or changed in .Net 4. If you want the complete set of existing samples as well you’ll need to pick those up from the platform SDK. You can also get…


.Net 4 Beta 2 Really Released

Although available for download by subscribers the last few days, the second beta release of .Net 4 is now available to everyone. You will see a number of new WCF features changed or moved around since the first beta release, but what you see now is almost everything planned for .Net 4. If you’re planning…


Visual Studio and .Net 4 Training Kit October Update

The training kit of materials for Visual Studio 2010 and .Net 4 has now been updated with the latest for beta 2. The contents of the training kit include presentations, hands on labs, and demos related to the new features in the release. Here’s some of what you should expect to get for web services:…


ASP.NET MVC 1 Scripts on AJAX Delivery Network

Last week the AJAX script files included for ASP.NET MVC applications were added to the AJAX content delivery network. The content delivery network is a free service that provides caching support for some of Microsoft’s AJAX libraries. As a developer you benefit from a network by not having to host the files yourself. As a…


Order Best Practices

Why is setting the Order property on data members recommended when adding fields in a new version of the contract? The data contract versioning best practices recommend taking three steps when adding fields in a new version of a contract. The first recommendation is to set the IsRequired property on the new field to false….