开发者

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开发者_StackOverflow another article on the site for Silverlight 3 which may be a useful addition: Understanding WCF Faults in Silverlight 3.


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.


I haven't had to use Silverlight to access a service I didn't control, but in accessing a WCF service that I do control, yeah, I use the standard auto-generated WCF references. Rolling my own would just be too painful when the service is changing regularly.

If you control both ends of the service, you should also strongly investigate RIA Services, which implements a much more elegant way of keeping your Siverlight client in sync with your WCF service than having to manually regenerating your service references each time the interface changes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