Reputation: 16519
I have a weird issue. I had a web service that was compiled under the 2.0 framework that was being consumed by a windows app that was compiled with the 1.1 framework. This worked just fine. Now, after upgrading the web service to the 3.5 framework, the windows app is no longer able to call it.
Creating a little windows app in 3.5 as a test is able to call the web service without problems so I know it still works.
Nothing has changed in the code at all, it's just compiled as a 3.5 project instead of a 2.0 project.
For those who care what error I get back, it's this:
An unhandled exception of type 'System.Net.WebException' occurred in system.web.services.dll
Additional information: The underlying connection was closed: An unexpected error occurred on a receive.
Is there anything I can do to the web service to make it backwards compatible (if that's even the issue)?
[Edit] Responses to answers below (so far): Re-Discovering did not work, nor did removing and re-adding the webservice. I don't believe it's a SOAP issue becuase the WSDLs are identical (both show SOAP 1.2). Browsing to the webservice from the server works just fine.
Upvotes: 4
Views: 1999
Reputation: 1
I encountered this and solved it by forcing domain creds on the service.
[webservice].Credentials = System.Net.CredentialCache.DefaultCredentials;
OR
[webservice].Credentials = new System.Net.NetworkCredential([user], [pwd], [domain]);
Upvotes: 0
Reputation: 12760
It might be a problem with KeepAlives (e.g., through a proxy). As a test, add the code below to generated Reference.cs in the client (ugly -- yes). I've seen the problem when using Fiddler (which is a proxy) to test communication between the client and the server.
// Put this override in the generated Reference.cs of the client proxy
protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
HttpWebRequest webRequest = (HttpWebRequest)base.GetWebRequest(uri);
webRequest.KeepAlive = false;
webRequest.ProtocolVersion = HttpVersion.Version10;
return webRequest;
}
Upvotes: 1
Reputation: 6413
As an additional "sanity check", can the 3.5 web service be successfully called by soapUI?
Upvotes: 0
Reputation: 1810
It might be SOAP 1.0 versus SOAP 1.1. The 3.5 service is probably using 1.1 or 1.2, by default, which I think could be configured in the web.config bindings.
Upvotes: 1
Reputation: 6670
Can you go the the web service directly on the IIS installation? If not, check the application configuration in IIS. You must switch the version of ASP.NET.
Upvotes: 0
Reputation: 117220
Try 'rediscover' the web service in .NET 1.1 (possibly just a test app) and see if the problem persists.
Upvotes: 1