Nicholas Allen's Indigo Blog

Windows Communication Foundation From the Inside

October, 2009

  • Nicholas Allen's Indigo Blog

    Building a Data Contract Serializer Behavior

    • 2 Comments

    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.

  • Nicholas Allen's Indigo Blog

    Federating from Silverlight

    • 0 Comments

    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.

  • Nicholas Allen's Indigo Blog

    Ten More PDC 2009 Talks for Web Service Developers

    • 0 Comments

    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.

  • Nicholas Allen's Indigo Blog

    Finding CLR Types from Schema

    • 0 Comments

    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

  • Nicholas Allen's Indigo Blog

    Application Auto Start in IIS

    • 0 Comments

    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.

  • Nicholas Allen's Indigo Blog

    WCF Samples for .Net 4 Beta 2

    • 0 Comments

    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 online documentation for the new .Net 4 samples from MSDN. Note that many of the navigation pages are missing or out of date. If the documentation for a sample doesn't appear to be included in a section, look at the navigation menu on the left hand side to see if more topics are listed for the section there. The individual sample documentation is available even though the section summaries haven't been updated yet.

  • Nicholas Allen's Indigo Blog

    .Net 4 Beta 2 Really Released

    • 0 Comments

    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 to test .Net 4 for compatibility, then I highly recommend doing that as soon as possible using this beta, preferably in the next few weeks. It's virtually impossible to address any but the most severe issues once the release date gets close. Waiting to test can delay getting your feedback addressed for years until the next service pack or release comes out. Use the Connect link to the right as the best way to make sure any issues you find get recorded.

    Here are the resources available.

    There's one significant known issue that affects WCF services hosted in IIS.

    ASP.NET and WCF applications might fail to start in IIS 7 Integrated mode

    If new configuration sections are added to the application web configuration file of an ASP.NET or WCF application, the application will fail to start when it is running in IIS 7 Integrated mode. For example, if a configuration section is added to the web configuration file of a WCF application, the application will not start when it is running in IIS 7 Integrated mode. Instead, IIS 7 will return a configuration validation error, because the new configuration section is not recognized by the IIS 7 configuration system. To resolve this issue you can download and install a hotfix. This fix was included in Windows Vista and Server 2008 SP2.

    There are several other minor known issues with IIS and ASP.NET so check the readme if you're having problems with web hosted services after upgrading.

  • Nicholas Allen's Indigo Blog

    Visual Studio and .Net 4 Training Kit October Update

    • 0 Comments

    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:

    Presentations

    • What’s New in .NET Framework 4
    • What’s New in Visual Studio 2010
    • Introduction to ASP.NET MVC
    • Introduction to .NET RIA Services
    • Introduction to “Velocity”
    • What’s New in Windows Workflow 4

    Labs

    • Introduction to ADO.NET Data Services
    • ASP.NET AJAX 4
    • Creating Plan My Night – ASP.NET MVC Application
    • Enhancing Plan My Night – ASP.NET MVC Application
    • Introduction to Workflow 4
    • Introduction to “Velocity”
    • WCF Service Discovery
  • Nicholas Allen's Indigo Blog

    ASP.NET MVC 1 Scripts on AJAX Delivery Network

    • 0 Comments

    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 user you benefit from a network by having access to widespread local mirrors and cached access to script files across different sites you might visit.

    The script locations to include for ASP.NET MVC 1 are:

    Equivalent debug versions of the scripts are also available.

  • Nicholas Allen's Indigo Blog

    Order Best Practices

    • 0 Comments

    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. Since older applications will not know about the new field, you obviously can’t require that the field always be present.

    The second recommendation is to provide an OnDeserializing callback if the default value of the new field needs to be set. The default value of the field- zero, false, null, or the other similar defaults for data types- may not be a valid or desired value for the field. If the field is not required, then you will potentially see the field initialized with the default value. Creating a callback to set the default value appropriately takes care of compatibility problems.

    The third is to set the Order property on the new field so that the field appears after all of the existing data members. If you are exchanging messages with an application that models the data using member name and namespace, then the order of the members tends not to matter. At most, there might be efficiency issues if the application has optimized for a specific member order but you’ve forced it to do extra work by providing the members in a different order.

    On the other hand, if you are exchanging messages with an application that models the data using the structure of the contract, then the order of the members may be a more fundamental assumption. There are many applications deployed and in use that are intolerant of changing the order of members. In this case, changing the order of members or inserting new members in between doesn’t just affect the efficiency of the application but could entirely break validation or application logic. Always adding new fields to the end even when not strictly required is a conservative measure to promote compatibility and avoid having to deal with application bugs.

  • Nicholas Allen's Indigo Blog

    Four Weeks between Now and PDC 2009

    • 0 Comments

    There are four more weeks between now and the start of PDC the week of November 16th. Registration can be done through the main PDC site. The details of the sessions are now almost all completely published and there are six sessions on tap covering WCF and WF in depth.

    What's New for Windows Communication Foundation 4 by Ed Pinto

    Learn about the investments made in Windows Communication Foundation 4 that add new capabilities for service composition and reduced configuration and deployment complexity. Discover how improvements to configuration, monitoring, and deployment are enhanced by Microsoft project code name "Dublin". See how the Routing Service makes it easier to build sophisticated intermediaries and how support for WS-Discovery adds flexibility to your services infrastructure. Gain insight into the improved authoring experience for REST services applications including new support for caching, multiple formats, and fault handling.

    Workflow Services and "Dublin" by Mark Fussell

    Learn how to use Windows Workflow Foundation (WF) 4, Windows Communication Foundation (WCF) 4, and "Dublin" to build and manage scalable, reliable, and highly-available applications. Discover the power of WF to build and coordinate WCF services and implement logic on the middle tier. Enable sophisticated messaging patterns with correlation, enhanced transaction support, durable services, and config-based activation. Learn how "Dublin" makes it easier to deploy, manage, and monitor WCF and WF applications.

    Spice Up Your Applications with WF 4 by Matt Winkler

    Discover how your applications can achieve a new degree of flexibility, transparency, and end-user control with Windows Workflow Foundation (WF). Expose tailored, productive authoring experiences for your users to define business and application logic with new capabilities in WF 4, including simplified designer rehosting and enhanced activity and designer programming models to create domain-specific libraries of activities. Understand the options available for hosting WF and extending the runtime to add control and application visibility and see how customers are already workflow-enabling their solutions with WF 4.

    Microsoft Application Server Technologies: Present and Future by Anil Nori

    Hear how Microsoft is evolving its application server technologies to address the challenges of building, deploying, and managing composite applications in Windows Server and Windows Azure. See how .NET applications built on ASP.NET, WCF, and WF can take advantage of the improved management, hosting, and distributed object caching capabilities provided by the application server. Learn about future directions for these technologies and hear how the changing needs of enterprise applications will be addressed by a layered platform of frameworks, servers, and services.

    Application Server Extensibility with Microsoft Project Code Name "Dublin" and Microsoft ASP.NET 4 by Nicholas Allen

    ASP.NET 4 and "Dublin" provide new application hosting, tracking, and persistence capabilities. Learn the benefits of different hosting options and how to choose the right option for your scenario. Learn about custom tracking providers and how the built-in tracking system can be extended to meet your custom business data monitoring requirements. Learn about the new subsystem for managing durable application state using Microsoft SQL Server or custom application-specific stores.

    Windows Workflow Foundation 4 from the Inside Out by Bob Schmidt

    See why Windows Workflow Foundation 4 is a powerful platform for simplifying application coordination logic and state management. Learn about the core runtime abstractions and under-the-hood improvements related to areas such as performance, transactions, and persistence. Get insights and techniques that enhance your investments in Workflow.

  • Nicholas Allen's Indigo Blog

    Transfer Modes and Buffer Sizes

    • 0 Comments

    Why do only some of the bindings allow setting a MaxBufferSize?

    The maximum buffer size and the maximum received message size are in many ways linked together.

    If the message is being transferred in a single buffer, then it only makes sense for the largest size of that buffer to equal the largest size of the message. If the message was larger than the largest buffer, then it wouldn't be possible for the message to fit in a single buffer. If the buffer was larger than the largest message, then there would be buffer space that could never be used.

    On the other hand, if the message is being transferred as a stream, then the relationship between the largest buffer size and the largest message size changes. The only piece of the message that needs to fit in a single buffer is the initial group of headers at the beginning. Overall, the message might require many buffers full of data to communicate. If the message was larger than the largest buffer, then that is perfectly acceptable. It still doesn't make sense though for the buffer to be larger than the largest message since there is no way to fill a single buffer using multiple messages.

    Some of the bindings can only perform buffered transfers. For example, if the binding requires making a copy of the message as it is being sent, then there isn't much point supporting anything besides buffered transfers as a buffered copy of the message will always be available. If a binding only supports buffered transfers, then there is no need to have a maximum buffer size. The only possible value the maximum buffer size could have is equal to the maximum message size, and having to enter the same size twice doesn't help you do anything besides make mistakes.

  • Nicholas Allen's Indigo Blog

    WCF Case Studies Year 3

    • 0 Comments

    Two and a half years ago I put together an initial list of case studies involving WCF from the Microsoft case study site. Yesterday I covered the year past the initial list and this time I'll go one year farther. Today's list covers roughly a year starting from the time that Orcas SP1 was released. I haven't sorted the case studies by the version of WCF used, but I'd expect that in this batch you'd see an increasingly prevalent mix using .Net 3.5.

    The basic premise has not changed since the first list. The Microsoft case study site is a collection of easily-digestible executive-style summaries of people using Microsoft products. However, finding the case studies about WCF in the collection is next to impossible. I've tried to select a collection of case studies that deals with WCF in interesting ways, which means that I've both probably missed some case studies that are interesting and included some case studies that only superficially use WCF.

    1. Avanade Spain
    2. Citroen
    3. Colonial Life
    4. Dubai Bank
    5. Earth Class Mail
    6. Eduserv
    7. Enterasys
    8. EPS Software
    9. Hershey Technologies
    10. ISC
    11. MTV Networks
    12. Netiks
    13. NEXT
    14. Scripps Research Institute
    15. Thermo Fisher Scientific
    16. Thomson Reuters
    17. Vertex
    18. Zaptag
  • Nicholas Allen's Indigo Blog

    WCF Case Studies Year 2

    • 0 Comments

    Two and a half years ago I put together an initial list of case studies involving WCF from the Microsoft case study site. I thought I'd give an update to gather together a list of case studies published since then. Today's list covers roughly a year stretching from the end of the previous list to approximately the time that Orcas SP1 was released. I haven't sorted the case studies by the version of WCF used, but I'd expect that in this batch you'd see the transition from .Net 3.0 to 3.5.

    The basic premise has not changed since the first list. The Microsoft case study site is a collection of easily-digestible executive-style summaries of people using Microsoft products. However, finding the case studies about WCF in the collection is next to impossible. I've tried to select a collection of case studies that deals with WCF in interesting ways, which means that I've both probably missed some case studies that are interesting and included some case studies that only superficially use WCF.

    1. 90 Degree Software
    2. BBC Worldwide
    3. British Energy
    4. CASON
    5. CoStar
    6. Elia
    7. EMIS
    8. Hillsborough County, Florida
    9. huddle.net
    10. ICONICS, INC.
    11. Logic Studio
    12. Newegg.com
    13. SCANA Corporation
    14. Spot Runner
    15. Tennessee Department of Human Services
    16. Vanderbilt University Medical Center
    17. Vital Images
    18. Wisenbaker Builder Services
    19. World Olympian Alliance
  • Nicholas Allen's Indigo Blog

    Web Service Technology Update with RIA Services

    • 0 Comments

    I've updated the WCF developer technology page with some of the ASP.NET MVC articles I've posted recently and also added another entry: .Net RIA Services.

    RIA Services are an application design pattern that live between ASP.NET and Silverlight in a multi-tier architecture. Inside RIA Services you can host application logic for data access control, queries, and other data operations. Integration with Silverlight components and controls allows for data validation and access control to automatically be made available to the client.

    Releases

    Resources

    Related Posts

  • Nicholas Allen's Indigo Blog

    Silverlight Documentation Refresh

    • 0 Comments

    The documentation for a published product periodically receives corrections and bug fixes in a refresh update that publishes many of the changes at once. On occasion there may even be new content added that was produced since the last release.

    Silverlight 3 recently had a documentation refresh to fix bugs, but what I noticed first was that an offline documentation collection was being kept in sync with the changes to the MSDN documentation. I like having an offline copy of the documentation because of the speed and responsiveness when browsing through the documentation locally.

    Here's the documentation collection for Silverlight 3 compiled into a help file if you also like having access to documentation offline.

  • Nicholas Allen's Indigo Blog

    Nothing to See Here

    • 0 Comments

    What is the System.ServiceModel.Channels.NullMessage used for?

    The Message class is a central abstraction for representing communication between two endpoints. There's often interesting information associated with a message, such as the message delivery properties, and that interesting information hangs off of the Message class. Therefore, if you don't have a Message, then you don't have access to any of this information.

    The requirement to have a Message isn't often a problem. Even if you don't have any content, then that doesn't necessarily mean that you don't have a message. An empty SOAP message is still a message. An empty SOAP message has an envelope, headers, and even a body; it just doesn't have any content within the body tag. Empty SOAP messages occur quite often when you have a two-way operation but no application data to send in one of the directions. Despite being empty, an empty SOAP message could have any amount of content thanks to arbitrarily extensible storage locations such as headers. A secure, empty SOAP message could easily be many kilobytes in size.

    On the other hand, sometimes you have even less than an empty message. For example, if you're not using SOAP, then an empty message may really mean 0 bytes of data. Or, a read operation might result in an indication that no more input is coming. There truly isn't anything to build a message out of in that case.

    In the early design of WCF, anything that was less than an empty message was represented by a null object. However, that later became a problem as it was recognized that without a Message object, other code might not work. You might have some of that interesting information that hangs off of the Message class even though you don't have a message to convey. The first example of that was POX messaging where you might receive HTTP headers but have the content of the message be a 0 byte stream.

    The NullMessage class was a way to distinguish something that was less than an empty message while still providing a storage location for interesting information associated with a message. Now, the null object is used when there is even less than a NullMessage available. For example, if a stream has no more input available, then that corresponds to a null object, while if a stream conveys a message but the length of that message is 0 bytes, then that corresponds to a NullMessage.

  • Nicholas Allen's Indigo Blog

    PDC 2009 Plans

    • 1 Comments

    Several new PDC sessions were published recently including one session that I'll be delivering.

    Application Server Extensibility with Microsoft Project Code Name “Dublin” and Microsoft ASP.NET 4 by Nicholas Allen

    ASP.NET 4 and “Dublin” provide new application hosting, tracking, and persistence capabilities. Learn the benefits of different hosting options and how to choose the right option for your scenario. Learn about custom tracking providers and how the built-in tracking system can be extended to meet your custom business data monitoring requirements. Learn about the new subsystem for managing durable application state using Microsoft SQL Server or custom application-specific stores.

    Based on the description you might already be able to picture some of the content that you'll be seeing in this talk, but whatever you're imagining is probably wrong as both the title and summary of the talk need a lot of correction. This talk will not have any content at all covering ASP.NET and probably only very little that specifically focuses on Dublin. At the conclusion of the talk your custom business data monitoring requirements will not be met.

    I will be spending a great deal of the hour though talking about durable application state and instance persistence in distributed systems. I'll be covering the what and the why behind how we built the platform that is used to adapt WCF messaging to communicate with long-running workflow applications.

    The more concrete and practical side of this talk heads in the direction of workflow services covered by Mark Fussell.

    Workflow Services and “Dublin” by Mark Fussell

    Learn how to use Windows Workflow Foundation (WF) 4, Windows Communication Foundation (WCF) 4, and “Dublin” to build and manage scalable, reliable, and highly-available applications. Discover the power of WF to build and coordinate WCF services and implement logic on the middle tier. Enable sophisticated messaging patterns with correlation, enhanced transaction support, durable services, and config-based activation. Learn how "Dublin" makes it easier to deploy, manage, and monitor WCF and WF applications.

  • Nicholas Allen's Indigo Blog

    Binary Encoding, Part 7

    • 0 Comments

    For the last part in the binary encoding series I'll cover how the use of the string table changes when the encoder is used in a sessionful manner. Here now are all of the past entries in the series:

    I covered in part 6 the use of a static string table for compactly representing text strings using an integer token. The static strings were assumed to be prearranged knowledge shared between the two sides so the strings themselves were never transmitted. Also, the token values in the static string table only had assignments for even numbers.

    In some cases though, a string may appear repetitively in a message that is not one of the strings previously agreed to be shared. The dynamic string table is a way for the sender of the message to communicate the string once, creating an integer token that stands in place of the string in the future. All of these dynamically assigned strings fall into the odd numbers for string table token values.

    The use of a dynamic string table is one of the options that must be specified when the two sides agree to exchange messages in the binary format. For example, in the previous series on message framing I listed off a number of known encodings for framing, including multiple versions of the binary encoding. The different binary encoding types specify whether a dynamic string table is being used. Other ways of communicating the use of the binary format require a similar mechanism, such as a specific MIME type.

    When the two sides have agreed to use a dynamic string table, the string table accumulates over time for all of the messages in a session. The set of messages included in a session are another aspect that the two sides have to agree upon.

    The string table initially contains only the entries from the static string table. Prior to each message in the session, a header is sent containing new string table entries. The header starts with the length of the header in bytes followed by any number of length-prefixed strings. The transmitted strings are added to the string table based on the order that they appear. The first transmitted string in a session is assigned the token value 1; the second transmitted string in a session is assigned the token value 3, and so on.

    Once a string has been dynamically assigned an entry in the string table, the same record types that were used for referencing entries in the static string table can be used. The two kinds of strings aren't distinguished later when using them in a message.

    WCF uses the dynamic string table for strings that it finds from the service contract (think of what you can guess will commonly appear in a message from the structural description, such as the service operation name or the tag names for wrapper elements). If you were building the messages yourself, you could of course substitute any strings you wanted though. For example, the message in the previous exercise included the string "Message". If we thought that that string would appear frequently, then we could assign it a dynamic string table entry using a message header such as:

    0x08, 0x07, 0x4D, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65

    The message header includes one string. If that happened to be the first string presented in the session, then we could now use the token value 1 with one of the string table record types wherever the string "Message" would have appeared.

  • Nicholas Allen's Indigo Blog

    ASP.NET MVC 2 Preview 2

    • 0 Comments

    A second preview release of ASP.NET MVC 2 has been released, adding new support for extending client-side validation, metadata annotations, and model validation. I'll be updating the web service technology page later in the week to cover a new set of resources, but in the meantime you can get the preview and source code.

    The release notes are also available as a separate download on the same page as the release itself. You can install ASP.NET MVC 2 side by side with MVC 1 but you can't have multiple preview versions of MVC 2 at the same time. If you installed MVC 2 Preview 1 earlier, you should replace it with this new release.

  • Nicholas Allen's Indigo Blog

    Contract First Development through Schema

    • 0 Comments

    Christian Weyer and Buddhike de Silva have an article in this month's MSDN magazine covering contract-first development with WCF. They go over modeling messages and services through schema and then applying that to build a web service with WCF. They also look at tooling for working with schemas including the WSCF Blue contract-first development tool that I mentioned a few months ago. Not entirely coincidentally, Christian has announced that WSCF Blue is now out of beta and the first version has been released.

  • Nicholas Allen's Indigo Blog

    Binary Encoding Exercise Answers

    • 0 Comments

    I've gone ahead and put the message in the exercise in a small test program to demonstrate how the server would handle it. To help you out I've reformatted the input to make the record boundaries clear although the server obviously wouldn't take notice of any formatting. The dictionary of strings would ordinarily be supplied by WCF when you're using the message encoder.

    byte[] data = new byte[]
    {
    0x56, 0x02,
    0x0B, 0x01, 0x73, 0x06,
    0x0B, 0x01, 0x61, 0x04,
    0x56, 0x08,
    0x44, 0x0A,
    0x1E, 0x00,
    0x98, 0x01, 0x31,
    0x98, 0x01, 0x61,
    0x01,
    0x01,
    0x56, 0x0E,
    0x98, 0x07, 0x4D, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
    0x01,
    0x01
    };
    XmlDictionary strings = new XmlDictionary();
    strings.Add("mustUnderstand");
    strings.Add("Envelope");
    strings.Add("http://www.w3.org/2005/08/addressing");
    strings.Add("http://www.w3.org/2003/05/soap-envelope");
    strings.Add("Header");
    strings.Add("Action");
    strings.Add("To");
    strings.Add("Body");
    XmlDictionaryReader reader =
    XmlDictionaryReader.CreateBinaryReader(data, 0, data.Length, strings, XmlDictionaryReaderQuotas.Max);
    reader.Read();
    Console.WriteLine(reader.ReadOuterXml());

    Now, let's go over a translation of each of those records.

    0x56, 0x02 // <s:Envelope
    0x0B, 0x01, 0x73, 0x06 // xmlns:s="http://www.w3.org/2003/05/soap-envelope"
    0x0B, 0x01, 0x61, 0x04 // xmlns:a="http://www.w3.org/2005/08/addressing"
    0x56, 0x08 // ><s:Header
    0x44, 0x0A // ><a:Action
    0x1E, 0x00 // s:mustUnderstand=
    0x98, 0x01, 0x31 // "1"
    0x98, 0x01, 0x61 // >"a"
    0x01 // </a:Action>
    0x01 // </s:Header>
    0x56, 0x0E // <s:Body>
    0x98, 0x07, 0x4D, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65 // "Message"
    0x01 // </s:Body>
    0x01 // </s:Envelope>
Page 1 of 1 (22 items)