Question

Getting some weird behavior in a system. Here's what's up:

I have a main which sets up server endpoints using WCF before opening the channels for read/write.

I also have an entity-framework based database abstraction layer. When I instantiate my DataBase class, I connect to the DB.

One of my endpoints contains this DB abstraction class. I instantiate the database object after I register the endpoint with WCF.

If I do it in this order:
Add service to WCF
Connect to DB
open WCF endpoints for read/write

I fault on transmission.

If I do it in this order:
open WCF endpoints for read/write
add service to WCF
connect to DB

everything works.

I'm admittedly fairly lost as to why this is happening, any ideas would be much appreciated, and if you'd be so kind as to tell me any more information you need I'll be happy to post it. Thanks!

Was it helpful?

Solution

Managed to solve the problem, in case anyone was wondering about this.

We have a method to add known types to our serialization system when the WCF Layer starts up.

WCF doesn't want to serialize abstract or generic types, but the OR framework uses them extensively. When we connected the DB before doing this type collection, the WCF would hiccup on going over a generic type in the deserialization phase.

Adding checks to make sure types weren't abstract or generic before they were added to that collection fixed the problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top