How to use WSE 3 in Visual Studio 2008

I upgraded some projects to Visual Studio 2008, in the project I was using a WSE 3.0 web service. The project compiled fine but I found when I updated the web service I was using the proxy class that was generated did not work. The proxy class inherited from System.Web.Services.Protocols.SoapHttpClientProtocol instead of Microsoft.Web.Services3.WebServicesClientProtocol. This was quite a problem I didn't fancy having to manually recreate it each time  wanted to update the WSE 3.0 web service.

I googled for the solution and found a number of solutions that involved writing some code for an add-in. Eventually I found the perfect solution. Jinal Patel posted how to use WSE 3 in Visual Studio 2008.

Here is a summary of Jinal's solution, check his site for the original solution.

  1. Download and install WSE 3.0 but if you are reading this its probably installed. 
  2. Locate the Visual Studio 2005 add-in at following location C:Documents and SettingsAll UsersApplication DataMicrosoftMSEnvSharedAddins
  3. At that location you find the file “WSESettingsVS3.Addin”.
  4. Open file in locate the section 8.0  and change it to 9.0 and save
  5. Open the Visual Studio menu and select Tools –> Options –> Environments 
  6. If its not already listed add %ALLUSERSDOCUMENTS%MicrosoftMSEnvSharedAddins
  7. Restart Visual Studio.

The solution didn't work straight off I had to make one more change. A second post by Jason Young, How to use WSE 3 in Visual Studio 2008 shows a second setting that was required. The only part of the post I followed was the addition of the xml below to the devenv.exe.config file.

system.web>  
    webServices>  
        soapExtensionImporterTypes>  
            add type="Microsoft.Web.Services3.Description.WseExtensionImporter,  
               Microsoft.Web.Services3, Version=3.0.0.0,  
               Culture=neutralPublicKeyToken=31bf3856ad364e35/>  
        soapExtensionImporterTypes>  
    webServices> 
system.web> 

That's it, I restarted Visual Studio and updated the web service and the WSE 3.0 proxy class and methods were generated.