I have a WPF application which so far has been client only, but now I'm working on splitting it into a client and server side. In this work I'm introducing WCF for the client-server communication. My application has several projects, and service references are needed from more than one of these.
Initial effort in doing the separation is to do everything "straight forward". All projects needing to communicate with a service gets a service reference, and so do the main WPF application project - to get the app.config there. I find this to turn into a mess rather quickly, and I can't imagine this being the typical architecture people use? I've also seen problems with the fact that each of the service references generates a new implementation of the DataContract classes - hence there is no common understanding of the DataContract classes on cross of projects. I have some ViewModel classes in one project, and another project instanciating some ViewModel. I'd like to pass the object received from service, but I can't as the generated client-side representation of the object received differs in each project.
So - is there a recommended way of structuring such client/server separations using WCF? Or principles to follow? I'm thinking one common Proxy project used on the client side that does the communication with the services, wraps the received data, and returns data on a form well known to the client libraries. Should give only one service reference, and I guess I only need the App.config in the wpfApp-project? Does this make sense?