The main connection was closed when using the WSDL web service

I am trying to use this WSDL service:

Transition Time Service

I successfully connect and get a response for the first time, but on subsequent calls I get an exception:

The connected connection was closed: the connection that was supposed to be saved was closed by the server.

I overloaded GetWebRequest in the reference.cs file as such:

protected override System.Net.WebRequest GetWebRequest(Uri uri) { HttpWebRequest webRequest = (HttpWebRequest)base.GetWebRequest(uri); webRequest.KeepAlive = false; return webRequest; } 

This did not give any improvement. I am at a loss as to what options I have, does anyone have any other ideas that I could try to avoid this error?

Thanks in advance!

Josh

+4
source share
2 answers

This link provided the answer for my problem.

http://forums.asp.net/t/1003135.aspx

+1
source

This usually indicates a problem with the service because it unexpectedly closes the connection from the server side. Do you transfer large amounts of data or use a multi-year task?

0
source

All Articles