Geeks With Blogs

News





INauseous() Shawn Cicoria - Solution Architect, Craftsman and Artisan - INauseous() - Main Blog Here: www.Cicoria.com

A nice feature of Windows Communication Foundation ("WCF"), and specfically, the svcutil.exe utility for generation of proxy code (it has a few other uses - one other nice feature is the pre-generation of serialization code) is having it share Data Contracts contained in a shared assembly on both the sender and receiver.

The /reference switch provides this capability - below is the /? help from the command line:

/reference: - Reference types in the specified assembly. When generating clients, use this option to specify assemblies that might contain types representing the metadata being imported. (Short Form: /r)

Now, this probably violate some core SOA tenets with regards to WSDL or Schema based contracts, but if you're in an all .NET world, or you've got ownership of both sides of the wire (or service boundary) then this does help a bit.

In ASMX a couple of ways to do it was to hand-code the proxy or use WSDL.exe and then comment out the type you want to share inside of the generated code.  Now, with the /reference switch for svcutil.exe this does the same thing.

 

Posted on Sunday, December 31, 2006 12:20 PM | Back to top


Comments on this post: WCF and Sharing Data Contracts

Comments are closed.
Comments have been closed on this topic.
Copyright © Shawn Cicoria | Powered by: GeeksWithBlogs.net