wcf-behaviour

Programmatic configuration of Exception-sending in WCF

I would like my Silverlight client to be able to display exceptions that have happened at the server during a WCF call. Given my current code to create a WCF Channel (on the client): // create the binding elements BinaryMessageEncodingBindingElement binaryMessageEncoding = new BinaryMessageEncodingBindingElement(); HttpTransportBinding...

WCF Message Debugging on WebHttpBehavior

I've created a custom binding in WCF for a custom MessageEncoder to allow messages to be written as XML using a wider range of encodings than WCF supports out of the box. The encoder appears to be working and I am able to send and receive messages, but I want to verify that the XML message being written is exactly as required by the serv...

Expectations when disabling a WCF Behaviour Extension

Straw poll 'cause we can't decide internally: If I'm implementing a BehaviorExtensionElement which is possible to disable through configuration is it reasonable/possible for CreateBehavior() to return null or should it always return a zombie behaviour object in some kind of disabled state instead? (Don't ask why we have disable instea...

Setting custom WCF-binding behaviour via .config file - why doesn't this work?

I am attempting to insert a custom behavior into my service client, following the example here. I appear to be following all of the steps, but I am getting a ConfigurationErrorsException. Is there anyone more experienced than me who can spot what I'm doing wrong? Here is the entire app.config file. <?xml version="1.0" encoding="utf-8"...

WCF challenge (in AfterReceiveRequest method of IDispatchMessageInspector Interface).

I'm getting some values in AfterReceiveRequest and want to use that in BeforeSendReply in WCF. Please help me, how I can do that. I'm working in C# project files. I can't use Seesion, ViewState here. I can use static fields, but It will not a good solution. Please give me best solution for this. Below are some lines of my code. pub...

WCF endpointBehaviors extension not picked up when the name param is present?

I am trying to extend my service endpoint behaviour with custom MessageInspector, extension works fine and its picked up, but only if I don’t define the “name” parameter on behaviour tag and don’t define specific behaviorConfiguration on the endpoint. This means I am extending all endpoints and this is what I don’t want. Could anyone ple...

How do you differentiate between application and infrastructure endpoints?

I'm creating a custom behaviour for WCF which can (for interoperability reasons) only function correctly when a service exposes a single application endpoint. I would like to be able to use the IServiceBehavior.Validate method to check that only one application endpoint is exposed by the service. Currently I'm doing the following: publ...