Re: Returing Exception Message - ExceptionService.zip (0/1)
- From: Marvin Smit <marvin.smit@xxxxxxxxx>
- Date: Mon, 14 Nov 2005 12:29:25 +0100
Hi,
attached is a zip with 2 source codes.
- ExceptionWebService
Implements a simple webservice with 2 methods; Divide &
DivideWithDetails.
The first 'just tries to execute the divide of the operants comming
in' and the latter checks for a division by 0, if found it produces a
custom message for the SOAP exception thrown.
- ExcpetionServicecClient
Implements a simple WinForm that calls either of the two methods and
shows the results of the call.
Hope this helps,
Marvin Smit.
On Mon, 14 Nov 2005 02:19:06 -0800, "WhiskyRomeo"
<WhiskyRomeo@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>can you provide a short example of this or a link to a document?
>
>"Marvin Smit" wrote:
>
>> Hi,
>>
>> yes.. that is correct. That will give you the general soap fault. You
>> can however make it more explicit by throwing a "SoapException"
>> yourself and fill in more details.
>>
>> Hope this helps,
>>
>> Marvin Smit.
>>
>> On Mon, 14 Nov 2005 01:51:09 -0800, "WhiskyRomeo"
>> <WhiskyRomeo@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>>
>> >I am using Visual Studio and I implemented my webservice through Visual Studio.
>> >
>> >Are you saying rathing than catching the exception in the webservice, simply
>> >throw the exception and catch it in the windows client?
>> >
>> >Bill
>> >
>> >"Marvin Smit" wrote:
>> >
>> >> Hi,
>> >>
>> >> If you are using MS Visual Studio and implement your WebService, you
>> >> can just "throw exceptions". The WebService framework will translate
>> >> these into SOAP faults and transmit them over the wire. The client
>> >> will recognize this SOAP fault, and throw the exception on the client
>> >> side.
>> >>
>> >> Hope this helps,
>> >>
>> >> Marvin Smit.
>> >>
>> >> On Fri, 11 Nov 2005 07:37:02 -0800, "WhiskyRomeo"
>> >> <WhiskyRomeo@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>> >>
>> >> >Again, how? I do not understand how you return any type of error message
>> >> >from the web service to the windows client.
>> >> >
>> >> >WR
>> >> >
>> >> >"CG" wrote:
>> >> >
>> >> >> Main reason of using Webserice is simplicity, reusability etc.
>> >> >>
>> >> >> My recommendation would be to send a generic error message for any type of
>> >> >> error you get at server (Web Service) side. So, that impementation is easy
>> >> >> for clients.
>> >> >>
>> >> >> "WhiskyRomeo" wrote:
>> >> >>
>> >> >> > I have no idea what that means. I simply want the exeception to be handled in
>> >> >> > client. All I need is for the exception handling routine to behave like it
>> >> >> > would if one sub called another sub on the client. There you can handle the
>> >> >> > exception in the called sub or calling sub. Why doesn't this work the same
>> >> >> > way?
>> >> >> >
>> >> >> > WR
>> >> >> >
>> >> >> > "Manoj G [MVP]" wrote:
>> >> >> >
>> >> >> > > You may want to return a SOAP fault message, by means of throwing an
>> >> >> > > SoapException from your web service. You can catch the SoapException on the
>> >> >> > > proxy side & check the properties to see the reason for the failure.
>> >> >> > >
>> >> >> > > --
>> >> >> > > HTH,
>> >> >> > > Manoj G
>> >> >> > > MVP, Visual Developer
>> >> >> > > http://msmvps.com/manoj
>> >> >> > >
>> >> >> > > "WhiskyRomeo" <WhiskyRomeo@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> >> >> > > news:DD3FD9FE-19B7-4131-A406-911536EDF8D0@xxxxxxxxxxxxxxxx
>> >> >> > > >I have webservices functions that return datasets. If a database errors
>> >> >> > > > happens, try catch statements can be used in the webservice to detect and
>> >> >> > > > handle them.
>> >> >> > > >
>> >> >> > > > However, how do I return that message to the client windows application
>> >> >> > > > that
>> >> >> > > > called that webservice function? I am using version 1.1 of the framework.
>> >> >> > > >
>> >> >> > > > WR
>> >> >> > >
>> >> >> > >
>> >> >> > >
>> >>
>>
.
- References:
- Re: Returing Exception Message
- From: Marvin Smit
- Re: Returing Exception Message
- From: WhiskyRomeo
- Re: Returing Exception Message
- Prev by Date: Re: Generate class from schema (VS.NET 2005)
- Next by Date: Null Array
- Previous by thread: Re: Returing Exception Message
- Next by thread: Re: Webservices ( Amazon and Ebay)
- Index(es):
Relevant Pages
|