Why can't .NET generate stubs to correspond to the exceptions that are thrown
by a webservice?
The exceptions that are thrown by an API are just as importantant as the
return objects, etc. Apache Axis automatically generates client stubs for
exceptions that are thrown by a server - and they these exceptions are
automatically thrown whenever it occurs on the server, just like it should.
In .NET world - the best it seems to be able to do is throw a generic
SOAPException whenever any exception happens on the server.
If I want to do a lot of work, it appears that I may be able to dig through
the SOAP exception to get down the the underlying WSDL fault, to figure out
what exception should have been thrown. But I shouldn't have to do this -
all of the necessary information is there for this to be generated
automatically.
Are there any workarounds for this? Will it be fixed in a future version of
.NET?
erymuzuan - 09 Feb 2005 10:03 GMT
Exception is a .Net type, most of the time cannot be properly serialized
to Xml.. use SoapException class for your exception may be provide the
details of the .Net exception as well in the details
BTW, you can utilise WSDL's fault element defining the type of excpetion
and information it carries
regards
erymuzuan mustapa
> Why can't .NET generate stubs to correspond to the exceptions that are thrown
> by a webservice?
[quoted text clipped - 15 lines]
> Are there any workarounds for this? Will it be fixed in a future version of
> .NET?