Webservice problem (after iisreset)

J

Joao Maia

Hello all.

I am using a very simple web service I developed to access a SQL Server
database and returning some data. I am accessing this web service using
the Microsoft WebService DHTML Behaviour (WebService htc), in order to
access the data I need from some javascript code on a web page. So far,
so good, it works really fine, but there's a little problem: whenever
the web server is restarted (either with a reboot or just with an
iisreset command), I cannot get the webservice to work on the first
attempt after restarting. On the other attempts, it works normally, but
on the first attempt after an iisreset, nothing happens.

I have looked at the iis log files to see if there's any post against
the webservice application, and there actually is a post, and what's
more strange, it returns HTTP status 200, as if everything has gone ok.


So, assuming everything is ok with the web server, I tried using Visual
Source Studio to debug my webservice's asmx file. I placed a breakpoint
on the first line of the webmethod, but on the first time after doing
iisreset, execution never stops there. It does stop on the following
calls, but never on the first one, so I'm guessing that the object
never actually gets instantiated and thus, nothing happens on the first
call. I have also started SQL Server Profiler to see if anything gets
to the database, and no call gets to the database on the first attempt
after iisreset, which is just as I expected.

The problem is I really don't know why my object isn't instantiated
after I do iisreset. Is it instantiated only on the first call to the
webservice app ? If so, why doesn't it do anything even on that first
call ? Could it be some kind of timeout problem ?

My webservice class derives from System.Web.Services.WebService, and
the web method signature is as follows

[WebMethod]
public int GetOrganizationData(uint iSiteID, string sUserID, string
sMode, out string sRetValue)
{ // fetches some data from database and returns it on sRetValue }

Am I doing something wrong ? Is there any way of trying to understand
what's going on ? Please give me a hand here because I really don't
know what else to try...

I am running IIS 5 on an Windows XP development machine, but the
behaviour is the same on Windows 2000 Server, or on IIS 6 on Windows
2003. .NET Framework version is 1.1.

Thanks in advance,

joao maia
 
B

Brock Allen

My only guess would be that the client is timing out, perhaps. I'd suggest
bumping up the HTTP timeout and see if that helps.
 
J

Joao Maia

Hi, thanks for your reply, but how do I configure the HTTP timeout ? Do
you mean the asp script timeout on the web service app ? It's already
on 1 minute. Or is there any other way I can configure the timeout on
the client side ?

What I don't understand is why it only times out on the first call...
:(

Thanks once again,

joao maia

Brock said:
My only guess would be that the client is timing out, perhaps. I'd suggest
bumping up the HTTP timeout and see if that helps.




Hello all.

I am using a very simple web service I developed to access a SQL
Server database and returning some data. I am accessing this web
service using the Microsoft WebService DHTML Behaviour (WebService
htc), in order to access the data I need from some javascript code on
a web page. So far, so good, it works really fine, but there's a
little problem: whenever the web server is restarted (either with a
reboot or just with an iisreset command), I cannot get the webservice
to work on the first attempt after restarting. On the other attempts,
it works normally, but on the first attempt after an iisreset, nothing
happens.

I have looked at the iis log files to see if there's any post against
the webservice application, and there actually is a post, and what's
more strange, it returns HTTP status 200, as if everything has gone
ok.

So, assuming everything is ok with the web server, I tried using
Visual Source Studio to debug my webservice's asmx file. I placed a
breakpoint on the first line of the webmethod, but on the first time
after doing iisreset, execution never stops there. It does stop on the
following calls, but never on the first one, so I'm guessing that the
object never actually gets instantiated and thus, nothing happens on
the first call. I have also started SQL Server Profiler to see if
anything gets to the database, and no call gets to the database on the
first attempt after iisreset, which is just as I expected.

The problem is I really don't know why my object isn't instantiated
after I do iisreset. Is it instantiated only on the first call to the
webservice app ? If so, why doesn't it do anything even on that first
call ? Could it be some kind of timeout problem ?

My webservice class derives from System.Web.Services.WebService, and
the web method signature is as follows

[WebMethod]
public int GetOrganizationData(uint iSiteID, string sUserID, string
sMode, out string sRetValue)
{ // fetches some data from database and returns it on sRetValue }
Am I doing something wrong ? Is there any way of trying to understand
what's going on ? Please give me a hand here because I really don't
know what else to try...

I am running IIS 5 on an Windows XP development machine, but the
behaviour is the same on Windows 2000 Server, or on IIS 6 on Windows
2003. .NET Framework version is 1.1.

Thanks in advance,

joao maia
 
B

Brock Allen

Well, I was speaking about whatever means you're suing the make the call
from the client. You said something about a HTC. Presumably you can alter
the timeout on it, but since I've never used it I can't help you there. If
it already waits one minute for the failure then it sounds like the timeout
is already high enough.

I'd suggest writing an alternate client application and see if it has the
same problems. So use wsdl.exe to generate a .NET proxy to your webservice
to see if that style of client has the same problems or not. If it does,
then it sounds like something on the server, if it does not then it's likley
your HTC framework.




Hi, thanks for your reply, but how do I configure the HTTP timeout ?
Do you mean the asp script timeout on the web service app ? It's
already on 1 minute. Or is there any other way I can configure the
timeout on the client side ?

What I don't understand is why it only times out on the first call...
:(

Thanks once again,

joao maia

Brock said:
My only guess would be that the client is timing out, perhaps. I'd
suggest bumping up the HTTP timeout and see if that helps.

Hello all.

I am using a very simple web service I developed to access a SQL
Server database and returning some data. I am accessing this web
service using the Microsoft WebService DHTML Behaviour (WebService
htc), in order to access the data I need from some javascript code
on a web page. So far, so good, it works really fine, but there's a
little problem: whenever the web server is restarted (either with a
reboot or just with an iisreset command), I cannot get the
webservice to work on the first attempt after restarting. On the
other attempts, it works normally, but on the first attempt after an
iisreset, nothing happens.

I have looked at the iis log files to see if there's any post
against the webservice application, and there actually is a post,
and what's more strange, it returns HTTP status 200, as if
everything has gone ok.

So, assuming everything is ok with the web server, I tried using
Visual Source Studio to debug my webservice's asmx file. I placed a
breakpoint on the first line of the webmethod, but on the first time
after doing iisreset, execution never stops there. It does stop on
the following calls, but never on the first one, so I'm guessing
that the object never actually gets instantiated and thus, nothing
happens on the first call. I have also started SQL Server Profiler
to see if anything gets to the database, and no call gets to the
database on the first attempt after iisreset, which is just as I
expected.

The problem is I really don't know why my object isn't instantiated
after I do iisreset. Is it instantiated only on the first call to
the webservice app ? If so, why doesn't it do anything even on that
first call ? Could it be some kind of timeout problem ?

My webservice class derives from System.Web.Services.WebService, and
the web method signature is as follows

[WebMethod]
public int GetOrganizationData(uint iSiteID, string sUserID, string
sMode, out string sRetValue)
{ // fetches some data from database and returns it on sRetValue }
Am I doing something wrong ? Is there any way of trying to
understand
what's going on ? Please give me a hand here because I really don't
know what else to try...
I am running IIS 5 on an Windows XP development machine, but the
behaviour is the same on Windows 2000 Server, or on IIS 6 on Windows
2003. .NET Framework version is 1.1.

Thanks in advance,

joao maia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top