Search code examples
c#wcfsilverlightweb-servicesservice-reference

Do you use ServiceReferences in LoB applications?


Do you use auto-generated WCF service references in line of business applications? Or do you roll your own? And why?

EDIT

For anyone looking to roll their own, I found this article which may prove useful: Understanding WCF Services in Silverlight 2. There's another article on the site for Silverlight 3 which may be a useful addition: Understanding WCF Faults in Silverlight 3.


Solution

  • I typically roll my own, or tweak the ones generated by the auto-generated wizard.

    I have two scenarios, most of the time:

    1. I control both ends of the wire - in that case, I share the assembly with the service and data contracts between the service and client, and in that case, I write my own clients from scratch, as ClientBase<T> descendants or using a ChannelFactory<T>. Unfortunately, this is not an option with a Silverlight client, as far as I know :-(

    2. I get WSDL+XSD from a third party - in that case, I typically use svcutil.exe to generate a first version of the client proxy, and then I tweak that to suit my needs (especially the configs generated by svcutil or VS "Add Service Reference" are horrendously bad.....)

    I just like to have that extra control of doing it myself and totally knowing what's going on.