473,471 Members | 4,629 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

SOAP call in Netscape

Hi all -

I have a .NET web service running on a remote machine, and I have
Netscape Navigator 7.0 accessing it through javascript on the client
side through SOAP javascript coding. Everything works ok when I run
it, meaning the function gets successfully called and everything is
fine. I have a window.setInterval on my client side javascript, and it
calls the web service function every x milliseconds. However, as soon
as I try to close the window, it crashes the entire Netscape program.
Can anyone help me?

thanks.

Jul 23 '05 #1
13 1531


M B HONG 20 wrote:

I have a window.setInterval on my client side javascript, and it
calls the web service function every x milliseconds. However, as soon
as I try to close the window, it crashes the entire Netscape program.


Can you store the result of window.setInterval e.g.
var intervalId = window.setInterval(...)
and try to call clearInterval e.g.
<input type="button" value="close"
onclick="window.clearInterval(intervalId);
window.close();">
before the window is closed? That way it is at least possible to tell
whether a pending timer is causing the crash.

And of course your original attempts to call the web service that you
posted earlier were all synchronous calls which block the browser so you
should change that to do asynchronous calls, that might improve things.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
Martin - Thanks again for your reply.

Since my application is very time sensitive, I'm afraid that I must
stick with a synchronous approach. I implemented the
window.clearInterval for the timer, and it works. However, is this the
only way to get around this crash? Because if someone clicks on the
"close" button i have created it wont crash, but if he decides to just
close it with Alt + F4 or clicking on the "x", it will crash the entire
Netscape process. I've read around and come to the conclusion that
Netscape does not have an OnClose event or something similar in its
API. any ideas? thanks.

Charles.

Jul 23 '05 #3


M B HONG 20 wrote:

I implemented the
window.clearInterval for the timer, and it works. However, is this the
only way to get around this crash? Because if someone clicks on the
"close" button i have created it wont crash, but if he decides to just
close it with Alt + F4 or clicking on the "x", it will crash the entire
Netscape process.


Try whether
window.onunload = function (evt) {
clearInterval(intervalId);
};
works and avoids the crash.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #4
Martin -

window.onunload = function () only appears to work when the window is
reloaded/refreshed. Nothing fired when I tried to close it manually.

Jul 23 '05 #5


M B HONG 20 wrote:

window.onunload = function () only appears to work when the window is
reloaded/refreshed. Nothing fired when I tried to close it manually.


It should fire when a window is closed as the document in the window is
unloaded first.

Do you still crash when

window.onunload = function (evt) {
clearInterval(intervalId);
}

is present?

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #6
Martin -

Actually sorry, let me clarify what my application is doing first. The
reason why I must use web services is because on the server,
information is dynamically changing. What I am doing is checking to
see if the window needs to refresh. For some reason, when i call
clearInterval on the onunload event, the page does not refresh. For
testing, I put a simple alert on the onunload event like this:

function Close()
{
alert("close");
window.clearInterval(intervalId);
}

window.onunload = Close();

When i click something on the form, I guess Netscape automatically
unloads/loads the page, and the alerts come up. However, when I
manually close the window, nothing happens. But you are right, if I
have just the clearInterval on the onunload event, Netscape does not
crash. But, my application no longer works. Any advice for my
particular problem? Again, your help is greatly appreciated.

Charles.

Jul 23 '05 #7
VK
> window.onunload = Close();

Try instead:

window.onbeforeunload = myFunction;

(note that there are not parenthesis after the function name in this
case)

Jul 23 '05 #8


M B HONG 20 wrote:

For
testing, I put a simple alert on the onunload event like this:

function Close()
{
alert("close");
window.clearInterval(intervalId);
}

window.onunload = Close();
It would need to be
window.onunload = Close;
to make any sense as you need to assign a function itself to the
window.onunload property and not call the function.
As for the alert it is known that alert/prompt/confirm dialogs in
onunload are swallowed if the window is closed so it does not help to
tell you whether onunload is called when the window is closed.

But you are right, if I
have just the clearInterval on the onunload event, Netscape does not
crash. But, my application no longer works.


What exactly does no longer work? Do you get any script error in the
JavaScript console?

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #9


Martin Honnen wrote:

But you are right, if I
have just the clearInterval on the onunload event, Netscape does not
crash. But, my application no longer works.


