Convert multiple wcf services into a single servic

2019-07-23 05:52发布

问题:

I need guidance before starting huge amount of work.

We have numerous wcf services (around 500) exposed on single iis. Currently these services use the same binding but have different and lengthy service contracts (we have around 15000 operation contracts!). My task is to set up a common processing pipeline that will apply to all services. That way we will have a hook to control these currently autonomous services. With these hook we will have the opportunity to control transactional behavior, apply timeout and etc.

For this task, as the initial proposition, I am planning a code regeneration process that will map these existing services to a single service. Existing services will be reduced to a single service with a single operation like:

[OperationContract]

ExecutionResult Execute(Request req); 

As the owner of this single service, I will face all the requests and then will proceed with regular execution.

Since each service request is independent of another, I am planning to use reflection to transmit information about the actual operation contract to be executed. More specifically, I am planning to put MethodInfo and ParameterInfos of the actual wcf service into the Request object. In my service, I will invoke the actual service using these reflection data. The return type of the actual operation contract, if it is not null, will be put into the ExecutionResult.

Do you see a flaw in this approach. As I said, this is my initial proposal for the problem. Did anyone perform this kind of task before? Any help / ideas will highly be appreciated.