I doubt if this is a "Webservice issue" per se. You haven't shown us the code or told us what the "attendi" function does with the reference to the WebBrowser, so I can only make a guess as to the possibilities -
It seems possible that the "attendi" function raises an unhandled exception which causes the value of b to be never set to 0. This means that in the HelloWorld function, the code will be stuck in the While- End While loop indefinitely. This would explain the Timeout. You might also consider using a Thread.Sleep(0) along with DoEvents() to relinquish the CPU just long enough to allow the other thread to be executed. To be sure, why don't you debug the webservice app and find out where the code gets stuck and why? On Mar 31, 11:16 pm, Alcibiade <[email protected]> wrote: > Hi, I've written following code but I dont' receive answer with > helloworld call, I obtain timeout after 1 minute. any suggestion? > Thanks > > Public Class Service1 > Inherits System.Web.Services.WebService > > <WebMethod()> _ > Public Function HelloWorld() As String > Try > 'a and b are declared in a module as public > Dim tred As New Threading.Thread(AddressOf invita) > b = 1 > tred.SetApartmentState(Threading.ApartmentState.STA) > tred.Start() > While b = 1 > Windows.Forms.Application.DoEvents() > End While > Return a > Catch ex As Exception > Return ex.Message > End Try > End Function > > Public Sub invita() > Try > Dim WebBrowser1 As WebBrowser = New WebBrowser > WebBrowser1.Navigate("http://www.google.it") > attendi(WebBrowser1) > a = WebBrowser1.DocumentText > b = 0 > Catch ex As Exception > a=ex.message > b=0 > End Try > End Sub > > <WebMethod()> _ > Public Function name(ByVal d As String) As String > Return "hi " & d > End Function
