Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Services (http://www.velocityreviews.com/forums/f64-asp-net-web-services.html)
-   -   Architecture question: Exceptions vs status codes (http://www.velocityreviews.com/forums/t785667-architecture-question-exceptions-vs-status-codes.html)

chen 12-20-2005 07:27 PM

Architecture question: Exceptions vs status codes
 
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


WebMatrix 12-20-2005 08:32 PM

RE: Architecture question: Exceptions vs status codes
 
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] 12-21-2005 06:05 AM

RE: Architecture question: Exceptions vs status codes
 
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?= <WebMatrix@discussions.microsoft.com>
| References: <1135106866.671728.7250@g14g2000cwa.googlegroups.c om>
| Subject: RE: Architecture question: Exceptions vs status codes
| Date: Tue, 20 Dec 2005 12:32:01 -0800
| Lines: 27
| Message-ID: <CD23D1EA-B748-4BBB-BDE7-8E9F7B1B1CF8@microsoft.com>
| 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.webservic es
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservic es:31185
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
|
| 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] 12-28-2005 09:18 AM

RE: Architecture question: Exceptions vs status codes
 
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: <1135106866.671728.7250@g14g2000cwa.googlegroups.c om>
<CD23D1EA-B748-4BBB-BDE7-8E9F7B1B1CF8@microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: stcheng@online.microsoft.com (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.webservic es
| Message-ID: <AbEFNSfBGHA.832@TK2MSFTNGXA02.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
| Lines: 81
| Path: TK2MSFTNGXA02.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservic es: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?= <WebMatrix@discussions.microsoft.com>
| | References: <1135106866.671728.7250@g14g2000cwa.googlegroups.c om>
| | Subject: RE: Architecture question: Exceptions vs status codes
| | Date: Tue, 20 Dec 2005 12:32:01 -0800
| | Lines: 27
| | Message-ID: <CD23D1EA-B748-4BBB-BDE7-8E9F7B1B1CF8@microsoft.com>
| | 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.webservic es
| | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
| | Xref: TK2MSFTNGXA02.phx.gbl
| microsoft.public.dotnet.framework.aspnet.webservic es:31185
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
| |
| | 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.
| |
| |
|
|


chen 12-28-2005 06:21 PM

Re: Architecture question: Exceptions vs status codes
 
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] 12-29-2005 07:00 AM

Re: Architecture question: Exceptions vs status codes
 
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...t.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/...0918_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" <venkatar@sig.com>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
| 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: <1135794060.895244.127730@f14g2000cwb.googlegroups .com>
| References: <1135106866.671728.7250@g14g2000cwa.googlegroups.c om>
| <CD23D1EA-B748-4BBB-BDE7-8E9F7B1B1CF8@microsoft.com>
| <AbEFNSfBGHA.832@TK2MSFTNGXA02.phx.gbl>
| <E077n#4CGHA.3764@TK2MSFTNGXA02.phx.gbl>
| 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: groups-abuse@google.com
| 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: groups-abuse@google.com
| Injection-Info: f14g2000cwb.googlegroups.com; posting-host=141.162.101.50;
| posting-account=X7ANQg0AAAB-ENGC8U9YFBV5V2pedTsn
| Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfee d00.sul.t-online.de!t-onli
ne.de!border2.nntp.dca.giganews.com!border1.nntp.d ca.giganews.com!nntp.gigan
ews.com!postnews.google.com!f14g2000cwb.googlegrou ps.com!not-for-mail
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservic es:31228
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
|
| 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] 01-03-2006 11:36 AM

Re: Architecture question: Exceptions vs status codes
 
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: <1135106866.671728.7250@g14g2000cwa.googlegroups.c om>
<1135794060.895244.127730@f14g2000cwb.googlegroups .com>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: stcheng@online.microsoft.com (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.webservic es
| Message-ID: <KlwyEWEDGHA.4092@TK2MSFTNGXA02.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
| Lines: 89
| Path: TK2MSFTNGXA02.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservic es: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...t.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/...0918_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" <venkatar@sig.com>
| | Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
| | 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: <1135794060.895244.127730@f14g2000cwb.googlegroups .com>
| | References: <1135106866.671728.7250@g14g2000cwa.googlegroups.c om>
| | <CD23D1EA-B748-4BBB-BDE7-8E9F7B1B1CF8@microsoft.com>
| | <AbEFNSfBGHA.832@TK2MSFTNGXA02.phx.gbl>
| | <E077n#4CGHA.3764@TK2MSFTNGXA02.phx.gbl>
| | 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: groups-abuse@google.com
| | 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: groups-abuse@google.com
| | Injection-Info: f14g2000cwb.googlegroups.com;
posting-host=141.162.101.50;
| | posting-account=X7ANQg0AAAB-ENGC8U9YFBV5V2pedTsn
| | Path:
|
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfee d00.sul.t-online.de!t-onli
|
ne.de!border2.nntp.dca.giganews.com!border1.nntp.d ca.giganews.com!nntp.gigan
| ews.com!postnews.google.com!f14g2000cwb.googlegrou ps.com!not-for-mail
| | Xref: TK2MSFTNGXA02.phx.gbl
| microsoft.public.dotnet.framework.aspnet.webservic es:31228
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
| |
| | 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 01-12-2006 12:16 AM

Re: Architecture question: Exceptions vs status codes
 
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: <1135106866.671728.7250@g14g2000cwa.googlegroups.c om>
> <1135794060.895244.127730@f14g2000cwb.googlegroups .com>
> | MIME-Version: 1.0
> | Content-Type: text/plain
> | Content-Transfer-Encoding: 7bit
> | From: stcheng@online.microsoft.com (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.webservic es
> | Message-ID: <KlwyEWEDGHA.4092@TK2MSFTNGXA02.phx.gbl>
> | Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
> | Lines: 89
> | Path: TK2MSFTNGXA02.phx.gbl
> | Xref: TK2MSFTNGXA02.phx.gbl
> microsoft.public.dotnet.framework.aspnet.webservic es: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...t.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/...0918_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" <venkatar@sig.com>
> | | Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
> | | 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: <1135794060.895244.127730@f14g2000cwb.googlegroups .com>
> | | References: <1135106866.671728.7250@g14g2000cwa.googlegroups.c om>
> | | <CD23D1EA-B748-4BBB-BDE7-8E9F7B1B1CF8@microsoft.com>
> | | <AbEFNSfBGHA.832@TK2MSFTNGXA02.phx.gbl>
> | | <E077n#4CGHA.3764@TK2MSFTNGXA02.phx.gbl>
> | | 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: groups-abuse@google.com
> | | 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: groups-abuse@google.com
> | | Injection-Info: f14g2000cwb.googlegroups.com;
> posting-host=141.162.101.50;
> | | posting-account=X7ANQg0AAAB-ENGC8U9YFBV5V2pedTsn
> | | Path:
> |
> TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfee d00.sul.t-online.de!t-onli
> |
> ne.de!border2.nntp.dca.giganews.com!border1.nntp.d ca.giganews.com!nntp.gigan
> | ews.com!postnews.google.com!f14g2000cwb.googlegrou ps.com!not-for-mail
> | | Xref: TK2MSFTNGXA02.phx.gbl
> | microsoft.public.dotnet.framework.aspnet.webservic es:31228
> | | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
> | |
> | | 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?
> | |
> | |
> |
> |
>
>



All times are GMT. The time now is 09:43 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.