Can Application_BeginRequest return a DataSet and stop normal webmethod flow?

Discussion in 'ASP .Net Web Services' started by Guest, May 25, 2005.

  1. Guest

    Guest Guest

    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
     
    Guest, May 25, 2005
    #1
    1. Advertising

  2. Guest

    Brock Allen Guest

    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
     
    Brock Allen, May 25, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Franck
    Replies:
    1
    Views:
    497
    Karl Seguin
    Oct 4, 2005
  2. Michele Simionato
    Replies:
    7
    Views:
    367
    Alex Martelli
    Sep 29, 2004
  3. Jack Dowson
    Replies:
    0
    Views:
    479
    Jack Dowson
    May 7, 2007
  4. Tim Medcalf
    Replies:
    1
    Views:
    132
  5. Franck
    Replies:
    0
    Views:
    170
    Franck
    Sep 30, 2005
Loading...

Share This Page