Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Can Application_BeginRequest return a DataSet and stop normal webmethod flow?

Reply
Thread Tools

Can Application_BeginRequest return a DataSet and stop normal webmethod flow?

 
 
Guest
Posts: n/a
 
      05-25-2005
Hi,

I am implementing a couple of webservices (all in the same web project) that will access several backoffice systems to get and update different types of information. All the methods in the several webservices return a DataSet with the information requested.

All the methods of the Webservices also go through an initial phase of checking either the Backoffice systems are online or not. If not, they all return the SAME error DataSet.

To save lines of code (and the redundance of having the same code repeated all over, with all the possible errors that can arise from that), I am trying to do that check in the Application_BeginRequest event, but without success...

So, my question is: Is it possible to use the Application_BeginRequest event to catch the calls to all the methods of all the webservices, and return a standard answer to the clients in case of error and not continue the normal flow of the method called? If so, how can I achieve that? If not, is there any other way?

I am at a loss...

Thank you in advance,
Ana Santana

-----------------------------
This message is posted by http://asp.forumszone.com

 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      05-25-2005
Sure it can. To raise an error back to the client, check out SoapException
-- this is the exception to raise to have the web services framework hand
back a SoapFault to the client.

-Brock
DevelopMentor
http://staff.develop.com/ballen



> Hi,
>
> I am implementing a couple of webservices (all in the same web
> project) that will access several backoffice systems to get and update
> different types of information. All the methods in the several
> webservices return a DataSet with the information requested.
>
> All the methods of the Webservices also go through an initial phase of
> checking either the Backoffice systems are online or not. If not, they
> all return the SAME error DataSet.
>
> To save lines of code (and the redundance of having the same code
> repeated all over, with all the possible errors that can arise from
> that), I am trying to do that check in the Application_BeginRequest
> event, but without success...
>
> So, my question is: Is it possible to use the Application_BeginRequest
> event to catch the calls to all the methods of all the webservices,
> and return a standard answer to the clients in case of error and not
> continue the normal flow of the method called? If so, how can I
> achieve that? If not, is there any other way?
>
> I am at a loss...
>
> Thank you in advance,
> Ana Santana
> -----------------------------
> This message is posted by http://asp.forumszone.com




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Catch WebMethod name and params in Application_BeginRequest Franck ASP .Net 1 10-04-2005 11:26 AM
Catch WebMethod name and params in Application_BeginRequest Franck ASP .Net Web Services 0 09-30-2005 06:47 AM
WebMethod and DataSet parameter - Help me. Mauricio Pires ASP .Net Web Services 0 08-19-2005 12:49 PM
Is it possible to return just a DataTable from a WebMethod, instead of DataSet? Tim Medcalf ASP .Net Web Services 1 11-05-2003 04:56 AM
Can't return class instance from WebMethod Ryan Bingham ASP .Net Web Services 0 08-11-2003 09:56 PM



Advertisments