Connection Was Closed Exception In Vb

Last Reply 8 days ago By AnandM

Posted 8 days ago

I Want To Call A Webservice Host On Another Server TO Get Response . bUt When i Call THsi Webservice . Response Throw Exception . Connection Was Closed On Send. 

If I Change This Url THen Working . 

Please Give Me An Solution For This Task .. 

Thanks In Advance

 Public Sub MyButton_Click(ByVal Ctrl As Office.CommandBarButton, ByRef CancelDefault As Boolean)
        Dim webResponse = ""
        Dim req As HttpWebRequest
        Dim res As HttpWebResponse = Nothing
        Dim RED As StreamReader
        Dim uri As String = "https://api.authenticatedreality.com/emails/check?hash=1bc59391e15d908c66931e83434d5be48036775299f229f1d5fba81c727ca5ca&hash=ed125a3745d29533377d5276862624a9ca1e4e1a42a2fd62a754fc6d53d4&hash=ed125a374529533377d5276862624a9ca1e4ef1a42a2fd62a754fc6d53d4&hash=ed125a3745w29533377d5276862624a9ca1e4e1a42a2fd62a754fc6d53d4&hash=ed125avv374529533377d5276862624a9ca1e4e1a42a2fd62a754fc6d53d4&hash=ed125a374529533377d5276862624a9ca1e4e1av42a2fd62a754fc6d53d4&hash=ed125as374529533377d5276862624a9ca1e4e1a42a2fd62a754fc6d53d4&hash=ed125a374529533377d527v6862624a9ca1e4e1a42a2fd62a754fc6d53d4&hash=ed125a374529533377d527686h2624a9ca1e4e1a42a2fd62a754fc6d53d4"
        Try

            req = DirectCast(WebRequest.Create(uri), HttpWebRequest)
            req.KeepAlive = False
            ServicePointManager.MaxServicePoints = 4
            ServicePointManager.MaxServicePointIdleTime = 1000
            ServicePointManager.UseNagleAlgorithm = True
            ServicePointManager.Expect100Continue = True
            ServicePointManager.CheckCertificateRevocationList = True
            ServicePointManager.DefaultConnectionLimit = _
                ServicePointManager.DefaultPersistentConnectionLimit

            ' Get response  
            res = DirectCast(req.GetResponse(), HttpWebResponse)

            ' Get the response stream into a reader  
            RED = New StreamReader(res.GetResponseStream())

            ' Console application output  
            Console.WriteLine(RED.ReadToEnd())
        Finally
            If Not res Is Nothing Then res.Close()
        End Try

 

You are viewing reply posted by: AnandM 8 days ago.
I agree, here is the link: http://e-iceblue.com/free-api