Sign in to follow this  

Microsoft & Gamedev's 1st Truly *Impossible* Question

Recommended Posts

[.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....

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this