.netvb.netweb-services

The underlying connection was closed - WEB SERVICES


I want to connect with API through Web Services.

I've done everything like this: Integration with another system

and I get the same error:

"The underlying connection was closed: An unexpected error occurred on a receive."

I also created a new class:

Class MyTestService
    Inherits SenditAPI.SendItpl
    Protected Overrides Function GetWebRequest(ByVal uri As Uri) As System.Net.WebRequest
        Dim webRequest As System.Net.HttpWebRequest
        webRequest = CType(MyBase.GetWebRequest(uri), System.Net.HttpWebRequest)
        'Setting KeepAlive to false 
        webRequest.KeepAlive = False
        GetWebRequest = webRequest
    End Function
End Class

according with http://support.microsoft.com/kb/915599


Solution

  • It seems to be a problem with configuration.

    Check App.config file. The address in <value>...</value> seems to be incorrect.