WCF
There are 5 entries for the tag
WCF
On the course of last few months, I’ve been working with Craig Neuwirt, on what I consider one of the coolest additions to Castle WCF Integration Facility. Problem As you probably know by default all WCF calls are synchronous – you make a request, under the cover WCF blocks your thread using a WaitHandle waiting for response, then it unblocks your threads making it look like a local call. This makes things simple for a programmer, who does not have to deal with synchronization, but it’s an overkill from scalability and performance perspective. There are also one...
When you have a WCF service that is not a singleton, and you want to use non-default constructor, you enter a world of pain. There's a lot of hoops that you have to go through to plug an IInstanceProvider into the service. Even worse if you have many services. To alleviate the pain, I created a small helper method. private ServiceHost GetService<TService>( string address, Func<TService> createServiceInstance )
{
var service = new ServiceHost( typeof( TService ) );
var serviceInstanceFactoryBehavior = new ServiceInstanceFactoryBehavior(...
I’ve been doing a lot of work with WCF lately. It’s a great framework, and I really like it, but it has its drawbacks. First of all, it is overly complicated in certain places (security!), which makes it really hard to use sometimes. Its sheer size, makes it also hard to grasp. It has a lot of extensions points but the fact that you have to plug into them yourself adds to that complexity. It simply begs for good IoC integration.
You can partially alleviate that by using Castle WCF facility that lets you use IoC container to extend WCF, but...
Here’s few things I learned the hard way, about WCF. Say you’re using sessions and you have custom behavior on your service and your session. Your session doesn’t get committed and first (or any other) message in session gets delivered over and over (or no message get’s delivered at all) – i.e. it becomes a Poison Message. You have tracing turned on, but all it says is enigmatic ‘RequestContext aborted.’ The reason for that may be that your custom behavior throws an exception, that does get caught silently, but strangely, it...
I encountered interesting issue with WCF today. When calling a service method on the client side, I sometimes received fault with the following message: The message with Action 'SomeUri/Foo/Bar' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None). Turns out that this message is...