0

我有一个 WCF WF Web 服务(工作流服务 4.0),该服务的每个操作都具有相同的签名,但名称不同。

我的系统接收到一个事件{int eventType, int entityId},需要将该事件分派给我上面提到的使用配置的 Web 服务上的操作。

例如,假设我有配置文件(将 eventType 映射到操作名称):

1 -> "StartOrder"
5 -> "StopOrder"
8 -> "ProcessPaymet"
9 -> "RepartFraud"

所以如果我收到eventType等于 5 我需要做类似的事情:

string operationName = eventTypeToOperationMap[eventType];
new ChannelFactory<IMyWebService>().CreateChannel().CallOperation(operationName, entityId);

并且 IMyWebService 有一个方法:

void StopOrder(int entityId);

背景:IMyWebService是windows工作流基础4.0工作流服务。我希望能够向 Web 服务添加新的入口点,并更改事件调度程序的配置文件,而无需重新编译事件调度程序。

4

1 回答 1

0

You will most likely need to call another service (or another operation on your service) which takes the eventType as a parameter. Inside that operation, you will create a new channel and call the corresponding operation (just like you're already doing).

于 2012-01-10T20:10:23.973 回答