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

Reply via email to