Hello there,
I'm currently trying to get my hands dirty with WCF. I pretty carefully studied all the various examples which come with the VS 2008 MSDN release. My (really just my ) problem is as follows: all examples I've seen so far strictly divide a WCF communication pair into a client and a service. Worse, there's no shared contracts neither data nor services/operations. After building and hosting a service, all the examples use svcutil.exe to generate the client stubs. This generated code implements the same contract as the service, but in a pretty different way which leads to funny code like the service calling the client's "sendXyzRequest" method.
For my tiny brain, a better approach would be a central point (assembly, whatever) which defines the data and service contracts and which both the client(s) and the services share by referencing this authority. Furthermore, even the implementations could be in one single place. For a request/response service you'd get a pretty straightforward sequence of method calls: client sends the request, service receives the request, service processes the request and creates an appropriate response, service sends the response, client receives the response. In a clean implementation, you'd completely hide any service.XYZ() calls within the client's code and vice versa.
BUT, in order to do this, there may be only ONE acmeClient.SendOrder() method, ONE acmeService.ReceiveOrder() method, ONE acmeService.SendOrderConfirmation() method, and ONE acmeClient.ReceiveOrderConfirmation() method, thus TWO classes which have to be the SAME TWO classes at the client and at the service, while the examples deal with four classes which only partly implement the contracts, but the "client's client side" and the "service's client side" implement the same contract's parts in different ways. At least to me this looks pretty ugly.
If anybody knows some examples which reflect my babble I'd be thankful for any hints.