Nicholas Allen's Indigo Blog

Windows Communication Foundation From the Inside

Browse by Tags

Tagged Content List
  • 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: Reliable Authentication Delays

    Why does turning on reliable sessions sometimes cause the client to take much longer to fail an authentication check? As part of doing an authenticated operation, the client must send a request to the server that contains information about the client's identity. This is just an abstract description...
  • Blog Post: Exceptions in Transactions

    I have a service operation that throws an exception to return an error back to the client. When the service operation is transactional, the transaction is aborted after calling this operation. How do I return the error under the transaction? A service operation call fails when the invoked method...
  • Blog Post: Fault Serialization with XmlSerializer

    About 20 posts ago, back before PDC, this was the next topic in the queue to be posted. It has been somewhat delayed by all of the talk of product announcements and details about future releases. Since it was becoming lonely and forgotten I thought I'd get back onto talking about the product that you...
  • 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: Avoid Exceptions in Faults

    FaultException supports both an untyped variant, for when you don't have any particularly interesting detail to provide, and a typed variant, for when you do. Don't use a subclass of Exception as the type of a typed FaultException. Here's why. When you use a typed FaultException, you are creating...
  • Blog Post: Writing Multiple Detail Elements in Faults

    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...
  • Blog Post: Using Call Context Initializers for Culture

    Let's build on a few earlier samples to actually demonstrate a working call context initializer. I'll start with yesterday's skeleton for a call context initializer and behavior . To that skeleton I'll add implementations of BeforeInvoke and AfterInvoke that initialize the operation thread with custom...
  • Blog Post: Embedding Arbitrary XML in Faults

    How can I directly craft the XML content that goes into a fault detail? Getting control over the detail element doesn't have to mean crafting the fault message yourself. While WCF requires that the fault detail be serializable using a data contract, remember that DataContractSerializer treats XmlElement...
  • Blog Post: Increasing the Maximum Fault Size

    When the service sends a fault message with a large detail, my client is unable to read the fault. Changing the standard settings for the maximum message size doesn't help. How can I read large fault messages? Fault messages have their own special quota that can be configured on the client proxy...
  • Blog Post: A Trick with Faults (Discussion)

    The code yesterday was meant to motivate a side-discussion on how faults get generated and handled between the server and client proxy. If you tried running that sample, then you would have seen that despite the FaultException being thrown on the service, the service call completes normally. The return...
  • Blog Post: A Trick with Faults

    What does this code print? It seems like both choices are quite reasonable. I'll have some discussion about this tomorrow. [ServiceContract] interface IService { [OperationContract(Action= "foo" )] Message Verb(Message input); } class Service : IService { public Message Verb(Message input) { throw...
  • Blog Post: Actions for FaultExceptions

    What should I set the action parameter to when creating a FaultException? There is indeed a pair of overloads for creating fault exceptions that take an action parameter, although most of the overloads lack this. public FaultException(TDetail detail, FaultReason reason, FaultCode code, string...
  • Blog Post: Errors Without Context

    I don't know how many people use the code I post, but I frequently stumble across peculiar or interesting behavior while trying to get the snippets working. If the behavior relates to the topic I'm trying to explain, then it goes in the article. If the behavior is something off to the side, then I'll...
  • Blog Post: Modifying HTTP Error Codes, Part 2

    Let's pick up where we left off last time with the question… How do I modify the HTTP status code that gets sent back with a fault? It's clear that we need to plug into the fault generation process somehow, but in past articles we've only seen fault handling for channels rather than services...
  • Blog Post: Modifying HTTP Error Codes, Part 1

    Back to errors and faults for a bit with this two part series on modifying the HTTP status code used for fault messages. First, we'll need some background. What happens at the HTTP level when a web service encounters a problem? That's a good question because it's not clear at all from programming...
  • Blog Post: Designing New Faults

    The last piece of this eleven part series on fault messages covers advice for channel authors that need to define their own set of faults. Everything here assumes that you're writing a protocol channel, that you have interesting failure cases that need to be acted on programmatically, and that your...
  • Blog Post: Faults and HTTP

    I left HTTP error codes out of yesterday's post on zen faults because they're representative of a distinct class of out-of-band fault messages. Out-of-band faults map fault information to a transport-specific mechanism that carries the data outside of the normal message payload. Although we don't send...
  • Blog Post: Zen Faults

    I've been talking about fault messages for a while now, specifically the kind that are sent around as the body contents of a SOAP message. However, some of the most important faults are reported without sending a message at all. In that case, we have to intuit that a fault has occurred based on the other...
  • Blog Post: Consuming Faults, Part 2

    Picking up from last time, we were going to look at consuming exceptions to possibly produce a fault message. The same machinery is used here as for the reverse conversion process . Exceptions go through an instance of FaultConverter, you can create your own FaultConverter in a custom channel to control...
  • Blog Post: Consuming Faults, Part 1

    The next two episodes are about consuming fault messages and exceptions. Day one covers consuming fault messages and possibly producing an exception. Day two covers consuming exceptions and possibly producing a fault message. Both directions work by going through an instance of FaultConverter. You can...
  • Blog Post: A Historical, Awkwardly Named Fault

    The second most distinguished fault, with almost as many special cases and discussion as the MustUnderstand fault I talked about last week, ended up not making it into the product. Some form of the fault is still in there of course, but it lost its mouthful of a name: the InvalidCardinalityAddressing...
  • Blog Post: The Most Distinguished Fault

    There is one fault that distinguishes itself from all the rest by the level of support built in for it throughout the platform. This fault has its own attribute, its own behavior, works with any transport or protocol, is one of the few faults handled by the default fault converter, and even gets a mention...
  • Blog Post: Creating Faults, Part 3

    A fault code is an opaque string that classifies an error. The fault code string doesn't have to be meaningful, it could be "X", but having short yet meaningful strings can aid the debugging experience. The real meaning is in the fault reason that we talked about last time. In addition to the fault code...
  • Blog Post: Creating Faults, Part 2

    Let's carry on with some discussion of the FaultCode and FaultReason classes. I was planning to do these two types together but I decided to do them as separate articles and make each of them a bit more detailed. I'll start with FaultReason as it's the simpler of the two. The fault reason is the...
Page 1 of 2 (29 items) 12