what is means that when we must using Channel Factory that wecontrol both server and client?

StackOverflow https://stackoverflow.com/questions/21075493

  •  27-09-2022
  •  | 
  •  

Question

I really dont know what is this mean if we control both server and client then we can using Channel Factory ! For implementing a wcf service we should do 3 step: 1. implement our service 2. implement WCF host 3. implement WCF WCF client

when we create a WCF client then we can control it, it is not true?

Was it helpful?

Solution

If you control server and client you can use Channel Factory. On client side you need an assembly of the service interface. Therefore you "need to control both sides". Theoretically it's sufficient if you just control the client side but have access to the shared assembly with the service interface. On client side you then can create a channel:

var channelFactory = new ChannelFactory<ISomeService>("someEndpoint");

This approach might save time, but keep in mind, that it couples your client quite close to the service! Depending in your requirements it could be better to use a service proxy instead.

Take a look at this article: http://www.codeproject.com/Tips/558163/Difference-between-Proxy-and-Channel-Factory-in-WC

Edit: So your real question is: "What is meant by the term 'controlling client and server'?" This simply means that you or your organization has the ability to change the client software and the server software. So if you develop the client software and the server software you "control client and server". Imagine you're developing a weather service with a public API. In that case you don't have control over the client(s), because anyone could develop a client that communicates with your service.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top