Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » Faults   (RSS)

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

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

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

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

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

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

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: , , , ,
More Posts Next page »
 
Page view tracker