Architecture question: Exceptions vs status codes

Discussion in 'ASP .Net Web Services' started by chen, Dec 20, 2005.

  1. chen

    chen Guest

    We're having an internal debate about the merits & demerits of
    returning status codes in the output message vs exceptions to signify
    errors in handling a Web method.

    The status code camp is arguing that business rules related errors are
    to be conveyed using status code while reserving the exception approach
    (using SoapException) to system related errors (like say database
    connection issues). This implies that GetFoo() returns a composite
    message that includes StatusCode, Foo (the result) as well as other
    error code/descriptions.

    The cons of the status code approach is that it makes client side code
    really painful:

    try {
    response = proxy.GetFoo();
    switch ( response.StatusCode )
    {
    case Success:
    // response.Foo is valid
    case NotFound: // handle this error
    case OtherError:
    // look at response.ErrDetail for additional
    context about the error
    ....
    }
    }
    catch (SoapException ex)
    {
    // unpack the Detail element to figure out what happened &
    handle it
    // appropriately
    }

    The other big drawback, is that the client could completely ignore the
    status code. Also, the status codes will have to be conveyed
    "out-of-band" thru other means of documentation - the .wsdl alone is
    perhaps not sufficient.

    The exception camp is arguing for using Soap Faults in the WSDL &
    throwing SoapExceptions from the web method. This allows for
    consistent handling of all errors (business or system related errors)
    on the client side.

    The cons of the exception approach is that 1.1 WSDL simply ignores the
    SOAP Fault when generating client side proxy code. [Other toolkits,
    notably, Axis for e.g. turns the SOAP Faults into custom exceptions
    which makes it easier for clients to handle them appropriately].
    Does WSDL 2.0 and/or WCF (Indigo) handle SOAP Faults any better?

    Although the exception approach seems like a hands down winner, are
    there any scenarios where returning status code might make sense?? or
    is exception approach the way to go always? Comments?

    TIA
     
    chen, Dec 20, 2005
    #1
    1. Advertising

  2. chen

    WebMatrix Guest

    I would also be interested what others have to say.

    In my experience dealing with application related errors, it's always best
    to "throw" those to the client and let client handle them, this way there's
    no ambiguity to the client, it’s an exception that have to be handled;
    display message to the users, log it, ignore it, whatever.
    Besides any client should have try catch around web service call anyway to
    check for other errors like Internet connectivity.

    > catch (SoapException ex)
    > {
    > // unpack the Detail element to figure out what happened &
    > handle it
    > // appropriately
    > }


    There is not really any unpacking to do: ex..Message and ex.InnerException
    should be sufficient to tell you what went wrong for most of the cases. Also,
    from what I understand, when Web Service throws an exception .NET runtime
    does generate SOAP Fault message as part of the response, and proxy class
    built with VS .NET should pick it up and load it into Exception object for
    you.

    As far as custom error messages/codes, I am not a big fan of magic numbers.
    It requires too much administration, documentation and creates unnecessary
    confusion.
     
    WebMatrix, Dec 20, 2005
    #2
    1. Advertising

  3. Hi Chen,

    I also think if there is no much concerns about using custom exceptions in
    your scenario, it'll be the prefered means. And for status code, it's good
    and simple if we're designing a certain well-defined and reusable
    framework( e.g the COM runtime system....). Otherwise, for concrete
    business logic specific application, we're recommended to define some
    custom exceptions(with human readable error message....) and put the
    exception handling code at clientside.....

    Please feel free to post here if you have any other concerns or
    consideration...

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    --------------------
    | Thread-Topic: Architecture question: Exceptions vs status codes
    | thread-index: AcYFpG6026XdDQlrQiavfy8oBNariw==
    | X-WBNR-Posting-Host: 67.134.238.195
    | From: =?Utf-8?B?V2ViTWF0cml4?= <>
    | References: <>
    | Subject: RE: Architecture question: Exceptions vs status codes
    | Date: Tue, 20 Dec 2005 12:32:01 -0800
    | Lines: 27
    | Message-ID: <>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="Utf-8"
    | Content-Transfer-Encoding: 8bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | Content-Class: urn:content-classes:message
    | Importance: normal
    | Priority: normal
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | Xref: TK2MSFTNGXA02.phx.gbl
    microsoft.public.dotnet.framework.aspnet.webservices:31185
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    |
    | I would also be interested what others have to say.
    |
    | In my experience dealing with application related errors, it's always
    best
    | to "throw" those to the client and let client handle them, this way
    there's
    | no ambiguity to the client, it’s an exception that have to be handled;
    | display message to the users, log it, ignore it, whatever.
    | Besides any client should have try catch around web service call anyway
    to
    | check for other errors like Internet connectivity.
    |
    | > catch (SoapException ex)
    | > {
    | > // unpack the Detail element to figure out what happened &
    | > handle it
    | > // appropriately
    | > }
    |
    | There is not really any unpacking to do: ex..Message and
    ex.InnerException
    | should be sufficient to tell you what went wrong for most of the cases.
    Also,
    | from what I understand, when Web Service throws an exception .NET runtime
    | does generate SOAP Fault message as part of the response, and proxy class
    | built with VS .NET should pick it up and load it into Exception object
    for
    | you.
    |
    | As far as custom error messages/codes, I am not a big fan of magic
    numbers.
    | It requires too much administration, documentation and creates
    unnecessary
    | confusion.
    |
    |
     
    Steven Cheng[MSFT], Dec 21, 2005
    #3
  4. Hi Chen,

    Any progress on this or does my last reply helps a little? If anything else
    we can help, please feel free to post here.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    --------------------
    | X-Tomcat-ID: 101488329
    | References: <>
    <>
    | MIME-Version: 1.0
    | Content-Type: text/plain
    | Content-Transfer-Encoding: 7bit
    | From: (Steven Cheng[MSFT])
    | Organization: Microsoft
    | Date: Wed, 21 Dec 2005 06:05:18 GMT
    | Subject: RE: Architecture question: Exceptions vs status codes
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    | Message-ID: <>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    | Lines: 81
    | Path: TK2MSFTNGXA02.phx.gbl
    | Xref: TK2MSFTNGXA02.phx.gbl
    microsoft.public.dotnet.framework.aspnet.webservices:31189
    | NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
    |
    | Hi Chen,
    |
    | I also think if there is no much concerns about using custom exceptions
    in
    | your scenario, it'll be the prefered means. And for status code, it's
    good
    | and simple if we're designing a certain well-defined and reusable
    | framework( e.g the COM runtime system....). Otherwise, for concrete
    | business logic specific application, we're recommended to define some
    | custom exceptions(with human readable error message....) and put the
    | exception handling code at clientside.....
    |
    | Please feel free to post here if you have any other concerns or
    | consideration...
    |
    | Regards,
    |
    | Steven Cheng
    | Microsoft Online Support
    |
    | Get Secure! www.microsoft.com/security
    | (This posting is provided "AS IS", with no warranties, and confers no
    | rights.)
    |
    | --------------------
    | | Thread-Topic: Architecture question: Exceptions vs status codes
    | | thread-index: AcYFpG6026XdDQlrQiavfy8oBNariw==
    | | X-WBNR-Posting-Host: 67.134.238.195
    | | From: =?Utf-8?B?V2ViTWF0cml4?= <>
    | | References: <>
    | | Subject: RE: Architecture question: Exceptions vs status codes
    | | Date: Tue, 20 Dec 2005 12:32:01 -0800
    | | Lines: 27
    | | Message-ID: <>
    | | MIME-Version: 1.0
    | | Content-Type: text/plain;
    | | charset="Utf-8"
    | | Content-Transfer-Encoding: 8bit
    | | X-Newsreader: Microsoft CDO for Windows 2000
    | | Content-Class: urn:content-classes:message
    | | Importance: normal
    | | Priority: normal
    | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | | Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    | | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | | Xref: TK2MSFTNGXA02.phx.gbl
    | microsoft.public.dotnet.framework.aspnet.webservices:31185
    | | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    | |
    | | I would also be interested what others have to say.
    | |
    | | In my experience dealing with application related errors, it's always
    | best
    | | to "throw" those to the client and let client handle them, this way
    | there's
    | | no ambiguity to the client, it’s an exception that have to be
    handled;
    | | display message to the users, log it, ignore it, whatever.
    | | Besides any client should have try catch around web service call anyway
    | to
    | | check for other errors like Internet connectivity.
    | |
    | | > catch (SoapException ex)
    | | > {
    | | > // unpack the Detail element to figure out what happened &
    | | > handle it
    | | > // appropriately
    | | > }
    | |
    | | There is not really any unpacking to do: ex..Message and
    | ex.InnerException
    | | should be sufficient to tell you what went wrong for most of the cases.
    | Also,
    | | from what I understand, when Web Service throws an exception .NET
    runtime
    | | does generate SOAP Fault message as part of the response, and proxy
    class
    | | built with VS .NET should pick it up and load it into Exception object
    | for
    | | you.
    | |
    | | As far as custom error messages/codes, I am not a big fan of magic
    | numbers.
    | | It requires too much administration, documentation and creates
    | unnecessary
    | | confusion.
    | |
    | |
    |
    |
     
    Steven Cheng[MSFT], Dec 28, 2005
    #4
  5. chen

    chen Guest

    While we have decided to go with the exceptions route, the next
    question that needs to be answered is how to tell the clients of the
    web service how, lets say GetFoo(), will fail.

    Here's a WSDL snippet
    <operation name="GetFoo">
    <documentation xmlns="http://schemas.xmlsoap.org/wsdl/"/>
    <input name="GetFooByLabel" message="tns:getFooByLabelIn"/>
    <output name="GetFooByLabel" message="tns:getFooByLabelOut"/>
    <fault name="NotFound" message="tns:NotFoundException"/>
    </operation>

    Right now, it appears that the Soap faults are merely documenting the
    fact that GetFoo() operation could result in NotFound fault code. All
    the tools that i tried (WSDL, wseWSDL) ignore them & there doesn't
    appear to be any easy way to turn them into custom exceptions on the
    client side. So does it add any value in specifying them in the .wsdl
    at all? What are some of the best practices in this area?
     
    chen, Dec 28, 2005
    #5
  6. Thanks for your followup Chen,

    yes, for ASP.NET Webservice, it has limited exception framework, the
    serverside webservice can only propagate SoapException as the exception
    object to clientside.... And our serverside custom exception detailes can
    be encapsulated in the SoapException's properties.... (xmlNode....). The
    msdn .NET exception management guide also mentioned this:

    #Exception Management Architecture Guide
    http://msdn.microsoft.com/library/en-us/dnbda/html/exceptdotnet.asp?frame=tr
    ue

    And here is a certain tech article discussing on encapsulating custom
    exception info through SoapException and the xml data:

    #Exception Handling in Web Services
    http://www.developer.com/net/csharp/article.php/10918_3088231_1

    Hope helps. Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)



    --------------------
    | From: "chen" <>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    | Subject: Re: Architecture question: Exceptions vs status codes
    | Date: 28 Dec 2005 10:21:00 -0800
    | Organization: http://groups.google.com
    | Lines: 19
    | Message-ID: <>
    | References: <>
    | <>
    | <>
    | <E077n#>
    | NNTP-Posting-Host: 141.162.101.50
    | Mime-Version: 1.0
    | Content-Type: text/plain; charset="iso-8859-1"
    | X-Trace: posting.google.com 1135794066 4792 127.0.0.1 (28 Dec 2005
    18:21:06 GMT)
    | X-Complaints-To:
    | NNTP-Posting-Date: Wed, 28 Dec 2005 18:21:06 +0000 (UTC)
    | User-Agent: G2/0.2
    | X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET
    CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe)
    | Complaints-To:
    | Injection-Info: f14g2000cwb.googlegroups.com; posting-host=141.162.101.50;
    | posting-account=X7ANQg0AAAB-ENGC8U9YFBV5V2pedTsn
    | Path:
    TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
    ne.de!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.gigan
    ews.com!postnews.google.com!f14g2000cwb.googlegroups.com!not-for-mail
    | Xref: TK2MSFTNGXA02.phx.gbl
    microsoft.public.dotnet.framework.aspnet.webservices:31228
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    |
    | While we have decided to go with the exceptions route, the next
    | question that needs to be answered is how to tell the clients of the
    | web service how, lets say GetFoo(), will fail.
    |
    | Here's a WSDL snippet
    | <operation name="GetFoo">
    | <documentation xmlns="http://schemas.xmlsoap.org/wsdl/"/>
    | <input name="GetFooByLabel" message="tns:getFooByLabelIn"/>
    | <output name="GetFooByLabel" message="tns:getFooByLabelOut"/>
    | <fault name="NotFound" message="tns:NotFoundException"/>
    | </operation>
    |
    | Right now, it appears that the Soap faults are merely documenting the
    | fact that GetFoo() operation could result in NotFound fault code. All
    | the tools that i tried (WSDL, wseWSDL) ignore them & there doesn't
    | appear to be any easy way to turn them into custom exceptions on the
    | client side. So does it add any value in specifying them in the .wsdl
    | at all? What are some of the best practices in this area?
    |
    |
     
    Steven Cheng[MSFT], Dec 29, 2005
    #6
  7. Hi Chen,

    Does the things in my latest reply helps? If still anything else we can
    help, please feel free to post here.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    --------------------
    | X-Tomcat-ID: 107681489
    | References: <>
    <>
    | MIME-Version: 1.0
    | Content-Type: text/plain
    | Content-Transfer-Encoding: 7bit
    | From: (Steven Cheng[MSFT])
    | Organization: Microsoft
    | Date: Thu, 29 Dec 2005 07:00:03 GMT
    | Subject: Re: Architecture question: Exceptions vs status codes
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    | Message-ID: <>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    | Lines: 89
    | Path: TK2MSFTNGXA02.phx.gbl
    | Xref: TK2MSFTNGXA02.phx.gbl
    microsoft.public.dotnet.framework.aspnet.webservices:31231
    | NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
    |
    | Thanks for your followup Chen,
    |
    | yes, for ASP.NET Webservice, it has limited exception framework, the
    | serverside webservice can only propagate SoapException as the exception
    | object to clientside.... And our serverside custom exception detailes
    can
    | be encapsulated in the SoapException's properties.... (xmlNode....). The
    | msdn .NET exception management guide also mentioned this:
    |
    | #Exception Management Architecture Guide
    |
    http://msdn.microsoft.com/library/en-us/dnbda/html/exceptdotnet.asp?frame=tr
    | ue
    |
    | And here is a certain tech article discussing on encapsulating custom
    | exception info through SoapException and the xml data:
    |
    | #Exception Handling in Web Services
    | http://www.developer.com/net/csharp/article.php/10918_3088231_1
    |
    | Hope helps. Thanks,
    |
    | Steven Cheng
    | Microsoft Online Support
    |
    | Get Secure! www.microsoft.com/security
    | (This posting is provided "AS IS", with no warranties, and confers no
    | rights.)
    |
    |
    |
    | --------------------
    | | From: "chen" <>
    | | Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    | | Subject: Re: Architecture question: Exceptions vs status codes
    | | Date: 28 Dec 2005 10:21:00 -0800
    | | Organization: http://groups.google.com
    | | Lines: 19
    | | Message-ID: <>
    | | References: <>
    | | <>
    | | <>
    | | <E077n#>
    | | NNTP-Posting-Host: 141.162.101.50
    | | Mime-Version: 1.0
    | | Content-Type: text/plain; charset="iso-8859-1"
    | | X-Trace: posting.google.com 1135794066 4792 127.0.0.1 (28 Dec 2005
    | 18:21:06 GMT)
    | | X-Complaints-To:
    | | NNTP-Posting-Date: Wed, 28 Dec 2005 18:21:06 +0000 (UTC)
    | | User-Agent: G2/0.2
    | | X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
    ..NET
    | CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe)
    | | Complaints-To:
    | | Injection-Info: f14g2000cwb.googlegroups.com;
    posting-host=141.162.101.50;
    | | posting-account=X7ANQg0AAAB-ENGC8U9YFBV5V2pedTsn
    | | Path:
    |
    TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
    |
    ne.de!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.gigan
    | ews.com!postnews.google.com!f14g2000cwb.googlegroups.com!not-for-mail
    | | Xref: TK2MSFTNGXA02.phx.gbl
    | microsoft.public.dotnet.framework.aspnet.webservices:31228
    | | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    | |
    | | While we have decided to go with the exceptions route, the next
    | | question that needs to be answered is how to tell the clients of the
    | | web service how, lets say GetFoo(), will fail.
    | |
    | | Here's a WSDL snippet
    | | <operation name="GetFoo">
    | | <documentation xmlns="http://schemas.xmlsoap.org/wsdl/"/>
    | | <input name="GetFooByLabel" message="tns:getFooByLabelIn"/>
    | | <output name="GetFooByLabel" message="tns:getFooByLabelOut"/>
    | | <fault name="NotFound" message="tns:NotFoundException"/>
    | | </operation>
    | |
    | | Right now, it appears that the Soap faults are merely documenting the
    | | fact that GetFoo() operation could result in NotFound fault code. All
    | | the tools that i tried (WSDL, wseWSDL) ignore them & there doesn't
    | | appear to be any easy way to turn them into custom exceptions on the
    | | client side. So does it add any value in specifying them in the .wsdl
    | | at all? What are some of the best practices in this area?
    | |
    | |
    |
    |
     
    Steven Cheng[MSFT], Jan 3, 2006
    #7
  8. chen

    cat Guest

    I'm more towards using a different approach: return an enum
    1. a switch statement to check the returned value, or a set of catch ( ...)
    blocks is pretty much the same; you have to define the returned/thrown items
    and handle them anyways
    2. re "client could completely ignore the status code": you could to that
    with an exception, but not trapping or using catch ( Exception ex )
    3. security issues: the information from an exception could expose to a
    hacker the structure of your application/webservice
    4. the client side proxy code could reflect changes in the values of the
    enum; if you change the exceptions thrown by the service, or add new ones,
    you gotta make sure you convey that to all your clients cuz no proxy code
    generator will do that for you
    5. marshalling an exception across application domains is very expensive,
    and will make your application less scalable (it's several orders of
    magnitude slower than a return value)


    "Steven Cheng[MSFT]" wrote:

    > Hi Chen,
    >
    > Does the things in my latest reply helps? If still anything else we can
    > help, please feel free to post here.
    >
    > Regards,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    > --------------------
    > | X-Tomcat-ID: 107681489
    > | References: <>
    > <>
    > | MIME-Version: 1.0
    > | Content-Type: text/plain
    > | Content-Transfer-Encoding: 7bit
    > | From: (Steven Cheng[MSFT])
    > | Organization: Microsoft
    > | Date: Thu, 29 Dec 2005 07:00:03 GMT
    > | Subject: Re: Architecture question: Exceptions vs status codes
    > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    > | Message-ID: <>
    > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    > | Lines: 89
    > | Path: TK2MSFTNGXA02.phx.gbl
    > | Xref: TK2MSFTNGXA02.phx.gbl
    > microsoft.public.dotnet.framework.aspnet.webservices:31231
    > | NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
    > |
    > | Thanks for your followup Chen,
    > |
    > | yes, for ASP.NET Webservice, it has limited exception framework, the
    > | serverside webservice can only propagate SoapException as the exception
    > | object to clientside.... And our serverside custom exception detailes
    > can
    > | be encapsulated in the SoapException's properties.... (xmlNode....). The
    > | msdn .NET exception management guide also mentioned this:
    > |
    > | #Exception Management Architecture Guide
    > |
    > http://msdn.microsoft.com/library/en-us/dnbda/html/exceptdotnet.asp?frame=tr
    > | ue
    > |
    > | And here is a certain tech article discussing on encapsulating custom
    > | exception info through SoapException and the xml data:
    > |
    > | #Exception Handling in Web Services
    > | http://www.developer.com/net/csharp/article.php/10918_3088231_1
    > |
    > | Hope helps. Thanks,
    > |
    > | Steven Cheng
    > | Microsoft Online Support
    > |
    > | Get Secure! www.microsoft.com/security
    > | (This posting is provided "AS IS", with no warranties, and confers no
    > | rights.)
    > |
    > |
    > |
    > | --------------------
    > | | From: "chen" <>
    > | | Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    > | | Subject: Re: Architecture question: Exceptions vs status codes
    > | | Date: 28 Dec 2005 10:21:00 -0800
    > | | Organization: http://groups.google.com
    > | | Lines: 19
    > | | Message-ID: <>
    > | | References: <>
    > | | <>
    > | | <>
    > | | <E077n#>
    > | | NNTP-Posting-Host: 141.162.101.50
    > | | Mime-Version: 1.0
    > | | Content-Type: text/plain; charset="iso-8859-1"
    > | | X-Trace: posting.google.com 1135794066 4792 127.0.0.1 (28 Dec 2005
    > | 18:21:06 GMT)
    > | | X-Complaints-To:
    > | | NNTP-Posting-Date: Wed, 28 Dec 2005 18:21:06 +0000 (UTC)
    > | | User-Agent: G2/0.2
    > | | X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
    > .NET
    > | CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe)
    > | | Complaints-To:
    > | | Injection-Info: f14g2000cwb.googlegroups.com;
    > posting-host=141.162.101.50;
    > | | posting-account=X7ANQg0AAAB-ENGC8U9YFBV5V2pedTsn
    > | | Path:
    > |
    > TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
    > |
    > ne.de!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.gigan
    > | ews.com!postnews.google.com!f14g2000cwb.googlegroups.com!not-for-mail
    > | | Xref: TK2MSFTNGXA02.phx.gbl
    > | microsoft.public.dotnet.framework.aspnet.webservices:31228
    > | | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    > | |
    > | | While we have decided to go with the exceptions route, the next
    > | | question that needs to be answered is how to tell the clients of the
    > | | web service how, lets say GetFoo(), will fail.
    > | |
    > | | Here's a WSDL snippet
    > | | <operation name="GetFoo">
    > | | <documentation xmlns="http://schemas.xmlsoap.org/wsdl/"/>
    > | | <input name="GetFooByLabel" message="tns:getFooByLabelIn"/>
    > | | <output name="GetFooByLabel" message="tns:getFooByLabelOut"/>
    > | | <fault name="NotFound" message="tns:NotFoundException"/>
    > | | </operation>
    > | |
    > | | Right now, it appears that the Soap faults are merely documenting the
    > | | fact that GetFoo() operation could result in NotFound fault code. All
    > | | the tools that i tried (WSDL, wseWSDL) ignore them & there doesn't
    > | | appear to be any easy way to turn them into custom exceptions on the
    > | | client side. So does it add any value in specifying them in the .wsdl
    > | | at all? What are some of the best practices in this area?
    > | |
    > | |
    > |
    > |
    >
    >
     
    cat, Jan 12, 2006
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Greg  --
    Replies:
    4
    Views:
    2,214
  2. Gianni Mariani

    Exceptions vs Status codes

    Gianni Mariani, May 17, 2004, in forum: C++
    Replies:
    9
    Views:
    2,285
    Gianni Mariani
    May 18, 2004
  3. Replies:
    2
    Views:
    2,897
    Malcolm
    Aug 20, 2005
  4. Replies:
    2
    Views:
    321
    David Harmon
    Jan 3, 2007
  5. Allen
    Replies:
    1
    Views:
    667
    Mark Rae [MVP]
    Dec 3, 2007
Loading...

Share This Page