First, I would prefer to reply to a client with a method like this:
void SendEmployee(Guid requestId, Client.EmployeesProxyStub employee);
versus this:
void
SendEmployee(Guid requestId, string employee);
My reasons are somewhat complex. WCF has constraints for bindings such as maxBufferPoolSize, maxBufferSize, maxConnections, maxReceivedMessageSize, maxArrayLength, maxBytesPerRead, maxNameTableCharCount, maxStringContentLength, etc.
These constraints have defaults that can severely restrict sending strings. So, I suspect many users would hit these limits and have no idea why the service is crashing. I, personally, think its better to feed in objects versus a string because of this. Also note: If IIS is used as a service host, it can further restrict these values. Within WCF, the MaxStringContentLength defaults to 8K to 128K depending on the binding. These constraints are put in place to discourage successful DoS (denial of service) attacks.
So, its not just the lines of code, it is issues with default WCF values and the way the designers expect WCF to be used. In my case, I can override these values and I can use a string, so its not a show stopper and, of course - yes, fewer lines of code would always be better. However, in the long run, my suggestion would be something like this for the generated code:
Imagine a simple class with a few properties as an example (psuedo code):
public class CustomerProxyStub: ICustomer {
public CustomerProxyStub();
public CustomerProxyStub (ICustomer customer) {
this._name = customer.Name;
this._phone = customer.Phone;
// etc etc the properties are copied
}
public string Name {
get { return this._name; }
set { this._name = value; }
}
// etc more properties
}
Also NOTE: my personal preference, would to to call the classes CustomerDTO rather than proxy stub, but hey: tom(ay)to - to(mah)to (* maybe a place for me to override the naming logic?)
This way there is no serialization in the code. You may or may not be aware, WCF is designed to transfer objects directly and expects either the Serializable attribute or the DataContract attribute to serialize/deserialize - ON ITS OWN (I know you are aware of the attributes). The advantage sending objects is that the WCF framework expects objects to be large and has much greater defaults for objects and collections, but WCF defaults to very small transfer sizes for a string value. Your customers that experiment with WCF would have fewer problems using objects than using a string (based on my experience of having WCF crash once I sent more than a few records and realizing its not intuitive to figure out why).
Also, as you mentioned, interfaces are great for testing and for interacting with business object libraries - so its just handy anyway.
If you are going to implement any the suggestions I made in one form or another (It seems like you are and I also expect it would take some time), then I am fine just having the client-side use the full server-side code and include the .dlls within the client until a later update. I use click-once deployment and its not that big a deal for me because I don't need a true web-service or soa exposure. For me, I control the client AND service and third parties, currently, are not significantly involved.
So, if you are going that direction, I have patience and would glad to provide feedback.