Simple WCF Client by contract and without svcutil

Sometimes your WCF based Sever and Client, both have access to the contract assembly (common approach in .NET Remoting, btw). There is good chance to reduce your code. Well, at least client code. Look at the following code:

public MyCoolService Create()
{
	var factory = new ChannelFactory<MyCoolService>(new WSHttpBinding());
	var address = new EndpointAddress("http://localhost/ MyCoolService.svc");
	return factory.CreateChannel(address);
}

As per name ChannelFactory is a factory. And it will create fully functional client. And yes, it works :).

In our application, we use WCF web-services for communication between components. This stuff made WSDL and auto-generated proxies redundant. And we dropped many code. I think this is good thing.

Enjoy!