Reputation: 3832
I have noticed that when "Add Service Reference" is used in VS2010 then a ton of files are created. One of the files is Reference.cs which creates a ClientBase for the service contract.
Thus, I was wondering is there any advantage to the slew of extra files VS creates or can I just use a ClientBase myself and skip the "Add Service Reference" option.
I should note that in my case by sides are under my control.
Upvotes: 1
Views: 2990
Reputation: 59973
Here's an overview of the pros and cons with the different approaches from my point of view:
Pros
Cons
Pros
Cons
To summarize using proxies provides less friction when consuming WCF services while giving up some control and testability. Using the Channel API requires more code in exchange for a higher degree of flexibility, which comes in handy especially if you want to unit test components separately from the WCF services they communicate with.
Related resources:
Upvotes: 5