WCF Endpoint Configuration

The next thing I want to talk about in relation to WCF is the topic of endpoints. I’m going to take the sample Echo application that we have already built (see here first if you have not seen this sample application) and first publish the service on a different type of endpoint, e.g. Named Pipes. This is new to WCF and could not be easily accomplished in managed code (without Interop) before WCF – either with ASMX, obviously, nor with .Net Remoting.

Once we have done that I’m going to publish the service on three endpoints and have the client connect to any one of them as it chooses. The main point of interest here is that we will not be writing any code to achieve all of this (well, nearly no code); it will be accomplished purely with configuration (more...)


ch1c0 s4b10 said...

Is it possible to have an end point implementing several contracts (interfaces)?

Paul said...

The short answer is yes. You do this by creating your second contract as you would normally; decorate with the [ServiceContract] and [OperationContract] attributes where appropriate. Then you implement that new interface on your service code as well as the original interface. You can obviously do this as many times as you see fit.

Once you have that all in place you can configure the service as shown in the article, treating it as another endpoint. If you think a concrete example would be of benefit then please let me know.