Notify a Service Process

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter

    Notify a Service Process

    I have a webpage which creates reports, a report can take few seconds or
    several minutes to create.
    This webpage calls a web service which in turn does a remoting call to a
    windows service and the service creates the report.

    My question is if a user cancels or closes the browser before the report is
    completed, but windows service is still in the process of creating a report
    how do I notify the service to quit creating a report because there isn't
    anyone to receive it?



    Thank You



    Peter


  • Eliyahu Goldin

    #2
    Re: Notify a Service Process

    If you provide a Cancel button and trust the user to cancel only via this
    button, only than you will know about the cancellation. How to notify the
    windows service is up to the service. It may or may no provide an interface
    for that.

    But practically there is a little use in that since there is no reliable way
    to know if the user navigated away from your site. Thre are simply too many
    exit options.

    --
    Eliyahu Goldin,
    Software Developer
    Microsoft MVP [ASP.NET]




    "Peter" <czupet@nospam. nospamwrote in message
    news:OHNYbDarIH A.5724@TK2MSFTN GP06.phx.gbl...
    >I have a webpage which creates reports, a report can take few seconds or
    >several minutes to create.
    This webpage calls a web service which in turn does a remoting call to a
    windows service and the service creates the report.
    >
    My question is if a user cancels or closes the browser before the report
    is completed, but windows service is still in the process of creating a
    report how do I notify the service to quit creating a report because there
    isn't anyone to receive it?
    >
    >
    >
    Thank You
    >
    >
    >
    Peter
    >

    Comment

    • Mark Rae [MVP]

      #3
      Re: Notify a Service Process

      "Peter" <czupet@nospam. nospamwrote in message
      news:OHNYbDarIH A.5724@TK2MSFTN GP06.phx.gbl...
      My question is if a user cancels or closes the browser before the report
      is completed, but windows service is still in the process of creating a
      report how do I notify the service to quit creating a report because there
      isn't anyone to receive it?
      The HttpResponse object has an IsClientConnect ed property which is
      "supposed" to do exactly that:


      However, I've never been able to get it to work...


      --
      Mark Rae
      ASP.NET MVP


      Comment

      • Steven Cheng [MSFT]

        #4
        RE: Notify a Service Process

        Hi Peter,

        Regarding on the scenario you mentioned, when the web application consumer
        close the webbrowser, the ASP.NET server-side will not get any rapid
        notification of it. It does be a very common and typical limitation of
        http/web based application which is stateless with server.

        If the reporting generation task is long-run and you feel it critical and
        important to pause/cancel report generation whenever the client user close
        the webbrowser(befo re the report generation finishes), I think you can can
        consider the following approach:

        ** At your ASP.NET web application's page (which will let user send request
        for generating report), you need to add some additional code logic to to
        contantly ping the webservice or windows service to as to let the backend
        processing service know that the request client is still alive.

        ** you also need to apply a timeout policy at the report processing side.
        e.g. if the genreation hasn't finsihed, but it hasn't received notify from
        client side(to a certain sessionID) for a long time(exceed timeout), it
        will cancel the generation.

        for implementation, at web page side, you can consider using AJAX script
        call to send notify to server-side constantly.

        Sincerely,

        Steven Cheng

        Microsoft MSDN Online Support Lead


        Delighting our customers is our #1 priority. We welcome your comments and
        suggestions about how we can improve the support we provide to you. Please
        feel free to let my manager know what you think of the level of service
        provided. You can send feedback directly to my manager at:
        msdnmg@microsof t.com.

        =============== =============== =============== =====
        Get notification to my posts through email? Please refer to
        Gain technical skills through documentation and training, earn certifications and connect with the community

        ications.

        =============== =============== =============== =====
        This posting is provided "AS IS" with no warranties, and confers no rights.



        --------------------
        >From: "Peter" <czupet@nospam. nospam>
        >Subject: Notify a Service Process
        >Date: Sat, 3 May 2008 23:39:34 -0500
        >I have a webpage which creates reports, a report can take few seconds or
        >several minutes to create.
        >This webpage calls a web service which in turn does a remoting call to a
        >windows service and the service creates the report.
        >
        >My question is if a user cancels or closes the browser before the report
        is
        >completed, but windows service is still in the process of creating a
        report
        >how do I notify the service to quit creating a report because there isn't
        >anyone to receive it?
        >
        >
        >
        >Thank You
        >
        >
        >
        >Peter
        >
        >
        >

        Comment

        • Peter

          #5
          Re: Notify a Service Process


          "Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
          news:oFyvccnrIH A.772@TK2MSFTNG HUB02.phx.gbl.. .
          Hi Peter,
          >
          Regarding on the scenario you mentioned, when the web application consumer
          close the webbrowser, the ASP.NET server-side will not get any rapid
          notification of it. It does be a very common and typical limitation of
          http/web based application which is stateless with server.
          >
          If the reporting generation task is long-run and you feel it critical and
          important to pause/cancel report generation whenever the client user close
          the webbrowser(befo re the report generation finishes), I think you can can
          consider the following approach:
          >
          ** At your ASP.NET web application's page (which will let user send
          request
          for generating report), you need to add some additional code logic to to
          contantly ping the webservice or windows service to as to let the backend
          processing service know that the request client is still alive.
          >
          ** you also need to apply a timeout policy at the report processing side.
          e.g. if the genreation hasn't finsihed, but it hasn't received notify from
          client side(to a certain sessionID) for a long time(exceed timeout), it
          will cancel the generation.
          >
          for implementation, at web page side, you can consider using AJAX script
          call to send notify to server-side constantly.
          >
          Sincerely,
          >
          Steven Cheng
          >
          Microsoft MSDN Online Support Lead
          >
          >
          Delighting our customers is our #1 priority. We welcome your comments and
          suggestions about how we can improve the support we provide to you. Please
          feel free to let my manager know what you think of the level of service
          provided. You can send feedback directly to my manager at:
          msdnmg@microsof t.com.
          >
          =============== =============== =============== =====
          Get notification to my posts through email? Please refer to
          Gain technical skills through documentation and training, earn certifications and connect with the community

          ications.
          >
          =============== =============== =============== =====
          This posting is provided "AS IS" with no warranties, and confers no
          rights.
          >
          >
          >
          --------------------
          >>From: "Peter" <czupet@nospam. nospam>
          >>Subject: Notify a Service Process
          >>Date: Sat, 3 May 2008 23:39:34 -0500
          >
          >>I have a webpage which creates reports, a report can take few seconds or
          >>several minutes to create.
          >>This webpage calls a web service which in turn does a remoting call to a
          >>windows service and the service creates the report.
          >>
          >>My question is if a user cancels or closes the browser before the report
          is
          >>completed, but windows service is still in the process of creating a
          report
          >>how do I notify the service to quit creating a report because there isn't
          >>anyone to receive it?
          >>
          >>
          >>
          >>Thank You
          >>
          >>
          >>
          >>Peter
          >>
          >>
          >>
          >
          Thank you

          Sounds good ! - Well -- kind of, because this means a lot of work to get
          this working correctly :)


          Comment

          • Steven Cheng [MSFT]

            #6
            Re: Notify a Service Process

            Thanks for your reply Peter.

            Yes, I agree that the real implementation will require lots of work.
            Actually, it is always not simple task to build a rich component that helps
            improve interaction between webpage client and server-side. Anyway, if
            there is anything else need help later, welcome to post here.

            Sincerely,

            Steven Cheng

            Microsoft MSDN Online Support Lead


            Delighting our customers is our #1 priority. We welcome your comments and
            suggestions about how we can improve the support we provide to you. Please
            feel free to let my manager know what you think of the level of service
            provided. You can send feedback directly to my manager at:
            msdnmg@microsof t.com.

            =============== =============== =============== =====
            Get notification to my posts through email? Please refer to
            Gain technical skills through documentation and training, earn certifications and connect with the community

            ications.

            =============== =============== =============== =====
            This posting is provided "AS IS" with no warranties, and confers no rights.

            --------------------
            >From: "Peter" <czupet@nospam. nospam>
            >References: <OHNYbDarIHA.57 24@TK2MSFTNGP06 .phx.gbl>
            <oFyvccnrIHA.77 2@TK2MSFTNGHUB0 2.phx.gbl>
            >Subject: Re: Notify a Service Process
            >Date: Mon, 5 May 2008 08:43:53 -0500
            >
            >"Steven Cheng [MSFT]" <stcheng@online .microsoft.comw rote in message
            >news:oFyvccnrI HA.772@TK2MSFTN GHUB02.phx.gbl. ..
            >Hi Peter,
            >>
            >Regarding on the scenario you mentioned, when the web application
            consumer
            >close the webbrowser, the ASP.NET server-side will not get any rapid
            >notification of it. It does be a very common and typical limitation of
            >http/web based application which is stateless with server.
            >>
            >If the reporting generation task is long-run and you feel it critical and
            >important to pause/cancel report generation whenever the client user
            close
            >the webbrowser(befo re the report generation finishes), I think you can
            can
            >consider the following approach:
            >>
            >** At your ASP.NET web application's page (which will let user send
            >request
            >for generating report), you need to add some additional code logic to to
            >contantly ping the webservice or windows service to as to let the backend
            >processing service know that the request client is still alive.
            >>
            >** you also need to apply a timeout policy at the report processing side.
            >e.g. if the genreation hasn't finsihed, but it hasn't received notify
            from
            >client side(to a certain sessionID) for a long time(exceed timeout), it
            >will cancel the generation.
            >>
            >for implementation, at web page side, you can consider using AJAX script
            >call to send notify to server-side constantly.
            >>
            >Sincerely,
            >>
            >Steven Cheng
            >>
            >Microsoft MSDN Online Support Lead
            >>
            >>
            >Delighting our customers is our #1 priority. We welcome your comments and
            >suggestions about how we can improve the support we provide to you.
            Please
            >feel free to let my manager know what you think of the level of service
            >provided. You can send feedback directly to my manager at:
            >msdnmg@microsof t.com.
            >>
            >============== =============== =============== ======
            >Get notification to my posts through email? Please refer to
            >>
            http://msdn.microsoft.com/subscripti...ult.aspx#notif
            >ications.
            >>
            >============== =============== =============== ======
            >This posting is provided "AS IS" with no warranties, and confers no
            >rights.
            >>
            >>
            >>
            >--------------------
            >>>From: "Peter" <czupet@nospam. nospam>
            >>>Subject: Notify a Service Process
            >>>Date: Sat, 3 May 2008 23:39:34 -0500
            >>
            >>>I have a webpage which creates reports, a report can take few seconds or
            >>>several minutes to create.
            >>>This webpage calls a web service which in turn does a remoting call to a
            >>>windows service and the service creates the report.
            >>>
            >>>My question is if a user cancels or closes the browser before the report
            >is
            >>>completed, but windows service is still in the process of creating a
            >report
            >>>how do I notify the service to quit creating a report because there isn't
            >>>anyone to receive it?
            >>>
            >>>
            >>>
            >>>Thank You
            >>>
            >>>
            >>>
            >>>Peter
            >>>
            >>>
            >>>
            >>
            >
            >Thank you
            >
            >Sounds good ! - Well -- kind of, because this means a lot of work to get
            >this working correctly :)
            >
            >
            >

            Comment

            Working...