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. Advertisements

  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. Advertisements

  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. Advertisements

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:
    503
  2. Colt [MVP]
    Replies:
    1
    Views:
    479
    Nathan Baulch
    Jul 11, 2003
  3. khawar
    Replies:
    0
    Views:
    531
    khawar
    Jul 15, 2003
  4. majiofpersia

    webservices filestream

    majiofpersia, Jul 16, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    417
    majiofpersia
    Jul 16, 2003
  5. Ulysses Colambot

    help in asp.net vs webservices created in gsoap

    Ulysses Colambot, Jul 24, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    597
    Ulysses Colambot
    Jul 24, 2003
  6. Joe Curry

    Debugging Webservices

    Joe Curry, Aug 21, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    393
    Natty Gur
    Aug 21, 2003
  7. Joseph Geretz
    Replies:
    6
    Views:
    481
    Joseph Geretz
    Aug 24, 2003
  8. Carl

    Webservices or C# errors

    Carl, Aug 29, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    407
Loading...