webservices

Discussion in 'ASP .Net' started by =?Utf-8?B?TWFubnkgQ2hvaGFu?=, Aug 7, 2005.

  1. hi guys,

    I have defined OnUnload event in body of a page to call Javascript.

    <script language="javascript" type="text/javascript">

    function myFunction()
    {
    var sessionID = document.Form1.tBoxSessionID.valu
    mainSVC.useService("http://localhost/extranet/webservices/mainWebSVC.asmx?WSDL","dNtSvc");
    var iCallID;
    if (mainSVC.dNtSvc)
    {
    mainSVC.dNtSvc.callService("setLogOff", document.Form1.tBoxSessionID.value);
    }
    }
    </script>

    This webscript infacts updates database record with sessionid passed as
    argument from javascript.
    Now i know that the code is correct cuz if i put alert("Test") statement
    before i call webservice, the record is updated but it dont if the
    alert("Test") statement is not there.

    Can someone tell me why this is the case? Does webservice stop executing if
    the page is unloaded completely?

    Thanks in advance.

    Manny
     
    =?Utf-8?B?TWFubnkgQ2hvaGFu?=, Aug 7, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?TWFubnkgQ2hvaGFu?=

    Lucas Tam Guest

    =?Utf-8?B?TWFubnkgQ2hvaGFu?= <>
    wrote in news::

    >
    > Can someone tell me why this is the case? Does webservice stop
    > executing if the page is unloaded completely?


    You can't really depend on the unload to fire reliably : (
    --
    Lucas Tam ()
    Please delete "REMOVE" from the e-mail address when replying.
    http://members.ebay.com/aboutme/coolspot18/
     
    Lucas Tam, Aug 7, 2005
    #2
    1. Advertising

  3. =?Utf-8?B?TWFubnkgQ2hvaGFu?=

    Stefan Guest

    I am not sure, but I would think that mainSVC is destroyed before it
    can establish the call to the web service.

    Call service is an asynchronous call, meaning that it doesn't block or
    wait. Which means that it could perfectly be that mainSVC as its "host"
    could be destroyed before it established a connection to the ws (in
    useService).

    Since in the case when you put an alert before callService, useService
    successfully established a connection, the callService can be invoked,
    because mainSVC still exists. Of course, this is all pure speculation
    and not based on any insight on how IE has implemented Unload.

    Have you tried a JS-sleep before callService (basically to imitate an
    alert)? Although an hack, this should work ...
     
    Stefan, Aug 7, 2005
    #3
    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. jib

    Webservices and OLE object

    jib, Jul 8, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    394
  2. Colt [MVP]
    Replies:
    1
    Views:
    395
    Nathan Baulch
    Jul 11, 2003
  3. David Waz...

    Re: Events in HTML throught webservices...

    David Waz..., Jul 11, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    382
    David Waz...
    Jul 11, 2003
  4. khawar
    Replies:
    0
    Views:
    447
    khawar
    Jul 15, 2003
  5. majiofpersia

    webservices filestream

    majiofpersia, Jul 16, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    328
    majiofpersia
    Jul 16, 2003
Loading...

Share This Page