Alexey Raga
Rignt, but "true/false" result doesn't provide me with any information.
The exception fact itself is equal to "true/false". If I just want to know if the method call was successfull or not I can catch SoapException and be sure that I know it.
But if I change the logic and want to know any details, to know WHY it doesn't work.. I cannot know it with "true/false" result at all.
Well, about the exceptions. There is a good policy: if you expect the exception, catch this type of exception and then throw your own type of exception which will be much more informative for up-level code.
For instance, if my method incapsulates some data manipulations and database calls, it expets database exceptions as well as other kind of exceptions which can occure during data manipulations.
So I will catch all database exceptions and then create my own instance of the exception (something like MyService.DatabaseIsNotOperableException), set the InnerException property and throw my new exception.
The same with data manipulations, (let's say MyService.InvalidDataProvidedException) etc.
So, when I call this (web)method. I will not have "low-level" information such as unique constraints, my app doesn't know anything about any constraints.
But I WILL have the information and I WILL know what happens (database problem, input data is wrong, which data, etc). And I know exactly that my (web) method can throw particulary these exceptions, I can (sometimes) handle the situation in code.
At least I can provide user with the information "what's wrong" instead of just saying "I received false, your request was rejected".