Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use WSE3 within a .NET 4 app, to communicate with an old webservice?

I have a .NET 3.5 library assembly which uses WSE 3.0 to communicate with an outside webservice. We're upgrading our system to .NET 4, but the outside webservice will remain unchanged. (Edit: not sure if it's relevant, but the outside webservice is implemented in Java)

To make the migration process as fast as possible, I don't want to change our system code except where absolutely necessary. Will the WSE3 library still work, once I update the system to .NET 4?

I've seen a couple questions indicating that we should no longer be using WSE to build webservices (see references below). However, I'm using it purely as a client, to communicate with an outside webservice, so I'm confused as to whether or not it will work.

References:

  • what's assembly for Microsoft.Web.Service3 of .NET 2.0 in .NET 4.0?
  • http://msdn.microsoft.com/en-us/library/ms732008.aspx
  • http://msdn.microsoft.com/en-us/library/ms730294.aspx
like image 520
mikemanne Avatar asked Jan 21 '23 10:01

mikemanne


1 Answers

I had the same situation last week, and the answer is no (or at least not easily, and in no way that can be found after 6 hours of googling.) Part of the problem is that there's no option to enable WSE from Visual Studio in VS 2010 (or VS 2008, for that matter).

However, on the bright side, it was very easy to point to the web services using the "Add Service Reference" tool in VS2010, and adding a Service Reference (new style) as opposed to a "Web Reference". After banging my head against the wall trying to figure out how to get support for WSE with a Web Service reference, I just gave the new way a shot, and Visual Studio was smart enough to handle it properly. It was able to create a client that could communicate with the server with no additional configuration.

The main difference is that instead of generating a proxy class for the service that allows you to call functions on the proxy class, the new tool creates a Client class for the service, that allows you to use the client to execute methods. It's actually a very small change when you get used to it. Once I figured out the differences, a few global find and replace operations handled updating the necessary code.

Edit

Go figure. This time around I found an answer in the first minute of googling.

You can enable that option mentioned in the first paragraph, and I bet it will work.

However, I'm leaving the rest of my answer as it's still probably better to switch to the new way now.

http://www.junasoftware.com/blog/how-to-use-wse-3-in-visual-studio-2010.aspx

like image 102
David Avatar answered May 12 '23 12:05

David