• Advertisement
Sign in to follow this  

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

This topic is 3321 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

Share this post


Link to post
Share on other sites
Captain_Thunder - yes, a cleaner alternative using serialized Exception subclasses and not faults.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement