Sharing WCF Proxy classes or the classes that call those proxies

Dec 13, 2008 at 7:26 AM
Hello,

#1.

Is there any way to share the generated proxy classes between WPF and Silverlight? I'm exposing the WCF service with basic-http binding. I will consume that WCF service from Desktop project and Silverlight. But i don't like to have the seperated projects so I'm looking for a way to share those generated proxy classes between WPF and Silverlight.

Note: I tried to do that but I got a lot of problems since the namespace and class structure of WPF and Silverlight have some differences.

#2. Can I share the classs that invoke the proxy class if this #1 requirement is not possible?

For example:

[Desktop]

-----MyProject.ClientEntities.Desktop
----------------MyEntityClass [Link from Silverlight]
-----MyProject.Manager.Desktop  ( We are doing the translation from Service Entity to Client Entity.)
----------------MyServiceManager [Link from Silverlight??   ] 
----MyProject.ServiceProxy.Desktop
----------------MyWCFProxy [Can I use it as a link? OR Should it be an actually class?]
[Silverlight]

-----MyProject.ClientEntities
----------------MyEntityClass [Actual File]
-----MyProject.Manager.Desktop 
----------------MyServiceManager [ Actual File] 
----MyProject.ServiceProxy.Desktop
----------------MyWCFProxy [  Actual File.]

Dec 17, 2008 at 3:41 PM
I will answer my own questions..

#1. It's not possible to share the ServiceClients at this moment but it shouldn't be a problem since the only things that the developer need to do is "Updating the service"..

#2. Yes. but you will need to reference System.ServiceModel and System.Runtime.Serialization assemblies.

Hope it helps for other people. If you are facing any problem with this approach, please email me or drop a comment in my blog. I will get back you as soon as I can.