Does it no longer work because you are trying to refresh the page but it
does not?
If I understand your current framwork correctly then you are calling the
web service to see whether to refresh the page, right?
Then it could help to try the following e.g.
var intervalId;

window.onunload = function (evt) {
if (intervalId) {
clearInterval(intervalId);
}
};

function callWebService () {
// do web service call here then depending on the result do
if (serviceReturnsRefresh) {
clearInterval(intervalId);
window.onunload = null;
window.location.reload();
}
}

intervalId = setInterval('callWebService();', 5000);

That way the onunload clearing the interval timer will prevent the crash
when the window is closed but is deactivated before your code reloads
the page.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #10
Martin -

Upon further testing, I noticed that when the SOAP calls actually get
executed (when the page refreshes when it should) Netscape does not
crash upon close. However, when the page is functioning as it should,
it still crashes, despite the window.onunload = ... (clearInterval).
Additionally, in order for my close button to work, I had to make the
page sleep for 500 ms, or else it still crashed... Like this:

<input onclick="CloseWin();" ........>

function CloseWin()
{
window.clearInterval(intervalId);
window.setTimeout ("CloseWindow()", 500);
}

function CloseWindow()
{
window.close();
}

But, if I run the same code in FireFox 1.03, it does not crash. Maybe
this is a Netscape 7.0 specific issue? It seems as though Netscape
needs some time to clear the interval or something... And yes, your
understanding of my framework is correct. Sorry for running around in
circles... this is really driving me up the wall. Thanks for your
understanding.

Charles.

Jul 23 '05 #11
Sorry, in the first line i meant "Upon further testing, I noticed that
when the SOAP calls do not get executed (when the page does not refresh
when it should)...

Jul 23 '05 #12

M B HONG 20 wrote:
But, if I run the same code in FireFox 1.03, it does not crash. Maybe
this is a Netscape 7.0 specific issue?


Firefox 1.0 is based on Mozilla 1.7 while Netscape 7.0 is based on
Mozilla 1.0 and of course lots of bugs have been fixed between 1.0 and 1.7.
I am not sure how to solve the remaining issue with the old Mozilla
1.0/Netscape 7.0 crashing, perhaps you could consider changing to
Mozilla 1.7 or Firefox 1.0.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #13
Martin -

Thanks again for your reply. Since Netscape crashes pretty much 100%
of the time using my current implementation, I have decided to go with
the asynchronous approach and see how it performs. When using the
asynchronous method, it seems to have avoided the Netscape crash for
most of the time (it still happens sometimes, I don't know why yet),
and it still works the way I want it to. However, it seems to eat
memory while the window is open (about 60k per second is my estimate).
Do you have any idea why this occurs? I tried to put a
window.clearInterval(intervalId) upon refresh, but the memory still
goes up.

Jul 23 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: bigbinc | last post by:
I have setup a soap machine on linux and similar configuration works properly. on a windows mahcine, I get these erros on the addressbook, samples, any ideas. I am pretty sure my classpaths are...
2
by: mkosca01 | last post by:
Hello, I have recently downloaded and installed the Soap Toolkit 3.0 from microsoft. I have successfully created the example web service DocSample1 and am able to run this from the command line...
0
by: Daniel Thune, MCSE | last post by:
I am having a problem with formatting a SOAP Header in a .Net client. The client calls a Java Axis 1.1 based web service. In order to authenticate the caller, the web service call is intercepted by...
31
by: Bryan Dickerson | last post by:
Ok, simple question: from a VB.Net web service (as I've said before, I'm a newbie to SOAP), how would I get the SOAP body into a string? My boss and I concur that it, at least from our...
1
by: libsfan01 | last post by:
Hi all Can anyone explain the relationship between SOAP and XMLHttpRequest in Javascript? What actually is SOAP? and how does it relate to the process of transferring data client-side through...
0
by: santycalde | last post by:
Hi!! I am executing a call to a webservice with SOAP and the following mistake takes place: The XML of the wsdl is: <?xml version="1.0" encoding="UTF-8" ?> - <wsdl:definitions...
0
by: vigneshrao | last post by:
Hi, I have been working on a script that loops through multiple records and sends data (one record per call) to a WS. I am supposed to make a new call for each record before sending the data....
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.