Nicholas Allen's Indigo Blog

Windows Communication Foundation From the Inside

Browse by Tags

Tagged Content List
  • Blog Post: Optional Xml Fields

    When using DataContractSerializer with a data member that has IsRequired set to false, the generated schema has minOccurs of 0. However, when using XmlSerializer with an XML element that has IsNullable set to true, the schema has minOccurs of 1. Instead, the schema has nillable set to true. How do I...
  • Blog Post: Fix for Generating Metadata Behind a Router

    When generating metadata to describe a service, an address is published for the location at which the service can be reached. This is the address to which a client of the service should address a message. Ordinarily, the metadata address is obtained by looking at the address at which the service is...
  • Blog Post: Referring to Generic Interfaces in Contracts

    How do I write a contract type that has a generic parameter in a service configuration file? A contract reference is part of the template for defining a service endpoint through configuration: < endpoint address =”...” binding =”...” contract =”...” /> Now, you need to fill in...
  • Blog Post: Fix to Generate Contract Code for Dates

    Here's a bonus entry left from last week. Last week I ran a series covering fixes for WCF that may be hard to find and explaining the details behind each problem. Contract code generation takes a system-independent description of the types used for a messaging operation and generates source code...
  • Blog Post: Untyped Asynchronous Calls

    How do I asynchronously call a service operation without having a typed service contract on the client? An untyped contract is one where there is a single input or output parameter of type Message. Using the Message class rather than strong types allows you to reuse the same contract for any arbitrary...
  • Blog Post: Customizing Parameter Names

    Why does changing the name of a parameter in a service contract break compatibility with existing clients? Each named part of the message that appears in metadata or as part of the wire protocol needs to come up with a name from somewhere. We don't have any better default name for parameters...
  • Blog Post: Contract First Development through Schema

    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...
  • Blog Post: Data Deserialization Order

    Why are the members of a data contract expected in a particular order in order to be read? The order of members is frequently used to build an expectation of what element might be appearing next. Knowing the possible order of data instead of potentially having to accept data in any order tends to...
  • Blog Post: Overriding Namespaces from Serialization

    I’ve defined my own XML namespaces for the members of a data contract and now when I generate the client proxies I get some ugly CLR namespaces for the types. How do I fix this? The mapping from an XML or WSDL namespace to a CLR namespace is a mechanical transformation of breaking apart the authority...
  • Blog Post: Contract First Development Tool

    A beta release of the Web Services Contract First tool is available on CodePlex. This is a Visual Studio 2008 add-in targetting WCF made by the same group in the web services community that did a tool of the same name for ASMX (to tell the two apart, the WCF version is called WSCF Blue while the ASMX...
  • Blog Post: Environment Independent Versions

    In the recommendation for designing versionable contract names , there was no mention of the deployment environment of the service. Should this be included by, for example, having different namespaces for development and production deployments of the service? I generally don’t recommend including...
  • Blog Post: Collection Name Generation

    Last time we were looking at how to replace the default names used for serializing collections , such as ArrayOfKeyValueOfstringArrayOfstringty7Ep6D1, with more intelligible names. However, where did that funny looking name come from in the first place? The generation of default names is based on...
  • Blog Post: Naming Collection Items

    How do I replace the names of entries in a collection? By default the names inside of a collection are based on the type or role of the entry. < CheeseMap > < KeyValueOfstringCheeseListLjh4bohd > < Key > Sweden </ Key > < Value > < string > Adelost </ string...
  • Blog Post: Putting Data in Order

    How do I control the order in which members of the data contract are serialized? The DataMember attribute has a property called Order that influences the order in which the different members are serialized. Let's call the value of the Order property the data member's order and try to define what...
  • Blog Post: Distinguishing Messages

    Can I have two operations with the same name but different calling conventions use the same action? No, the point of the action property on a message is to guarantee that the message contains sufficient information to distinguish which operation it should be associated with. It would be of no benefit...
  • Blog Post: Callback Behaviors

    How do I apply behaviors to the callback portion of a callback contract? If you were going to apply a behavior to the non-callback portion of the callback contract, you'd do so through an IContractBehavior attached to the relevant part of the service description. On the IContractBehavior you'd implement...
  • Blog Post: Using Faults with Untyped Messages

    When using a typed contract, incoming messages on the server are shredded on your behalf to be turned into method calls and parameters. Ordinarily, the particular method call selected for an application messages will have the same parameterized contract as the message. This allows the transformation...
  • Blog Post: Getting Rid of Namespaces

    How do I write a contract for a wrapped message in the default namespace? I've written a quick sample to demonstrate what happens when you write the contract without taking any namespaces into account. [ServiceContract] public interface IService { [OperationContract] [WebInvoke(BodyStyle = WebMessageBodyStyle...
  • Blog Post: System Types in Metadata

    It's bad practice to use system types when defining an operation contract. A system type is often a complex composition of primitive types that has no direct analog in other implementations. By using a system type, you bind your service to the particular implementation used by that type, which effectively...
  • Blog Post: Avoiding Address Filters

    The address filter mode that we looked at last time solved the problem of funneling all of the messages with a given prefix address to our service instance. Changing the filter mode still left us with the problem of dispatching from that universal contract to all of the logical operations that live inside...
  • Blog Post: Naming Contracts for Versioning

    Some tips for building support for versioning into the naming of data contracts. First, the primary route for versioning should be through the namespace part of the contract rather than the member name part of the contract. Versioning the contract through member names tends to leak across the service...
  • Blog Post: Pointing to External Metadata

    I've previously talked about using WSDL extensions to provide custom modifications to the WSDL import and export process. Making modifications to an existing WSDL document or to the existing WSDL processing is a great way to make small changes when the default behavior almost gets you to where you want...
  • Blog Post: Setting the Configuration Name

    What's the difference between the Name and ConfigurationName on service contracts and behaviors? The Name property sets the name of the service in metadata while the ConfigurationName property sets the name of the service in configuration. Metadata is the part of the service description that is...
  • Blog Post: Private Data Members

    Why does a data contract with private or internal members generate a proxy with public fields? The obvious answer is that the representation for data contracts doesn't contain information about member visibility but that just leads to the question of why the information isn't preserved by the representation...
  • Blog Post: Configuring Protection Level

    Is it possible to configure the protection level for message parts at runtime? Only certain configurations make doing this particularly easy. When using transport security with Windows credentials, the WindowsStreamSecurityBindingElement allows you to directly set the protection level (changing...
Page 1 of 2 (48 items) 12