Reputation: 15608
I want to catch an exception and then call Abort method on the WCF channel factories which are running but I am not sure how to do that?
e.g.
<wcf:channelFactory id="ShoppingService"
channelType="solution.TShoppingService, solution"
endpointConfigurationName="ServiceEndPoint" />
The service is in abort state.
I get the reference of the service as
IApplicationContext context = ContextRegistry.GetContext();
context["TShoppingService]...
but how do I call the abort method?
Upvotes: 1
Views: 247
Reputation: 1183
Tim's solution works:
((System.ServiceModel.ICommunicationObject)context["ShoppingService"]).Abort();
Upvotes: 1