Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > webservices

Reply
Thread Tools

webservices

 
 
=?Utf-8?B?TWFubnkgQ2hvaGFu?=
Guest
Posts: n/a
 
      08-07-2005
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
 
Reply With Quote
 
 
 
 
Lucas Tam
Guest
Posts: n/a
 
      08-07-2005
=?Utf-8?B?TWFubnkgQ2hvaGFu?= <(E-Mail Removed)>
wrote in news:(E-Mail Removed):

>
> 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 ((E-Mail Removed))
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
 
Reply With Quote
 
 
 
 
Stefan
Guest
Posts: n/a
 
      08-07-2005
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 ...

 
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
PIX 515 Can Ping Out-to-In but not any webservices getting out-to-in Johnny Davis Cisco 6 01-19-2004 05:33 PM
asp.net C# working with webservices khawar ASP .Net 0 07-15-2003 02:16 PM
Re: Events in HTML throught webservices... David Waz... ASP .Net 0 07-11-2003 06:37 PM
Re: Events in HTML throught webservices... Colt [MVP] ASP .Net 1 07-11-2003 05:30 AM
Webservices and OLE object jib ASP .Net 0 07-08-2003 03:10 PM



Advertisments