views:

1873

answers:

3

We recently upgraded an application that that contained web services using the WSE 2.0 to .NET 3.5. When we converted the project in Visual Studio 2008, It did not mention anything about the removing and/or modifying the WSE 2.0 namespaces. Here is the basic architecture of the web services in the .NET 1.1 project.

Web Service Source Code:

[WebService(Namespace="http://tempuri.org")]
public class MyWebService : BaseWebService
{
    //Do some stuff
}

BaseWebService Source Code:

using Microsoft.Web.Services2;
using Microsoft.Web.Services2.Security;
using Microsoft.Web.Services2.Security.Tokens;

namespace MyNameSpace
{
    public class BaseWebService : System.Web.Services.WebService
    {
        public BaseWebService()
        {
            if(RequestSoapContext.Current == null)
                throw new ApplicationExcpetion("Only SOAP requests are permitted.");
        }
    }
}

During the conversion, the BaseWebService.cs class was excluded from the project and the WSE2.0 namespaces were removed from the class.

Have anyone else experiences any issues with trying to upgrade a web service from .NET 1.1 using the WSE to .NET 3.5?

This is related to the previous question I had regarding a client consuming the upgraded web service:

Stack Overflow Question

A: 

the biggest problem I've found is in Javascript that had hardcoded the names of some of my server controls. in ASP.NET 2.0 with masterpages, the id's where changed to something like ctrl$_gridview1_checkbox1... Therefore, any hardcoded references needed to be changed and generated from the server side using the ClientID property of the control.

I also found that .NET 2.0 was more strict about uncaught exceptions, after upgrading and just changing the minimum code so that we would get a successful compile we started getting lots of crashes and unhandled exceptions. We had very buggy and poorly written code to begin with, but is just interesting that .net 1.1 never complained or swallowed the errors happily...

Ricardo Villamil
+1  A: 

As I answered to the original question:

WCF (.net 3.5) is said to be compatible with WSE3 (.net 2.0+), but not with WSE2 (.net 1.1+).

So if you don't want to change the client, but want it to be compatible with the service, you can leave the old service source code and keep the references to WSE2 assemblies under VS2008 solution. Thus, both the client and the service will be compatible.

DreamSonic
So the reference to the WSE 2.0 with have to be in the client and service, or just in the service?
Michael Kniskern
The client proxy should inherit Microsoft.Web.Services2.WebServicesClientProtocol. The service implementation should use Microsoft.Web.Services2 namespaces and assemblies. Web.config should have system.web/webServices/soapExtentionTypes properly set up.
DreamSonic
Look at my latest answer for configuration settings...
Michael Kniskern
Could you vote me up for the tip? ;)
DreamSonic
Done. I have posted the soapExtentionTypes settings for the upgraded webservice
Michael Kniskern
A: 

Here is the settings in the web.config for the service:

<system.web>
    <webServices>
        <soapExtensionTypes>
            <add type="Microsoft.Web.Services2.WebServicesExtension, Microsoft.Web.Services2, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" priority="1" group="0" />
            <!--<add type="Microsoft.Web.Services2.Configuration.WebServicesConfiguration, Microsoft.Web.Services2, Version=2.0.3.0, Culture=neutral,  PublicKeyToken=31bf3856ad364e35"/>-->
        </soapExtensionTypes>
   </webServices>  
</system.web>
Michael Kniskern