views:

50

answers:

1

I have a web service method, this calls functionality thats pretty complex in a c# class library.

In the class libraries there are a lot of try-catch scenarios.

What I would like to do is... if an error is detected, I want to set the return value of the webservice to false, and abort the thread, is this possible?

+1  A: 

Can't you do a typed FaultException?
And then you can handle it on the client side like this

 } catch (FaultException<MyFault> fe) {
Cherian
Never used one, but it sounds interesting, I will have to research it.
JL
I marked your question as correct, having thought about it, it will work in my scenario because I can pass the app contextual information in the MyFault object... thanks!
JL
Quick question: Will this work with .net v2?
JL
public class FaultException<TDetail> : FaultException Name: System.ServiceModel.FaultException<TDetail> Assembly: System.ServiceModel, Version=3.0.0.0
Cherian