Microsoft & Gamedev's 1st Truly *Impossible* Question
[.NET]
Microsoft seems to be undecided about how to handle web services: the right way or the wrong way.
My web app defines several exceptions (all subclasses of Exception) that I would like to throw across my service. Thus, if a consumer hands me a malformed request, or bad data, etc. I want to throw the exception server-side and send it back to them so they can catch it and handle it accordingly.
Microsoft allows user-defined types to be passes over a web service; they just have to be serializable. And of course, Microsoft allows their own built-in .NET types to be serialized and passed as well. But to my suprise, it refuses to let me serialize a sub-classed Exception (or any other sub-classed built-in type) and pass it. Instead, I have to wrap my exception inside a SOAP fault, pass the fault, and then force the client to unwrap the fault and handle the exception that way on their end.
This method works; but is sloppy. I must be missing something....
Quote:Original post by Zahlman
... and the question is?
I believe he is seeking an alternative to his current method, that is, a way to serialize his own subclasses, or a cleaner substitute than what he currently has.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement