Q about throwing Excaption from WebService to client:
I build WS which connect to DAL class --> DB,
if connections not succeed than DAL throw Excaption.
Excapion catch at WS [WebMethod] - the one who called the DAL
and than return to client ( [WebMethod] is string type) :
|
the problam: when ex catch on client side it give a loonggg.... Message desc. incude info that need to be hide from client (path fo WS and more...)
I dont want all the info at client... only the original Message from DAL Excaption.
how can I get it ???
Piotr JustynaPosted Nov 27, 2009, 6:18 AM
First of all I'm afraid I have to worry you - throwing exceptions from WS to the client side is not advised. If you' re using WCF it won't even allow you to throw exceptions from WS (as soon as you do that your proxy will die).
However, you can use 'Faults' (e.g. FaultException
Whatever solution you will use, please keep in mind, that allowing clients to receive exceptions from WS is quite risky.
Tell me please if this helps.
Cheers!