Recommended Reading
Tags
.NET
ADO .NET
AES
AJAX
app.config
Architect
Architecture
ASP .NET
Azure
Behavior
C#
Cloud
Cloud Computing
Commanding
Complexity
Consulting
Converters
Cryptography
Decryption
Dependency
DynamicProxy
Encryption
Entity Framework
Generics
Hash
Hiring
jquery
LINQ
Managed Extensibility Framework
MEF
MVVM
Office Interop
ORM
Rackspace
Serialization
Silverlight
SQL
SQL Server
SQL Server CE
Visual Studio
WCF
web.config
Windows 8
Windows Communication Foundation
WPF

Hi Brandon. We used add service reference in our primary website, and now we need to also use our wcf service in another web project developed by a 3rd party. I realized it would be nice if I could just give them a dll and possibly some settings to add to web.config so they can use our service.
Your post is helpful in getting me on the right track.
Question though: can you give me some examples of using the ChannelFactory with a contract that has operations that return DTOs? Like PersonDTO GetPerson(int id) or something. When we do add service, the PersonDTO class is automatically in the service namespace. With ChannelFactory or the other methods, how do we access the PersonDTO?
Feel free to gchat me too if you have the time.
Thanks,
Philip
Hi Phillip,
I have a couple other posts that should help you with this, links below. Basically what you need to do is share your service contracts (one or more assemblies), data contracts (one or more assemblies) and configuration with this other project. Contracts and config only, not implementation. Then both projects can share a reusable service client if you want (channel factory implementation). Taking this one step further, you can create a NuGet package to deliver the service client, service contract, data contract, and configuration needed to hook up to your service, as well as sample code. So the developer experience would literally be a one click install that brought down the assemblies, added the needed references, and copied in the config file the needed configuration.
Hope this helps!
http://brandonzeider.me/2011/net-faq/using-channelfactory/
http://brandonzeider.me/2011/microsoft-net/building-a-reusable-service-client/
Thanks for pointing me in the right direction. We have our service contracts in one assembly, and our data contracts in a DTO assembly, so we could include those projects in our web projects. I need to look more into wiring up the configuration.
Philip