c# - How to propagate an exception across SOAP Web Services? -


i have standard asmx web service. want throw custom exception , have caught on client side. thing ever comes across soapexception. example:

// server side code [webmethod] public void foo(string bar) {     throw new customexception(bar); }  public class customexception : exception {     .... }   // client side code public void callfoo() {     try {         service.foo()     }     catch (customexception ex) {         console.writeline(ex.message);     }     catch (soapexception ex) {         console.writeline("it hits here");     }     catch (exception ex) {         console.writeline(ex.message);     } } 

is there way send through customexception exception? serialize somehow perhaps?

according msdn:

'[...] exceptions thrown xml web service method thrown soapexception[...]', handling , throwing exceptions in xml web services.

that said, nothing prevents creating exception wrapper class , serialize it, @davogones suggested on post:

how serialize exception object in c#?


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -