Reputation: 13
Is possible to know which contract has been called in a multiple contract service? In this, case, in the constructor.
The implementing class of the service is like this:
public class Service : IContract1, IContract2
{
public Service()
{
//Identify if constructor was called from IContract1 or IContract2
}
}
Upvotes: 1
Views: 420
Reputation: 5312
I think what you want to implement is a WCF Message Inspector. A MessageInspector is a "message filter" that can intercept and inspect the messages coming in or going out of the service layer infrastructure.
On the server, you would implement the IDispatchMessageInspector Interface.
Here is a pretty good example:
Upvotes: 1