473,398 Members | 2,389 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Returing Exception Message

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
Nov 23 '05 #1
10 1843
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" <Wh*********@discussions.microsoft.com> wrote in message
news:DD**********************************@microsof t.com...
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

Nov 23 '05 #2
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" <Wh*********@discussions.microsoft.com> wrote in message
news:DD**********************************@microsof t.com...
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


Nov 23 '05 #3
CG
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" <Wh*********@discussions.microsoft.com> wrote in message
news:DD**********************************@microsof t.com...
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


Nov 23 '05 #4
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" <Wh*********@discussions.microsoft.com> wrote in message
news:DD**********************************@microsof t.com...
>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

Nov 23 '05 #5
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"
<Wh*********@discussions.microsoft.com> 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" <Wh*********@discussions.microsoft.com> wrote in message
> > news:DD**********************************@microsof t.com...
> > >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
> >
> >
> >

Nov 23 '05 #6
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"
<Wh*********@discussions.microsoft.com> 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" <Wh*********@discussions.microsoft.com> wrote in message
> > news:DD**********************************@microsof t.com...
> > >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
> >
> >
> >

Nov 23 '05 #7
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"
<Wh*********@discussions.microsoft.com> 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"
<Wh*********@discussions.microsoft.com> 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" <Wh*********@discussions.microsoft.com> wrote in message
>> > > news:DD**********************************@microsof t.com...
>> > > >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
>> > >
>> > >
>> > >

Nov 23 '05 #8
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"
<Wh*********@discussions.microsoft.com> 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"
<Wh*********@discussions.microsoft.com> 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" <Wh*********@discussions.microsoft.com> wrote in message
>> > > news:DD**********************************@microsof t.com...
>> > > >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
>> > >
>> > >
>> > >

Nov 23 '05 #9
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"
<Wh*********@discussions.microsoft.com> 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"
<Wh*********@discussions.microsoft.com> 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"
>> <Wh*********@discussions.microsoft.com> 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" <Wh*********@discussions.microsoft.com> wrote in message
>> >> > > news:DD**********************************@microsof t.com...
>> >> > > >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
>> >> > >
>> >> > >
>> >> > >
>>

Nov 23 '05 #10
Hi,

my reply seems to have started a new thread .

I've posted an example code but it ended up in the thread:

"Re: Returing Exception Message - ExceptionService.zip (1/1)"

Marvin Smit.

On Mon, 14 Nov 2005 02:19:06 -0800, "WhiskyRomeo"
<Wh*********@discussions.microsoft.com> 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"
<Wh*********@discussions.microsoft.com> 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"
>> <Wh*********@discussions.microsoft.com> 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" <Wh*********@discussions.microsoft.com> wrote in message
>> >> > > news:DD**********************************@microsof t.com...
>> >> > > >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
>> >> > >
>> >> > >
>> >> > >
>>

Nov 23 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Andrew Chalk | last post by:
My app. sees an exception from the kernel at an obscure address, 0x7c59ba9d. When running under the VC++ 6.0 debugger, I can trap this each time it occurs. If I want to trap it in my program and...
2
by: Donald Adams | last post by:
I have a new problem with Exceptions: I need to manage the exception but I don't have an error code to compare with, just messages. I can check a message to see if it has "timeout" then instruct...
0
by: guy | last post by:
i have a method which throws an exception. the thing i dont understand is that the only change between the two versions is a line of code AFTER the one that throws the exception - see code below...
44
by: craig | last post by:
I am wondering if there are some best practices for determining a strategy for using try/catch blocks within an application. My current thoughts are: 1. The code the initiates any high-level...
6
by: Vadivel Kumar | last post by:
I've a problem in handling a custom exception The following is my custom exception class: public class AppException : public Exception { public AppException (string message, Exception...
11
by: Craig Francis | last post by:
Ok I'm making a fairly simple application. It contains 2 web browsers, the top one is used so that you can view a website (i.e. one you have created). Every time you load a page, the HTML which...
11
by: chopsnsauce | last post by:
Here's the example: Dim frm As New FORM1 Try frm.show Catch ex As Exception msgbox ex.message
9
by: MR | last post by:
I get the following Exception "The data at the root level is invalid. Line 1, position 642" whenever I try to deserialize an incoming SOAP message. The incoming message is formed well and its...
3
by: Dan | last post by:
Hi all! When I throw my custom Exception class the first time in my code, the compiler takes a lot of time for find the following catch EX: try Throw New MyCustomException("test")
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.