0

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

4 に答える 4

2

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.

于 2012-05-07T09:57:48.557 に答える
1

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.

于 2012-05-07T10:36:42.693 に答える
0

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.

于 2012-05-07T09:27:20.323 に答える
0

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.

于 2013-05-10T13:14:42.797 に答える