views:

179

answers:

3

Hi everyone,

I have an N-tier structure composed of WCF nodes. I need to occasionally pass very large volumes of data from a terminal node to the top node and I would like to avoid deserializing the very large data field during the intermediate hops. I can't pass directly to the top due to our fall over strategy. Is there any way to avoid deserializing my field? Thanks for any help

+1  A: 

Maybe you can do something with a [OnDeserializing] event?

See this.

Also, the serialization events are covered in "Programming WCF Services" (2nd Ed) by Juval Lowy in Chapter 3, pgs 107-110.

I'm not sure if you can completely short-circuit deserialization though... I've never tried.

Terry Donaghe
+1  A: 

I think Terry's on the right track. I would look at that event and by using a message contract you should be able to mark the part of the message you just want to pass through. You'll probably need to do some message manipulation (tear apart the incoming message, create a "custom" outgoing message) but you should be able to have the message continue on without being looked at.

Do a search WS-Addressing too; it may provide a pattern for doing this.

James Bender
A: 

I wonder if your failover strategy would be amenable to a "snapping the link" sort of thing. You would make your initial call to the intermediate node, which would eventually forward it to the terminal node. The terminal node would respond with the information necessary for the initial node to connect to it directly.

That way, load balancing or failover could determine which terminal node should be used, but after that determination is made, a direct connection could take place. Of course, you'd want to limit the duration of that direct connection to allow the failover strategy to change its mind over time.

John Saunders