Nicholas Allen's Indigo Blog

Windows Communication Foundation From the Inside

April, 2008

  • Nicholas Allen's Indigo Blog

    Messaging Additions in Orcas, Part 3

    • 1 Comments

    Now that I've covered several of the new feature additions in Orcas I also want to include mention of some of the fixes done to improve interoperability with other platforms.

    • Allowing an empty SOAPAction. Previously we required that the HTTP SOAPAction header exactly match the addressing action. We now let you process messages with an empty SOAPAction as many other systems were processing messages based only on the addressing action.
    • Handling empty messages that claim to be chunked. Previously we weren't able to process messages that said that they were chunked but didn't have any content. Some systems were transmitting every HTTP message as chunked (even the empty ones) so we now handle this case gracefully.
    • Flexible content types. Previously we required that the character set parameter for an HTTP content type be the first parameter in the list. Some systems were generating content types with additional parameters in various orders so we've removed any dependency on the parameter order.
    • Parsing MTOM includes. Previously we only supported the canonicalized format for the Include element of an MTOM message. Another system was generating MTOM messages where the elements were not canonicalized so we've added support to read those messages.

    Next time: Messaging Additions in Orcas, Part 4

  • Nicholas Allen's Indigo Blog

    Messaging Additions in Orcas, Part 2

    • 2 Comments

    Continuing on with the theme of messaging additions in Orcas, today I'll look at some more of the protocols and community-driven features that were added.

    • WS Atomic Transaction 1.1. Transactions tie together multiple participants in a distributed application. The framework of transactions is built on various coordination protocols between parties. Transactions are a kind of coordination in which either all or none of the parties agree to perform an action.
    • Validation for issued token certificates. We've added support for configuring the certificate validation policy for issued token authentication, similar to the configuration for other certificates that are used for service credentials.
    • Flowing SAML tokens. We've added support to flow a SAML assertion without having to re-sign the token. This allows these assertions to be handled by proxies without special configuration.
    • Using message contents for authorization. We've added support to ServiceAuthorizationManager for performing access checks that make use of the body of the message.
    • WS Secure Conversation 1.3. A secure conversation is an exchange of multiple, protected messages. Using a conversation mechanism allows a security context to be established across several messages, which performs better than having to exchange security keys with every message.
    • WS Trust 1.3. Building a secure conversation requires that the two parties exchange security credentials. In order to perform this exchange, the two parties need to establish a trust relationship where they can evaluate the assertions made by the other side.

    The protocols that I've talked about today and last time are available through the new WS2007HttpBinding and WS2007FederationHttpBinding as updates to the previous web service standard bindings.

    Next time: Messaging Additions in Orcas, Part 3

  • Nicholas Allen's Indigo Blog

    WCF, WF, and BizTalk Sessions at TechEd

    • 1 Comments

    With TechEd Developer closer at hand, I've put together the latest schedule data for sessions of interest to developers for each of the different products. The first group is sessions of general interest. The second group is sessions focusing on WCF and WF development. The third group is sessions focusing on CardSpace development. The fourth group is sessions focusing on BizTalk development.

    • Microsoft Strategy and Vision for SOA by Oliver Sharp

      Services are fundamentally changing the way we build, deploy, and manage applications. In this session we identify common challenges, and share our latest guidance and success stories. In addition, we outline Microsoft's strategy to simplify complexity in a service oriented world using our frameworks, servers, and online services.

    • The Road to "Oslo": The Microsoft Services and Modeling Platform by David Chappell

      Microsoft's "Oslo" project aims at creating a unified platform for model-based, service-oriented applications. This new approach will affect the next versions of several products and technologies, including the Microsoft .NET Framework, Microsoft Visual Studio, Microsoft BizTalk Server, Microsoft System Center, and more. Although many details of "Oslo" won't be public until later in 2008, this session provides an overview of what Microsoft has revealed so far. Along with a description of the problems it addresses, the session includes a look at several new "Oslo" technologies, including a general-purpose modeling language, role-specific modeling tools, a shared model repository, and a distributed service bus.

    • Platforms for SOA and Business Process Management: Comparing .NET and Java by David Chappell

      The .NET and Java/J2EE worlds have been competitors for several years. How do things stack up today? And what will the future look like? This session provides an independent perspective on how these two environments compare, focused on technologies for SOA and BPM. Comparisons include Windows Workflow Foundation (WF) vs. pure BPEL workflow and Windows Communication Foundation (WCF) vs. Service Component Architecture (SCA).

    • Framework and Microsoft BizTalk Best Practices with an Eye Toward "Oslo" by Jon Flanders

      Microsoft has announced "Oslo", the code-name for a wave of technology affecting the Microsoft .NET Framework, Microsoft BizTalk Server, and the idea of building service-oriented systems using Microsoft technologies. In this session we discuss what we know so far about these technologies, and how to think about what you are currently doing with Windows Communication Framework/Windows Workflow Foundation and BizTalk Server to best prepare for the future.

    • AJAX-Enable Your Windows Communication Foundation Services by Aaron Skonnard

      While ASP.NET AJAX has taken center stage, it's only compelling when you have interesting data feeds to call upon. This session shows you how to build AJAX-enabled services using some of the new features in Windows Communication Foundation (WCF) 3.5. We specifically cover how to configure your WCF services to respond directly to HTTP requests with JSON (AJAX- friendly) response messages. Along the way we uncover how the underlying implementation works while providing some design guidance and highlighting potential pitfalls.

    • Getting Workflows Running and Talking in Your Applications by Brian Noyes

      Once you understand the basics of Windows Workflow Foundation (WF) and can put together a workflow using the built-in activities, you will need to know how to get that workflow running in a variety of hosting environments and communicate between the workflow and the host application or the outside world. This session gives you a solid foundation to get started with these techniques. Gain a better understanding of how workflows exist in a hosting process and how to control the hosting services. Learn about the various forms of communication that can exist between a running workflow and the hosting application as well as with outside Web and WCF Services. Also, learn about the persistence and tracking features of WF.

    • Providing Load Balancing, Application-Level Failover, and Centralized Configuration Management with Windows Communication Foundation Services and Microsoft .NET Applications by Gregory Leake

      This session provides a detailed walkthrough of implementing the Configuration Service 1.5, a published MSDN sample application, in your own applications and services using the base classes/base implementation. The Configuration Service 1.5 provides dynamic clustering of scaled-out service nodes for both scale, and application/service reliability. In addition, the Configuration Service 1.5 provides a central Web-based management user interface that works with any application or service implementing the Configuration Service contract. If you need to manage/monitor multiple nodes in a load-balanced cluster, or want to use WCF to build SOA applications with many connecting service layers, this session is for you!

    • Durable Windows Communication Foundation Services by Juval Lowy

      Consider using Windows Communication Foundation (WCF) to implement long -running workflows or execution sequences that last days or even weeks, where the clients may connect, do some work and disconnect again. There is obviously little point in keeping proxies and hosts in memory, since it is not robust or scalable enough. You can design around this by persisting the state of the service between operations, but that implies some ability to connect back to that state in each operation. The session starts by discussing the challenges of writing such a durable service and the design options, and then demonstrates several ways of managing and binding to the service state, using message headers, or the new Microsoft .NET 3.5 context binding, contrasting and evaluating the alternatives. Through a series of conceptual demos, the sessions demystifies the WCF-solution of persistence providers, and even how to write a custom provider or use the built-in SQL provider. You also see some advanced .NET and WCF programming techniques.

    • Productive Windows Communication Foundation by Juval Lowy

      Windows Communication Foundation (WCF) has much more to it than the raw aspects of the technology. This talk is all about how to deal with common real-life hurdles, and how to effectively apply WCF, by presenting a set of tools, tips, tricks, best practices, original utilities, and ideas that can enhance your productivity significantly. This content-packed talk includes working with WCF-provided test host and clients, instrumentation, tracing and logging, in-proc factory, operation overloading, data contract helpers, type-safe callback proxies, fault debugging techniques, turning Windows Forms into services for easy UI updates, and queued services setup helper classes. All the techniques presented are used in real-life projects.

    • What Is the Context of This Conversation? Enabling Long Running Conversations in Workflow Services by Matthew Winkler

      The Microsoft .NET Framework 3.5 will introduce the functionality to call services from Windows Workflow Foundation (WF), and to expose workflows as a Windows Communication Foundation (WCF) service. A common pattern is to have a workflow serve as the coordinator between a number of other processes (including workflows). This talk discusses how these conversations are implemented in WF, and common patterns for conversing over a long period of time, including asynchronous messaging, long-running cancellable work, managing m-of-n responses and check pointing of progress.

    • Interoperability Scenarios with Microsoft .NET and J2EE by Gregory Leake

      This session looks at the new .NET StockTrader, which provides bi- directional interoperability between .NET and J2EE using Web services, as well as using the Configuration Service with both .NET clients and hosts via Windows Communication Foundation to interoperate with Java application servers and Java-based clients and services in general. The session is based on fully published sample code, so you can immediately use information from the session in developing your own projects.

    • Building Human Workflows with Windows Workflow Foundation State Machines by Keith Pijanowski

      State Machine workflows are workflows that transition from State to State where a state is a well know step, stage, or status of a business process. State Machines can also be passed data via external events. A workflow that measures its status via human readable states and can be passed data via external events is a good tool for building Human workflows. This session shows techniques for using State Machines as Human workflows. Specifically, we investigate persistence services for durability, tracking services for workflow reports, and tools for interacting with a state machine from a user interface.

    • Building Secure Web Services Using Windows Communication Foundation by Vittorio Bertocci

      Securing messages between clients and services is essential to protecting data. The Windows Communication Foundation (WCF) provides a versatile and interoperable platform for exchanging secure messages based upon both the existing security infrastructure and the recognized security standards for SOAP messages. In this session learn how to use WCF for transfer security and access control using familiar technologies such as HTTPS, Windows integrated security, X.509 certificates, SAML, and usernames and passwords, and also new technologies such as Windows CardSpace. This session also discusses how to extend WCF security to support custom security tokens, custom authentication methods, claims-based authorization, claims transformation, and custom principals.

    • Building RESTful Services Using Windows Communication Foundation 3.5 by Jon Flanders

      One of the key new features of Windows Communication Foundation 3.5 (WCF 3.5) is the Web Programming Model. The Web Programming Model enables developers to build Services using a RESTful architecture. The number of services implemented using this new architectural approach out in the wild is growing by leaps and bounds. In this session we cover the basics of REST versus SOAP/WS-*, and how to build Services using WCF 3.5 that are RESTful in nature. We also talk about adding Web feeds (RSS and/or ATOM) to our Services, which can enable easy access to enterprise data.

    • Messaging, Identity, and Workflow in the Cloud by Justin Smith

      Software-plus-services is a major part of the Microsoft strategy for the future. Just as the Microsoft .NET Framework is foundational software that lets you build virtually all manner of applications, Microsoft also hosts a foundational set of services that simplify composite application development. These services allow you to connect applications, implement the publish/subscribe pattern, manage identity and access control across the Internet, and run workflows over services. This talk describes the Microsoft vision for the Internet Service Bus, how to use it via the Windows Communication Foundation (WCF) API, and how these kinds of capabilites impact application architecture going forward. Some knowledge of WCF is useful but not necessary.

    • Introduction to the Microsoft Next Generation Server and Developer Framework for Claims-Based Identity and Access by Stuart Kwan

      Significant momentum is building around the industry vision of an Identity Metasystem. Come to this session to learn about the claims-based model for identity and access that lies at the core of this vision, the fundamental benefits it will bring to the next generation of connected applications, and preview the Microsoft server and framework product roadmap in support of this model. Topics include integration with Windows CardSpace and Information cards.

    • What's New with Windows CardSpace in the Microsoft .NET Framework 3.5 by Scott Golightly

      Windows CardSpace provides users with a convenient way of authenticating themselves to applications. Windows CardSpace was developed in conjunction with others in the industry to ensure that it will work with more than just Microsoft Web sites. Windows CardSpace is the most visible piece of the larger Identity MetaSystem. In this session we discuss the Identity MetaSystem and how Windows CardSpace works to overcome many of the problems with authentication on the Internet today. We then look at the enhancements to Windows CardSpace and the API that were introduced in version 3.5 of the .NET Framework.

    • Using Windows CardSpace for Safe and Convenient Sign-up and Sign-in to Your Web Application by Nigel Watling

      Windows CardSpace provides users with a simple, consistent, and secure way to authenticate to applications. Passwords are made redundant by taking advantage of public key cryptography and presenting the user with a set of Information Cards to represent their digital identity. These identities can be provided by the user and by third parties (e.g., banks, employers, government). CardSpace has privacy features, hardening against phishing, and support for multi-factor authentication (e.g., smart cards). By utilizing standard Web and Web service protocols, CardSpace can be used with any Web or Web service application, regardless of platform, with minimal effort from the developer. In this session learn how to modify a Web application to accept Information Card sign-up and sign-in.

    • Microsoft and Mainframes, Taming the Beast, Empowering Developers, Solving Mysteries by Bash Badawi

      Do you work in a Mainframe environment? Are you intimidated by all the jargon? This session arms you with the knowledge you need to connect, speak, and execute with authority. From establishing a simple connection to DB2 and MQSeries, to complying with security and exposing CICS transactions, this session puts it all together to empower the Microsoft .NET/BizTalk Developer to speak and act with authority.

    • Microsoft BizTalk RFID in Real World Deployments: Connecting Movements in the Physical World to Enterprise Applications by Sudhir Hasbe

      Every day more high-performing companies connect their internal departments, their support networks, and their demand and supply chains. Reducing the cost and complexity of supply chain management, Microsoft and its large ecosystem of hardware and software partners are working to enable mass adoption of RFID, SOA, and B2B solutions by developing feature-rich, low cost end-to-end RFID solutions. These solutions empower people to gain productivity and business efficiencies. This session showcases real-world deployments and shows how BizTalk RFID, which is part of BizTalk Server 2006 R2, can be used at edge of enterprise to capture physical world transactions and integrate these to existing enterprise applications using core EAI, B2B, and EDI capabilities of BizTalk Server 2006 R2. This session will showcase .NET based SDK of BizTalk RFID which enables Developers to build rich RFID enabled applications.

    • Extending the Application Platform with Cloud Services by Tharun Tharian

      Software-plus-services provides new choices for deploying applications and infrastructure on-premise and online. Over the last year Microsoft has introduced an initial wave of software-plus-services applications (Microsoft Dynamics CRM and CRM Live) and infrastructure (Microsoft BizTalk Server and BizTalk Services). In this session we outline Microsoft plans to extend the Application Platform with cloud services.

    • Technical Drilldown into Microsoft ESB Guidance by Brian Loesgen

      The Microsoft ESB Guidance uses Microsoft BizTalk Server 2006 R2 to support a loosely coupled messaging architecture, and extends the functionality of BizTalk Server to provide a range of new capabilities focused on building robust, connected, service-oriented applications that incorporate itinerary-based service invocation for lightweight service composition, dynamic resolution of endpoints and maps, Web service and WS-* integration, fault management and reporting, and integration with third- party SOA governance solutions. In this session, we drill down into the capabilities the ESB Guidance provides by stepping through typical use cases. We start by looking at the components that make up the ESB Guidance, including SOA governance integration. Then we show how these components are used to implement dynamic resolution of endpoints and transformations using the various resolvers provided. Lastly, we show how the resolution mechanism can be extended by the creation of custom resolvers.

    • Integrating Business Applications with Windows Communication Foundation by Joseph Klug, Jesus Rodriguez

      Do you need to retrieve Siebel contacts from Microsoft Office SharePoint Server? Pull SAP order details into Microsoft SQL Server? Integrate Oracle eBusiness Suite with Microsoft .NET? There are many options for doing this, from disparate API layers offered by the business applications to Web services deployed on different platforms. Now you can access all these business applications on a single platform by using Windows Communication Foundation (WCF) and the BizTalk Adapter Pack. The adapters in the BizTalk Adapter Pack are all based on the WCF LOB Adapter SDK, giving them the look and feel of WCF Bindings. They can be hosted in BizTalk Server, SQL Server, SharePoint Server, and any other .NET-connected application. The first release of the BizTalk Adapter Pack included adapters to SAP, Siebel, and Oracle DB. The next release will add adapters to Oracle eBusiness Suite and SQL Database. In this session, learn about the main features of these five adapters, the different solutions these adapters are applicable to, and demos focusing on Oracle eBusiness Suite integration.

    • Windows Communication Foundation Adapters in Microsoft BizTalk Server 2006 R2 by Aaron Skonnard

      This session introduces the new Windows Communication Foundation (WCF) integration found in BizTalk Server 2006 R2. See how R2 incorporates the WCF runtime into the BizTalk Server messaging layer through a suite of new WCF adapters that map to the built-in WCF bindings. We discuss how the WCF adapters work, along with when and how to use them. We also cover more advanced details related to message processing options, hosting, configuration, security, transactions, and service metadata. This session assumes you have basic experience with both WCF and BizTalk Server independently.

    • Microsoft BizTalk in the Supply Chain: Providing Supply Chain Visibility with EDI and Business Activity Monitoring by Elizabeth Graham, Chris Kabat

      BizTalk Server 2006 R2 includes two new capabilities that really affect the distribution supply chain. First, it includes EDI capabilities which allow trading partners to talk to each other in a more efficient manner. Second, it includes the ability to gather and process RFID information. This presentation focuses on the new EDI/AS2 features of Microsoft BizTalk Server 2006 R2 using a real-world example. This example demonstrates how a combination of EDI and RFID can be used to track logistical errors or theft. In this example, we explore how trading partners are managed, how EDI messages are parsed, how (and why) EDI Batching is implemented, and how EDI status reporting data is stored. Using the real-world example, we show how the EDI process is developed, maintained, and monitored using BizTalk Server 2006 R2 out-of-box features. We then show how BAM can be used to extend this solution and provide dashboard-like information to the enterprise overall.

    • Degrees of Freedom Port Binding in Microsoft BizTalk Server by Matt Milner

      In order to get the most out of your BizTalk implementations you need to understand your options when it comes to binding BizTalk orchestration ports. BizTalk offers many ways to bind ports for the purpose of receiving or sending messages. This session takes an in-depth look at the "degrees of freedom" a developer has when designing port binding strategies for BizTalk applications. Options range from: • Design-time static • Deployment-time static • Runtime dynamic • Runtime direct • Role-based dynamic Furthermore, the relationship that these binding techniques have with correlation and subscription is thoroughly investigated.

    • Building Federated Solutions on the Internet Service Bus by Clemens Vasters

      Using the code-name "BizTalk Services," Microsoft is building a set of "cloud" technologies that are developed and operated by Microsoft as a logical extension to the .NET Framework and the Microsoft SOA technologies. They aim to enable corporate software developers and ISVs building solutions that require broad, cross-organizational identity management, the ability to safely and securely traverse NATs and Firewalls to enable bi- directional communication, Internet-scale publish/subscribe services, broad interoperability, and services orchestration. In short, these technologies are expanding the reach of the ESB pattern to the Internet—that's why we call it "Internet Service Bus." In this session, Clemens takes you along on a "lots of code" tour through an exemplary solution built using these technologies.

  • Nicholas Allen's Indigo Blog

    Messaging Additions in Orcas

    • 6 Comments

    I've had scattered posts in the past talking about the messaging features and enhancements in Orcas. Over the next few days I'm going to be doing a bit of consolidating to organize that information into a few listings of the top changes using reasonably sized chunks. Today I'll look at some of the new protocols and community-driven features that were added.

    • Remote client address. We've added capture of the address of the remote endpoint for TCP and HTTP connections so that you can act on the client address in your service code.
    • Custom password validator for HTTP. We've added support for attaching the existing UserNamePasswordValidator class that performs password-based authentication to the basic HTTP security system.
    • WS Addressing 1.0 Metadata. While the base addressing protocol provides a transport-independent way of describing the address of a service, metadata provides additional descriptive capabilities through WSDL and policy to specify how addresses should be used.
    • WS Policy 1.5. Policy is a description language for requirements and capabilities that is used to define a model for web service interaction.
    • WS Reliable Messaging 1.1. Reliable messaging provides a protocol for reliably transmitting messages between a pair of endpoints despite system or network failures.

    Next time: Messaging Additions in Orcas, Part 2

  • Nicholas Allen's Indigo Blog

    BizTalk R3 Announced

    • 0 Comments

    Steve Martin sent out the announcement yesterday that the BizTalk Server line of products would be getting an R3 update during the first half of 2009. BizTalk Server 2006 R3 moves the BizTalk platform to the Windows Server 2008, SQL Server 2008, and .NET Framework 3.5 wave of releases. In addition, there are feature enhancements planned for:

    • Supporting UDDI 3.0
    • Improved integration and hosting with service-oriented applications
    • Connectivity with RFID and mobile devices
    • Enhanced interoperability for business protocols such as EDI and SWIFT

    You can read the original announcement by Steve on BizTalk Server 2006 R3 for more details.

  • Nicholas Allen's Indigo Blog

    Manual Context Management

    • 1 Comments

    How do I manually manage the context when sharing a client object?

    The default mode when using a context binding is for the context to be managed internally by the context channel underneath the client proxy. This is similar to how by default cookies are managed by an HTTP channel to send and receive cookie context. With an HTTP channel you can disable automatic cookie management and control the context yourself. There is a similar process that you can use to take control for a context binding.

    Here's a comparison of the two processes. You can get the code for HTTP by using the link above and with the further details on custom cookie handling so I won't print it again.

    With HTTP, you first need to turn off automatic cookie handling by setting the AllowCookies property on the HTTP transport binding element to false.

    With a context binding, you first need to turn off automatic context handling by setting the Enabled property on the context manager to false.

    IContextManager contextManager = channel.GetProperty<IContextManager>();
    contextManager.Enabled = false;

    Then, for HTTP you attach an HttpRequestMessageProperty that contains the desired cookies to a message using an OperationContextScope.

    With a context binding, you use the same OperationContextScope approach but attach the appropriate ContextMessageProperty instead.

    using (new OperationContextScope(client.InnerChannel))
    {
    ContextMessageProperty contextProperty = new ContextMessageProperty(contextData);
    OperationContext.Current.OutgoingMessageProperties[ContextMessageProperty.Name] = contextProperty;
    client.DoOperation();
    }

    Next time: Messaging Additions in Orcas

  • Nicholas Allen's Indigo Blog

    15 Years of Modern Web Browsing

    • 1 Comments

    On April 22, 1993 the initial version of the Mosaic web browser was released. Mosaic was the first web browser that had broad adoption as well as the first web browser that supported images embedded together with the marked up text.

    Mosaic had been developed over a few months by the National Center for Supercomputing Applications and initially released for UNIX platforms. Releases for Windows and Macintosh happened by the end of the year. In the follow year Mosaic was commercialized by a company called Spyglass, and the people and technology involved variously ended up starting competing browser projects called Netscape Navigator and Microsoft Internet Explorer.

  • Nicholas Allen's Indigo Blog

    Context Channel Shapes

    • 1 Comments

    What channels can be used in a context binding?

    The primary limitation for building a context binding is that the channel stack has to have the right shape. The context exchange protocol used by a context binding requires that the first invoked operation be a request-reply operation. This is so that the initial context can be established. In order to support a request-reply operation, the channel stack needs to support one of a particular set of shapes.

    There are currently five channel shapes allowed when using a context binding:

    • IRequestChannel
    • IRequestSessionChannel
    • IReplyChannel
    • IReplySessionChannel
    • IDuplexSessionChannel

    The request and reply channel shapes are paired for the client and server so on any particular endpoint there are three valid channel shapes.

    Conditions are limited further if you want to use HTTP cookies as your context exchange mechanism rather than the default of SOAP headers. In that case it's no longer possible to use a duplex channel so you're limited to variations on the request-reply message exchange pattern.

    Next time: Manual Context Management

  • Nicholas Allen's Indigo Blog

    At the MVP Summit

    • 0 Comments

    This week I got to spend two days with the BizTalk and Connected System MVPs as part of the 2008 MVP Summit. I want to thank everyone who came out to join us during the week. We had a great series of talks put together about some of the things that we aren't publicly talking about yet. For those of you that don't know who our MVPs are, you can read their profiles at the Microsoft MVP Awardees site.

  • Nicholas Allen's Indigo Blog

    Why Dual is Reliable

    • 1 Comments

    You may have noticed that bindings use two different classes for configuring reliability: ReliableSession and OptionalReliableSession. The only difference between the two is that OptionalReliableSession has an Enabled property that allows the reliable session to be turned off. If you only have a ReliableSession to work with, then there is no way for it to be disabled.

    The only standard binding that uses ReliableSession is WSDualHttpBinding. All of the other standard bindings that support reliability, such as NetTcpBinding and WSHttpBinding, use OptionalReliableSession. Why is WSDualHttpBinding the only one that has to be reliable?

    The reason for this is that WSDualHttpBinding has to coordinate together two different connections. The stack of binding elements for WSDualHttpBinding looks like this:

    1. TransactionFlowBindingElement
    2. ReliableSessionBindingElement
    3. SecurityBindingElement (optional)
    4. CompositeDuplexBindingElement
    5. OneWayBindingElement
    6. TextMessageEncodingBindingElement (or MtomMessageEncodingBindingElement)
    7. HttpTransportBindingElement

    Composite duplex splits the binding into separate input and output connections, and relies on a higher-level component to correlate the two. There are many ways to provide that correlation, one of which is a reliable session. Requiring that the reliable session be present matches the most common usage pattern and allows the other potential correlation mechanisms to be omitted without having to validate the resulting binding configuration. That's why WSDualHttpBinding requires a reliable session. If you have a different correlation mechanism that you want to use together with composite duplex, then you can build that with a custom binding.

    Next time: Context Channel Shapes

  • Nicholas Allen's Indigo Blog

    Hosting Identity

    • 1 Comments

    How can I run a service operation hosted in IIS using a specific identity?

    There are two ways for your operation to be running using a specific identity: start off running under that identity; or, start off running under a different identity and change to the right identity later. You can make either approach work although having to change the identity every time a service operation is called will introduce a small performance hit. Let's look at the two options.

    Impersonation is a mechanism that you can use to change to the right identity when the service operation is invoked. I've talked about impersonation in the past, mostly for impersonating the caller rather than impersonating a specific identity. However, impersonating a specific identity works in much the same way in terms of the Windows calls involved and generally works simpler in terms of the service setup required. That simplicity partially comes from not having the client involved in the act of impersonation but also because impersonating a specific identity doesn't have the same level of configurable options for automatically applying impersonation rules.

    The application pool is a mechanism that you can use to start with the right identity. This approach assumes that your service always wants to be running under the same specific identity. That partially covers the case of those missing configuration options. By default your application pool runs under the Network Service account. You can change that application pool identity to be any specific identity you want.

    This may require reorganizing how applications map into pools because the identity is shared by everyone in that pool.

    Next time: Why Dual is Reliable

  • Nicholas Allen's Indigo Blog

    One Shot Serialization

    • 1 Comments

    Why do some serialization errors when sending a response not result in a fault being returned to the client?

    In the typical service operation, sending a response is comprised of returning the appropriate information from the service method to construct a message. You might think of that response as a single operation but performing the response is divided up into many different acts. As an example of a division you could make, one way to split a response into separate acts is to say that there is an act of thinking about whether to respond and what the response contains, an act of constructing the response, and an act of transmitting the response.

    There is a moment in time during those acts in which the system moves from thinking about a response to actually carrying out the response. Because there are many different ways to divide the operation into a series of acts, that moment in time does not always make up a clear line separating one part of the system from another. However, if you get to the point where you've started carrying out the response, then you've attempted to respond. As an example in WCF terms, RequestContext.Reply is one key point at which the act of responding is realized.

    There are a variety of different messaging patterns; the ones that you should be familiar with are the one-way, request-reply, and duplex patterns. One-way patterns don't have a response so we can ignore those in this discussion. Request-reply patterns have the property that for any given request there can only ever be one response. If you think about the act of responding now, then there is a point at which your single attempt to respond has fail. This point is totally divorced from what takes place on the wire. It instead is an internal artifact of how the particular system divides the response into acts. A failure before that point would permit an error response to be sent instead while a failure after that point means that no response can ever be sent.

    Next time: Hosting Identity

  • Nicholas Allen's Indigo Blog

    TechEd 2008 Early Registration Ends Friday

    • 1 Comments

    It's not time to panic yet, but this is a sign that you should start getting your TechEd plans ready. This is the first year in the US that TechEd is split into two events.

    If you're reading this, then you're probably more interested in the developer conference.

    Although the developer conference is June 3-6 and the IT conference is June 10-13, they both have the same set of dates for registration. Around May is when registration started getting dicey the last few years although it's hard to predict what will happen with the new logistics.

  • Nicholas Allen's Indigo Blog

    Passing Around Endpoints

    • 1 Comments

    Can I construct a proxy object on one machine and pass it to another?

    No, there's no concept in WCF of sending a fully constructed proxy object from one place to another. Consider that there are two different things that "passing" a proxy object could mean: passing a reference to the object or passing a value by constructing an equivalent object in another location. If you passed a proxy by reference, then what you really would be doing is sending messages from your local machine to the remote machine on each invocation, to be sent by the real proxy. However, that's just a service that forwards messages between the two proxies, and that's something that you can build yourself.

    If you passed a proxy by value, then what you really would be doing is sending some description of the proxy to be created locally. Again though, that is something that you can build yourself by passing the endpoint description for the proxy you want to recreate and constructing a local proxy factory.

    Next time: One Shot Serialization

  • Nicholas Allen's Indigo Blog

    Running Setup with Pkgmgr

    • 1 Comments

    WCF is a standard component of Windows Vista, but some of the features, such as activation, are not enabled by default. Before you can use activation you need to explicitly enable the appropriate features. Typically, enabling and disabling features is done through the control panel but you can also configure components through command line tools such as pkgmgr.

    Pkgmgr works by taking a specification list of the components to install or uninstall. For instance, you can install the HTTP activation feature by running the following on the command line (assuming that all of the dependencies and parent packages are already in place):

    pkgmgr /iu:WCF-HTTP-Activation

    To get the right package names, you can use this table of command line names for packages.

    Next time: Passing Around Endpoints

  • Nicholas Allen's Indigo Blog

    Writing Smart Clients and Peer to Peer Programming

    • 1 Comments

    I don't recall seeing these before but I noticed that there were two new articles on WCF up on the .NET Framework Developer Center.

    The first article is by Juval Lowy on Writing Smart Clients. Juval talks about concurrency and synchronization issues in client application. These are important concepts to understand for UI-based applications because of the ugly consequences of getting threading wrong when dealing with UI. This article gives an in-depth explanation for web services of how to avoid the classic problem of non-responsive applications during a lengthy operation.

    The second article is by Amit Bahree and Chris Peiris on Peer-to-Peer Programming. This article covers the basics of P2P with a highlight on some of the new features when using Orcas on Vista.

  • Nicholas Allen's Indigo Blog

    Default ProtectionLevel for Standard Bindings

    • 1 Comments

    Previously I've described how messages are protected by using the ProtectionLevel attribute to specify the minimum level of protection. If you don't specify a protection level explicitly, then you'll get one by default that is computed based on the binding. This default protection level is the maximum protection level that the binding can achieve with the configuration that you've given it. Every configuration is going to be different so the only way to definitively know your protection level is to check. If you start with one of the standard bindings though, then here's what your protection level will be assuming that you haven't applied any configuration changes.

    • BasicHttpBinding: None
    • BasicHttpContextBinding: None
    • NetNamedPipeBinding: EncryptAndSign
    • NetPeerTcpBinding: None
    • NetTcpBinding: EncryptAndSign
    • NetTcpContextBinding: EncryptAndSign
    • WebHttpBinding: None
    • WSDualHttpBinding: EncryptAndSign
    • WSFederationHttpBinding: EncryptAndSign
    • WSHttpBinding: EncryptAndSign
    • WSHttpContextBinding: EncryptAndSign
    • WS2007FederationHttpBinding: EncryptAndSign
    • WS2007HttpBinding: EncryptAndSign

    Next time: Running Setup with Pkgmgr

  • Nicholas Allen's Indigo Blog

    Serving Data Grids in Silverlight

    • 0 Comments

    Jesse Liberty has posted a new tutorial demonstrating how to build a web service and Silverlight client application on top of a SQL data store. This shows off a number of features including LINQ, WCF, and Silverlight controls.

    Here are the major steps covered; some of the basic application functionality is recycled from earlier tutorials.

    1. Using a Silverlight web application project to create a solution with client and service projects
    2. Generating a LINQ mapping from your SQL tables
    3. Creating a web service to serve the data
    4. Creating a web service proxy in a Silverlight application
    5. Designing the Silverlight application interface
    6. Making the web service calls asynchronous
  • Nicholas Allen's Indigo Blog

    Jobs on the Connected Framework Team

    • 1 Comments

    I'd like to have some more people working at Microsoft so from time to time I'll be posting recruiting announcements. Rather than tell you about the same jobs repeatedly, I'll rotate through a variety of different teams that all work on related technologies. Hopefully, by the time I get back to the start, all of those positions will have been filled and there will be new jobs to advertise. Each of these teams is one that I've either worked on in the past or know the people so I'll be able to give you a bit of description about what each does.

    The first team up is the Connected Framework team. The Connected Framework team currently owns most of the framework pieces of WCF and WF as well as some of the older, related technologies such as ASMX and Remoting. Most of the jobs that you'll find here are developer and framework focused, whether they're for technical positions or community relationship positions.

    Since these links take you directly to where you can submit your resume for a specific position, over time they'll disappear as those positions are filled.

    If you've submitted your resume to one of these, you can also use the contact form on my blog to let me know that we should be looking for you.

  • Nicholas Allen's Indigo Blog

    Writing Multiple Detail Elements in Faults

    • 1 Comments

    How do I create a fault with multiple child nodes for the detail element? All of the overloads of CreateFault take a single argument for detail, which lets me build a tree of nodes but not a forest.

    The trick here is not to get hung up on trying to make the built-in convenience methods work. The object model for all of the message classes is just a wrapper around a way to interact with XML readers and writers. Notice that MessageFault is an abstract class. You can create your own subclasses to directly work against the underlying reader and writer.

    Also notice that there are only four methods that you have to override to make a MessageFault: Code, Reason, HasDetail, and OnWriteDetailContents. Code and Reason are parameters that you would have had to pass to CreateFault anyway. If you care about how the contents of the detail element are structured, then you definitely have a detail element. That really just leaves OnWriteDetailContents to implement, which is exactly what you wanted to precisely control the contents of the detail element.

    class MyMessageFault : MessageFault
    {
    FaultCode code;
    FaultReason reason;

    public MyMessageFault(FaultCode code, FaultReason reason)
    {
    this.code = code;
    this.reason = reason;
    }

    public override FaultCode Code
    {
    get { return this.code; }
    }

    public override bool HasDetail
    {
    get { return true; }
    }

    protected override void OnWriteDetailContents(XmlDictionaryWriter writer)
    {
    // You can write whatever XML you want here
    }

    public override FaultReason Reason
    {
    get { return this.reason; }
    }
    }

    On the reverse side, you'll have exactly the same problem with GetDetail because it too is limited to a single object. In this case though, you have the replacement directly accessible, GetReaderAtDetailContents, and are more likely to already have been using it.

    Next time: Default ProtectionLevel for Standard Bindings

  • Nicholas Allen's Indigo Blog

    General Security Guidance Videos

    • 0 Comments

    After talking about some of the work on WCF security I thought I'd mention an unrelated but similarly beneficial collection of videos on the MSDN security developer center. These security videos cover a wide variety of topics, each in the format of explaining how to solve a particular problem. The videos aren't specific to WCF so you might not be interested in all of them but there are quite a few that should be usable either directly or with minor adaptation. Look at the problem proposed in the video title and don't be afraid to skip through sections that go into detail on a technology that you're not using. The videos on general security topics, such as user principals or cryptography, tend to carry over the best.

  • Nicholas Allen's Indigo Blog

    The Pipe DACL

    • 2 Comments

    When a named pipe channel listener creates a new named pipe it has to supply a discretionary ACL that describes who can connect to the pipe. Here is how that DACL is constructed:

    1. An access control entry is added to deny GENERIC_ALL access to the well-known network SID (S-1-5-2).
    2. Access control entries are added to allow GENERIC_READ and GENERIC_WRITE access to a list of SIDs that is defined on the binding element. The default is to allow the well-known world SID (S-1-1-0). Since this list is an internal setting, you will almost always be using the default.
    3. An access control entry is added to allow GENERIC_READ and GENERIC_WRITE access to the well-known creator owner SID (S-1-3-0).

    And that's how the DACL gets built.

    There are a few other settings as well required to create the pipe if you're interested in their values. The pipe is bidirectional (PIPE_ACCESS_DUPLEX), data is written to the pipe as messages (PIPE_TYPE_MESSAGE), data is read from the pipe as messages (PIPE_READMODE_MESSAGE), we use overlapped IO (FILE_FLAG_OVERLAPPED), and if this is the first pipe created by the listener, then we need to say that more pipes are coming (FILE_FLAG_FIRST_PIPE_INSTANCE).

    Next time: Writing Multiple Detail Elements in Faults

Page 1 of 1 (22 items)