none
Service design question, RRS feed

  • Question

  • What should services rather do, return errorcodes and messages with actual responses or return just responses and in case of bad requests, throw the exception ?

    And would your answer be different if that services is consumed by diverse clients such as Java applications, mobile apps on Windows Phone and iOS?


    Fahad

    Tuesday, January 15, 2013 7:15 PM

Answers

All replies

  • It is better to return a SOAP fault (FaultException or FaultException<T> than throw a .NET exception. .NET Exceptions are platform specific.

    See the following article:

    http://msdn.microsoft.com/en-us/library/ms733721.aspx

    Tuesday, January 15, 2013 7:22 PM
  • It is better to return a SOAP fault (FaultException or FaultException<T> than throw a .NET exception. .NET Exceptions are platform specific.

    See the following article:

    http://msdn.microsoft.com/en-us/library/ms733721.aspx

    Thanks. So are you in the Exceptions camp or you are suggesting to use cross-platform exceptions in case I am using Exceptions ?

    Fahad

    • Proposed as answer by bryanfree66 Tuesday, January 15, 2013 8:02 PM
    Tuesday, January 15, 2013 7:29 PM
  • I would definitely recommend using the cross-platform FaultException which creates a SOAP fault.
    Tuesday, January 15, 2013 7:53 PM