Welcome to MSDN Blogs Sign in | Join | Help

PDC 2009 Logistics

Here is how next week is going to work for articles while PDC is going on. I will try to continue to have things appear at the usual time in the morning although some days you may get things at a later time.

On Monday I'll give a final rundown of related sessions for the framework talks.

My talk is on Thursday. If there's any content or resources that I need to post afterwards from the talk, those will probably go up Friday. I'm hoping for a similar type of arrangement as last year where MSDN takes care of putting out slides and videos so that I don't have to.

In between I'll be doing session reviews for the small number of sessions that I'll get to see. This is usually somewhere between three and five for a conference of this length. You can look at some examples of reviews from PDC last year.

Posted by Nicholas Allen | 0 Comments
Filed under:

Bob Muglia Talks Distributed Systems and Silverlight

TechCrunch talked to Bob Muglia a few months ago covering cloud computing, distributed systems, and Silverlight programming. Bob is the president of the Server and Tools business here at Microsoft that produces all of these technologies. There's a long transcript available for the whole piece with a twenty minute video covering the second half of the interview. You can also just jump directly into the video without needing the context from the first half. There have been a few updates since the video was taken as it is a few months old, but you should recognize the few of these such as Silverlight 3 being released.

Interfaces Lack Data

Why does having two known types blow up for being conflicting data contract types if the types are two different interfaces?

An interface only contains declarations for its members. The interface doesn't contain any data fields and any implementation for the interface is located in the class that implements the interface.

When you try to serialize an interface type, any concrete class might walk up having implemented the interface. That concrete class might be holding any kind of data or none at all. Essentially, this makes an interface type no different than the type Object (or in the schema world, the type Any). In fact, that's exactly what the interface is as far as the serializer is concerned. If you have two interfaces, they're both equivalent to Object, which means they will conflict.

The only caveat there is that an interface type for one of the known collection types will turn into the corresponding concrete type for that collection type. It's still easy to get yourself into trouble with collections but at least it only affects pairs of types that are at least superficially similar.

Another .Net 4 Survey: Documentation

If you enjoy being surveyed (and who doesn't?), then the developer documentation teams would like to better understand how you use the help and documentation libraries, and also what you'd like to see improved. The survey covers what versions of Visual Studio and .Net framework you use, how you go about finding things in the documentation, and how you'd like to have the documentation organized.

If you've only got time to fill out one survey though, I'm personally partial to the .Net 4 Beta 2 survey I posted last week for the Visual Studio team.

Posted by Nicholas Allen | 0 Comments
Filed under:

One Week to PDC 2009

With one week to go before PDC starts, the times and rooms for all of the sessions are now available. While things are still subject to change, now would be a good time to make a preliminary plan for your week if you're going to be attending PDC.

My talk this year is currently scheduled for 1:45 Thursday in Petree Hall D. For those that have attended prior PDCs in Los Angeles, the Petree Hall rooms are the large theaters in the west wing. Depending on how many people show up I may have to retarget some of the content to reflect a broader audience (capacity of the room is about 1100). I build in a lot of flexibility when I talk though to make these types of adjustments.

Here's what I'm planning to cover on the topic of application server extensibility in only 60 minutes (note that I'm jumping in to give a workflow talk; Ed Pinto will be delivering the session on WCF this year):

  • Understanding the application server and workflow architecture (just enough to get you through the talk)
  • Hosting options for workflow, including building your own application host
  • How and why we built a new model for persisting durable services
  • Customizing how instance persistence works, from tweaking how a variable is recorded all the way to building an entirely new instance store
  • How workflow execution is tracked
  • Customizing what events get tracked and where the data gets recorded

Workflow persistence has completely changed from past versions starting in .Net 4 Beta 2 and this will probably be your only chance to get a detailed explanation before the release.

Posted by Nicholas Allen | 0 Comments
Filed under: ,

.Net Services November 2009 CTP

The .Net Services team has made a November 2009 CTP release of the SDK for their portion of the Azure Services Platform. As mentioned over the summer, .Net Services has pared down their work on routers, queues, and relays to focus on delivering the access control service and service bus. These two services are also what the team will be focusing on at PDC.

The service bus is an infrastructure piece for connecting together different components in a distributed application. The access control service, now more oriented around REST, allows integration of those connected components with identity providers. Both services have changed quite a bit as described by the breaking changes list from the previous CTP.

The announcement for the CTP also covers how the transition from a beta product to a production service will take place.

Posted by Nicholas Allen | 0 Comments
Filed under:

Windows Web Services Samples

The Windows Web Services API is a native-code implementation of a subset of the SOAP web services support in WCF. This makes Windows Web Services useful when you want to build web services but need to use C or C++ instead of managed code and need to have a minimal set of dependencies.

Many of the people on the Windows Web Services team worked on Indigo before splitting off after our first release. This means that you'll see a lot of similar names and concepts between the two even though their intended users can be quite different.

I've had a few people ask what using Windows Web Services is like and personally I think that looking at examples is a good way to find out. Windows Web Services has an excellent set of samples including a nicely organized index of examples. I'd recommend browsing through the list there starting from the service model examples and then moving to some of the deeper topics.

Posted by Nicholas Allen | 0 Comments
Filed under:

Breaking Changes for WCF in .Net 4 Beta 2

Available for download is the list of breaking changes between beta 1 and beta 2 for WCF and WF. To save you some time, here's my condensed version of the list.

  • When adding site or machine-level collections of behaviors, those behaviors will be merged with service-level behavior configurations of the same name. Previously, you would only get the behaviors configured directly by the application if there was a naming conflict.
  • The blob encoder was renamed to the byte stream encoder. It still works the same though. Put some bytes in one end and the exact same bytes come out the other end.
  • The local "in app domain" transport channel was removed. Use named pipes instead; they're just as fast and have been available for years.
  • A security feature involving SAML tokens that you've probably never heard of has very slightly changed its default behavior.
Posted by Nicholas Allen | 0 Comments
Filed under: ,

Visual Studio and .Net 4 Beta 2 Survey

The Visual Studio team has set up a survey to collect additional feedback about the Beta 2 release. If you have something to say but haven't reported it on the Connect site or through other feedback channels, this would be a good opportunity to let your thoughts be known. The window of opportunity for actually addressing the feedback in this release is closing pretty rapidly.

The survey is about ten questions long and mostly along these lines:

  • How are you using the Visual Studio beta?
  • Have you encountered any weird behaviors?
  • Is the performance good?

You should be able to fill it out and add your own comments in less than five minutes.

Posted by Nicholas Allen | 2 Comments
Filed under:

Replacing Visual Studio 2010 Beta 1 with Beta 2

I recently helped someone out with replacing Visual Studio 2010 and .Net 4 Beta 1 with the newer Beta 2 release. Here are a few things that I had to learn along the way.

I've done enough beta installations to know that having previous versions of the same release will cause endless headaches. I don't even try to install over top of a beta installation first to see if it will work. The Beta 2 release notes for Visual Studio 2010 lead off with a known issue that trying to install Beta 2 without uninstalling Beta 1 first will fail.

Unfortunately, uninstalling Beta 1 wasn't successful as the installer would ask for the setup location for the TFS Object Model and then crash. I found the solution to that in the Beta 2 installation addendum. Before uninstalling the main Visual Studio 2010 program, uninstall Microsoft Team Foundation Server 2010 Beta 1 Object Model. This ran to completion and stopped the crashing in the Visual Studio uninstaller. It looks like you only need to worry about this component if you had installed Visual Studio Team Suite.

After uninstalling Visual Studio, this left a few Beta 1 components behind. Here's the order that worked for me:

  1. Microsoft .NET Framework 4 Extended Beta 1
  2. Microsoft .NET Framework 4 Client Profile Beta 1
  3. Microsoft Visual C++ 2010 Beta 1 Redistributable x64
  4. Microsoft Visual C++ 2010 Beta 1 Redistributable x86

At that point the system was clean and installing Beta 2 of Visual Studio and .Net 4 worked on the first try.

Posted by Nicholas Allen | 0 Comments
Filed under:

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 your service.

First, if the DataContractSerializer behavior is supplied as a service behavior, it applies to all of the non-metadata endpoints in your service. To check whether an endpoint is a metadata endpoint, we look for the following things:

  1. The endpoint has a ServiceMetadataBehavior in its description
  2. The endpoint service type is IMetadataExchange
  3. The endpoint contract name is IMetadataExchange in the namespace http://schemas.microsoft.com/2006/04/mex

Assuming that we've found a non-metadata endpoint, or the DataContractSerializer behavior is supplied as an endpoint behavior instead of a service behavior, we now scan through all of the operation descriptions on the endpoint contract. For each operation description we scan through all of its behaviors to find a DataContractSerializerOperationBehavior. The operation behavior is what stores the settings for the operation.

Finally, if the settings on the DataContractSerializerOperationBehavior were not already explicitly set, we change them to the values from the DataContractSerializer behavior. By doing this check, you can apply the behavior to an endpoint without overriding any values you set manually. This is the only step that you can't duplicate as the flag to tell where the value came from is internal. If you explicitly set the MaxItemsInObjectGraph or IgnoreExtensionDataObject options on an operation, then you'll need to explicitly exclude those operations in the behavior you write as well.

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 together a set of workarounds to enable basic support for federation from a Silverlight client. The method uses some customization of the token service to simplify the protocol required and pick one of the supported authentication types plus some customization of the client application to manually insert the security headers into messages. This gives you a simple form of bearer tokens in messages for a service implemented across two different security domains.

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 Box and Henrik Nielsen

Come hear an overview of the REST principles and why REST is becoming popular beyond traditional Web applications. Learn how to write applications that produce and consume RESTful services using the .NET Framework 4 and the improvements we have planned for future versions of the .NET Framework.

Building Amazing Business Applications with Microsoft Silverlight and Microsoft .NET RIA Services by Brad Abrams

Learn how to build n-tier Rich Internet Applications (RIA) on Silverlight by tapping the power of .NET RIA Services. Walk through an example of building an application from scratch using the pattern run-time components and tools provided by .NET RIA Services. See how it helps you write application logic to expose data and operations in a carefully controlled fashion using tools integrated into Visual Studio with support for validation, authentication, authorization and handling units of work.

Queuing and Publish/Subscribe in a Heterogeneous Environment by David Ingham and John O'Hara

Queuing and publish/subscribe are common patterns for building loosely-coupled, distributed applications. Learn how to use Microsoft Windows Communication Foundation (WCF) the new Microsoft ASP.NET 4.0 routing service, the Microsoft .NET Service Bus, and Microsoft BizTalk Server to easily connect heterogeneous systems. We then introduce AMQP (the Advanced Message Queuing Protocol), an important new open standard for interoperable message-oriented middleware, which will reduce the friction in connecting heterogeneous clients. A real-world scenario shows AMQP in action, connecting WCF, Microsoft Excel, and Java-based clients.

REST Services Security in Windows Azure using the Access Control Service by Justin Smith

Come hear how easy it is to secure REST Web services with the Access Control Service (ACS). Learn about ACS fundamentals including how to request and process tokens, how to configure ACS, and how to use ACS to integrate your REST Web service with Active Directory Federation Services. Also see how to apply ACS in a variety of scenarios using a few popular programming models including the Windows Communication Foundation and Microsoft ASP.NET Model-View-Controller (MVC).

Microsoft ASP.NET MVC 2: The New Stuff by Stephen Walther

Come learn about the new features being introduced with ASP.NET MVC 2. Templated helpers allow associating edit and display elements with data types automatically. Areas provide a means of dividing a large Web application into multiple projects. Data annotations allows attaching metadata attributes on a model to control validation. Client validation enables form field validation without the need to perform a roundtrip to the server. Learn how these new features enable you to be more productive when building ASP.NET MVC applications.

Mastering Microsoft .NET RIA Services by Dinesh Kulkarni

This advanced-level .NET RIA Services session provides an "under-the-covers" view of how the technology works. Come learn about common architectural patterns, key design principles, and tools to work with a variety of data access layers, application logic patterns and client-usage scenarios. Examine query and unit of work patterns, custom methods, validation, authentication and authorization metadata, authoring custom validations, and using asynchronous operations effectively on the client. Hear tips and tricks to help you get the most out of .NET RIA Services in advanced scenarios. This session assumes existing experience with .NET RIA Services.

It's All about the Services: Developing Custom Applications for Microsoft SharePoint Server 2010 Using Microsoft ASP.NET, WCF, and REST by Maxim Lukiyanov

Many developers use services to build and integrate applications and line-of-business systems with SharePoint. With SharePoint 2010, developers now have a wider array of options that include ASP.NET, Windows Communication Foundation (WCF), and RESTful services. Come get a demo-rich walkthrough of each option and discuss where each of the services might be appropriate and what you stand to gain by using them.

ADO.NET Data Services: What's New with the RESTful Data Services Framework by Pablo Castro

Join this code-heavy session to discuss the upcoming version of ADO.NET Data Services, a simple, standards-based RESTful service interface for data access. Come see new features in action and learn how Microsoft products are using ADO.NET Data Services to expose and consume Data Services to achieve their goals around data sharing.

Evolving ADO.NET Entity Framework in Microsoft .NET Framework 4 and Beyond by Shyam Pather and Chris Anderson

Come see how the ADO.NET Entity Framework enables new capabilities to leverage multiple development approaches, for example the use of code-first, model-first, and database-first. Hear how, regardless of the development approach, developers will benefit from the Entity Framework and the deep integration with the rest of the Microsoft .NET Framework 4, such as the Microsoft ASP.NET MVC, Dynamic Data, and Windows Presentation Foundation.

Networking and Web Services in Microsoft Silverlight by Yavor Georgiev

This session presents an overview of how to expose data to a Silverlight application by accessing SOAP Windows Communication Foundation (WCF) services and REST services. In the WCF space, we cover Silverlight 3 approaches for securing services and improving their performance and maintainability. We also cover a specific message pattern called server push, which allows you to implement scenarios such as email clients and real-time chat. In the REST space, we walk through the Silverlight 3 client HTTP stack and new functionality it offers around HTTP verbs, headers, responses, and cross-domain access and talk about future plans for networking and Web services in Silverlight.

Posted by Nicholas Allen | 0 Comments
Filed under:

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", "http://www.w3.org/2001/XMLSchema")));
Console.WriteLine(ClrTypeForXmlType(new XmlQualifiedName("token", "http://www.w3.org/2001/XMLSchema")));
Console.WriteLine(ClrTypeForXmlType(new XmlQualifiedName("dateTime", "http://www.w3.org/2001/XMLSchema")));
Console.WriteLine(ClrTypeForXmlType(new XmlQualifiedName("anyURI", "http://www.w3.org/2001/XMLSchema")));
Console.WriteLine(ClrTypeForXmlType(new XmlQualifiedName("decimal", "http://www.w3.org/2001/XMLSchema")));
Console.WriteLine(ClrTypeForXmlType(new XmlQualifiedName("positiveInteger", "http://www.w3.org/2001/XMLSchema")));
Console.WriteLine(ClrTypeForXmlType(new XmlQualifiedName("QName", "http://www.w3.org/2001/XMLSchema")));
}

This produces the following list of types.

System.TimeSpan

System.String

System.DateTime

System.Uri

System.Decimal

System.Int64

System.Xml.XmlQualifiedName

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 initial listener needs to be running to allow other services to be found.

Windows services have supported automatically starting when the machine is booted, but web services hosted in IIS have used a message-based activation model. There are workarounds for automatically starting and keeping an IIS service running, such as creating a second service to regularly ping your real service. However, an integrated solution would clearly be preferable.

The IIS Application Warm Up module is a beta extension for IIS 7.5 that adds the application auto start ability. You can get the module for Windows 7 and Windows Server 2008 R2.

Posted by Nicholas Allen | 0 Comments
Filed under: ,
More Posts Next page »
 
Page view tracker