Webservice problem (after iisreset)

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default Webservice problem (after iisreset)

    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

    Joao Maia Guest

  2. Similar Questions and Discussions

    1. Problem with .NET WebService
      The problem: There is web service and its client (.NET 1.1). The session support on web service is turned on. After the number of successful...
    2. RAS / WebService Problem
      We have developed a VB.net application for Pocket PC devices, which download data from a VB.net webservice. We are currently implementing the RAS...
    3. Running iisreset
      Hello all, I am trying to perform a reboot on my server from an asp page. I have a link on my page that, when clicked on, redirects to a .stm...
    4. problem with Ado.Net w WebService
      hi I have problem with ado.net in web services. I work with Pervasive2000i and after creation Connection object: this.oleDbConnection1 = new...
    5. Fire IISReset command on event aspnet_wp.exe (PID: 1234) was recycled...
      Dear All, I would like run a program that does an IISReset when aspnet_wp.exe (PID: 1234) was recycled...In IIS service we have a property...
  3. #2

    Default Re: Webservice problem (after iisreset)

    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.

    -Brock
    DevelopMentor
    [url]http://staff.develop.com/ballen[/url]


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


    Brock Allen Guest

  4. #3

    Default Re: Webservice problem (after iisreset)

    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 Allen wrote:
    > 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.
    >
    > -Brock
    > DevelopMentor
    > [url]http://staff.develop.com/ballen[/url]
    >
    >
    >
    > > 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
    > >
    Joao Maia Guest

  5. #4

    Default Re: Webservice problem (after iisreset)

    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.

    -Brock
    DevelopMentor
    [url]http://staff.develop.com/ballen[/url]


    > 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 Allen wrote:
    >
    >> 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.
    >>
    >> -Brock
    >> DevelopMentor
    >> [url]http://staff.develop.com/ballen[/url]
    >>> 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
    >>>


    Brock Allen Guest

  6. #5

    Default Re: Webservice problem (after iisreset)

    Actually, I do have a timeout property on the Microsoft WebService HTC,
    but guess what... Their documentation says that property is not used...
    :( Which leads me to another question, which is why would they put it
    there if it's not used, but that's another story...

    Anyway, I'm back on square one... I will try to do as you say, and
    write a simple webservice client to see if I get the same behaviour...
    Thanks for your help.

    jm

    Joao Maia Guest

  7. #6

    Default Re: Webservice problem (after iisreset)

    I did write another client for this webservice and it worked fine, so
    I'm guessing it should be something with the HTC WebService behaviour.
    And I think I know what it is... On my new client (which is a simple
    windows app), I noticed that the first call to the web service after
    reseting the web server always takes a considerably longer time than
    the subsequent calls, so I'm guessing that this time is bigger than the
    default timeout for the htc webservice behaviour... Since there's no
    way (that I know of) to change this timeout value, I guess I'm stuck
    with this problem... :(

    Anyway, thanks for your help. If you do remember any thing that may
    help me, say something...

    Cheers,

    jm

    Joao Maia Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139