Is it possible to get back my original exception (From SoapException to SqlException)

 I have winforms that accesses the data layer via web services. Exception occurred on the data access layer and I put try{}catch{} statements on the client layer(winforms) to capture the exception. The original exception type is SqlException but when the try{}catch{} on the client(winforms) captured the exception of diffent type which is SoapException.
My question is can I make the SoapExcepton return to its original exception which is SqlException




Answer this question

Is it possible to get back my original exception (From SoapException to SqlException)

  • Nasyua

    Thanks Dude.

  • rfreire

    Palkupz,

    Well basically, no you can't get anything except a soap exception at the client end.  Avery's blog has some information on this topic and explanations why.  Basically, the soap exception you are seeing is transposing the inner exception as the 'SoapFault'.  Avery suggests that you >COULD< serialize your inner exception into the Soap exception however then you would need to deserialize the soap fault message to determine what the original error was.  This would probably be better suited to simply use numerical fault codes to indicate why the error occurred.  This is by design to facilitate loose coupling in the web service world.

    http://dotavery.com/blog/archive/2004/02/10/472.aspx

    - David Sandor

  • Is it possible to get back my original exception (From SoapException to SqlException)