Hi, this might sound like a daft question but I can't seem to find a obvious answer. I have to quickly create a simple WCF service and I have created all the classes I need decorated with the DataContract and DataMember attributes and I have created a custom exception class and everything is working. However if an exception is thrown within my service no matter what it is should I always throw my FaultException<MyException>
with a detailed message or use different exception types. I'm guessing I always throw that exception as the client can handle that single exception type.
Also if the client passes me a completely null object then I realise that is normal to throw an exception but what if a member of that class is not as expected such as null or even an empty string? Would I still throw my exception with that as the reason or would I just return a message in my response object? I know this might sound like a stupid question but just concerned that I might use exceptions to drive the functionality but then I'm thinking that throwing an exeption makes sense.
Many Thanks
Paul