views:

99

answers:

2

I am trying to consume this WSDL service:

Transit Time Service

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

The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.

I overrode the 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 hasn't yielded any improvement. I am at a loss as to what options I have now, does anyone have any other ideas that I could try so that I may avoid this error?

Thanks in advance!

Josh

A: 

This usually indicates an issue with the service, as it is unexpectedly closing the connection from the server side. Are you transmitting large amounts of data or using a long running task?

Lerxst
No, I have pretty much spoken to their development group until I am blue in the face. I also came to the conclusion that it was their service after running quite a few tests using fiddler. Of course it comes down to them saying they can't find any problem so I am just left high and dry. Thanks though.
joshlrogers
A: 

This link provided the answer for my issue.

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

joshlrogers