Nicholas Allen's Indigo Blog

Windows Communication Foundation From the Inside

Browse by Tags

Tagged Content List
  • Blog Post: Schema Errors Extending Configuration

    After adding a custom binding element to configuration as a binding element extension, Visual Studio reports any use of the binding element in app.config as a schema violation. Is something wrong with the binding element? No, as long as the binding is able to be instantiated when you run the service...
  • 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: Finding Your Place

    How do I examine the settings for the endpoint that the message for the current operation was delivered to? There are two sources of settings depending on whether you’re interested in the endpoint runtime settings or the endpoint description. The endpoint description is the blueprint from which the...
  • 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: Rolling Your Own Status

    I’m trying to use an HTTP method that has defined a private protocol for status code. What can I do if the HttpStatusCode class doesn’t have the necessary value? The HttpStatusCode enumeration contains predefined constants for the status codes described by the HTTP 1.1 standard. Here you can take...
  • Blog Post: Full and Partial Profiles

    What is the difference between the client and full framework profiles? Which one should I target? The use of profiles has changed considerably from .Net 3.5 to .Net 4. In .Net 3.5 a client profile was introduced for Windows XP to be able to have a small web download that could run many applications...
  • Blog Post: Transaction Not Available

    Can I run code under a flowed-in transaction from within a message inspector? The setup work for the service transaction is done shortly before the actual call to the implementation of the service operation. The service transaction is not guaranteed to be available for any of these extensibility...
  • Blog Post: Debugging with Framework Source

    How do I debug calls that go through WCF? The easiest way to get started debugging through the framework is to enable source server support in Visual Studio. Source server support allows you to start debugging and have Visual Studio automatically download source code for the framework that you step...
  • Blog Post: Temporary Shadow Files

    Why are the code files for a WCF service running in IIS copied to the Temporary ASP.NET Files folder? When an assembly file is loaded, that file is locked to prevent changes while the application is running. A service that is running in IIS will continue to run until the application domain is unloaded...
  • Blog Post: Ignoring MustUnderstand

    How can I configure a client or server to handle messages even if a required header isn't understood? The SOAP mustUnderstand attribute on a header is used to indicate that processing the header is required in order to properly handle the message. If the header can't be processed, then a fault is...
  • 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: Three Networking Questions Answered with Samples

    How do I remove or change the framing headers used for a TCP connection? By writing a transport channel you can control exactly what information is read or written to the TCP socket. An example of doing this is in the WSE interoperability sample . How do I pass credentials from the client to...
  • Blog Post: Dynamic Routing Updates

    Can I modify the message filters used by a routing service after the service is started? No, the filter objects are not thread safe. Modifying the message filters while the routing service is running creates the risk of getting incorrect results while the filter is being changed. This is especially...
  • 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: Don't Check What Doesn't Have to be Correct

    I'm trying to validate the structure of messages against schema but there are SOAP headers that I don't recognize. How do I check that these headers are correct? SOAP headers already have a mechanism for saying whether you are required to deal with that header. The mustUnderstand attribute with a...
  • Blog Post: Double Fixing

    Now that Windows 7 is starting to see a lot of usage, I've had a few questions about installing hotfixes from product support for WCF issues when dealing with both Windows Vista/Server 2008 and Windows 7/Server 2008R2 systems. The two platforms are not quite the same when it comes to WCF (and other...
  • Blog Post: Interfaces Lack Data

    Why does having two known types blow up for being conflicting data contract types if the types are two different interfaces? An interface only contains declarations for its members. The interface doesn't contain any data fields and any implementation for the interface is located in the class that...
  • Blog Post: Building a Data Contract Serializer Behavior

    In configuration there's a DataContractSerializer behavior that I can add to my service, but the class it uses is internal. How do I get the same behavior programmatically? The DataContractSerializer behavior is a shortcut for setting the MaxItemsInObjectGraph and IgnoreExtensionDataObject options...
  • Blog Post: Finding CLR Types from Schema

    How can I found out what CLR type a particular XML schema definition will map to when using data contracts? Ask the type system what type it thinks the schema will map to. static string ClrTypeForXmlType(XmlQualifiedName xmlType) { return new XsdDataContractImporter().GetCodeTypeReference...
  • Blog Post: Order Best Practices

    Why is setting the Order property on data members recommended when adding fields in a new version of the contract? The data contract versioning best practices recommend taking three steps when adding fields in a new version of a contract. The first recommendation is to set the IsRequired property...
  • Blog Post: Transfer Modes and Buffer Sizes

    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...
  • Blog Post: Nothing to See Here

    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...
  • 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: Configuring Client Certificate Credentials

    How do I configure a client to provide the certificate for certificate credentials? You need to use the client credentials behavior to provide the credentials that the client will use to authenticate to the service. Here’s the basic template that you can fill out and stick in the behaviors section...
Page 1 of 11 (259 items) 12345»