.Net 3.5 WebService can't be called by .Net 1.1 Windows App
Asked Answered
I

6

4

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.

Inflict answered 7/11, 2008 at 14:25 Comment(0)
F
1

Try 'rediscover' the web service in .NET 1.1 (possibly just a test app) and see if the problem persists.

Fretwork answered 7/11, 2008 at 14:28 Comment(1)
This did not resolve the issue. I even tried removing the reference and re-adding the web reference and the issue still persists. Thanks anyways!Inflict
M
1

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.

Middlebreaker answered 7/11, 2008 at 14:30 Comment(1)
The wsdls are identical from the original web service to the new web service. I don't believe this is the issue. Thanks anyways!Inflict
T
1

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;
    }
Titan answered 8/11, 2008 at 3:3 Comment(0)
C
0

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.

Catlin answered 7/11, 2008 at 14:30 Comment(1)
Yes, browsing to the web service is fine. I can execute each of the methods from the server via the asmx interface.Inflict
K
0

As an additional "sanity check", can the 3.5 web service be successfully called by soapUI?

Kochi answered 7/11, 2008 at 19:48 Comment(1)
Can the 1.1 app successfully invoke a web service made in 3.5 that wasn't upgraded? For example, make a new 3.5 web service, add a HelloWorld method that returns a string, and see if you can invoke that from the 1.1 app without an error.Kochi
G
0

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]);

Gorgias answered 18/1, 2010 at 17:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.