Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » Faults   (RSS)

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

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
Posted by Nicholas Allen | 1 Comments
Filed under: , ,

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

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

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

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,
Posted by Nicholas Allen | 3 Comments
Filed under: , ,

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
Posted by Nicholas Allen | 1 Comments
Filed under: , ,

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,
Posted by Nicholas Allen | 2 Comments
Filed under: , , ,

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
Posted by Nicholas Allen | 1 Comments
Filed under: ,

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
Posted by Nicholas Allen | 2 Comments
Filed under: , , , ,

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
Posted by Nicholas Allen | 2 Comments
Filed under: , , , ,

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

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
Posted by Nicholas Allen | 2 Comments
Filed under: , , ,

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
Posted by Nicholas Allen | 3 Comments
Filed under: , ,

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
Posted by Nicholas Allen | 7 Comments
Filed under: , ,
More Posts Next page »
 
Page view tracker