WebRequest : The underlying connection was closed: An unexpected error occurred on a send

  • Thread starter Thread starter Ron_13
  • Start date Start date
R

Ron_13

Guest
Wondering if anyone could provide some insight to this. System written in ASP.Net VB hosted by Azure.

I have a few vendors who I submit XML files via WebRequest. The system has worked fine both in production (Azure) and on my development station until today.

I am now receiving an error, "The underlying connection was closed: An unexpected error occurred on a send.' This error occurs when getting the request stream "request.GetRequestStream()" and occurs on the Azure website, and my development station. The only thing I can think of is that there was some security update that Microsoft did that affected my local station and Azure.

Snippet of code is as follows:

' Create a request using a URL that can receive a post.
Dim request As WebRequest ="https://dev.mms.TheWebSite.com/services/b2b/BZadZo8McaHXco4aTvrR0C1WkRMN87/cxml")

' Set the Method property of the request to POST.
request.Method = "POST"

' Create POST data and convert it to a byte array.
Dim postData As String =(Get the data here)
Dim byteArray As Byte() = Encoding.UTF8.GetBytes(postData)

' Set the ContentLength property of the WebRequest.
request.ContentLength = byteArray.Length

' Get the request stream.

'CRASHES WITH ERROR HERE:
Dim dataStream As Stream = request.GetRequestStream()






Any help would be appreciated!

Continue reading...
 
Back
Top