0
votes

The scenario is like this:
I have a .NET 4.0 client-Server application that works fine.
I need to create a UserControl that can access the Server, but it needs to be created in .NET 2.0 (because customer application is .NET 2.0)

Does it exist a way to access .NET 4.0 WCF service from a 2.0 client?

NOTE:
it is not a Web service, but a standalone .exe server
No autentication used
Data transfered are almost basic (class with arrays and basic types within)
it uses client callbacks so protocol il net.tcp
optionally I can change protocol if I can still be able to use callbacks

4
Thanks, I will try it, even if it is not yet a confirmed working solutionMatteo TeoMan Mangano

4 Answers

2
votes

You need to expose the WCF as a Web Service:

The you work as if it was a good old .asmx service (add reference and so on).

It doesn't matter if your WCF service is hosted in a .exe, a web app, a windows service...

Supporting callbacks is not possible in .NET 2.0 with .asmx services, so that you have to simulate a callbak using something like TcpListener and TcpClient.

Unfortunately this has to de done from scratch, but you can use the logic in the WCF implementation.

1
votes

If your WCF 4.0 service is using basic http binding, you can use it in .NET 2.0 or in any other language.

Just use WSDL.exe to generate the proxy and use it in .NET or in any other language.

0
votes

Yes you can use the WCF service in .net 2.0 client by adding the reference of the .cs file (proxy class) in your client project.

0
votes

Question solved a while ago. Well, not really solved...

After looking at an article about performance on .NET WCF, I decided to use .NET remoting. It is faster, compatible native .NET 2.0 and it works.