WCF protocol configuration

Posted on 2014-08-22
Last Modified: 2014-08-22
Hi, I have a very simple WCF service application.

Where are a whole bunch of services, and they all "chatter" to each other using basicHttpBinding

The configuration looks something like this (I've changed it here from what it really is to keep it simple for my question).

      <service name="">
        <endpoint address="" binding="basicHttpBinding" contract="">
            <dns value="localhost" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
            <add baseAddress="http://localhost:80/CompanyName/ProductName/I1123" />

Open in new window

Each of the services chatters to another WCF service application.

Some service applications are configured using basicHttpBinding.
Others are configured using WsHttpBinding, and netTcpBinding.

The reason for the differences is that the services are deployed on different computers, and there are some existing firewall rules that don't allow me to choose the same protocol etc for every service.

Some of my existing bindings also have timeouts, see

My question is is there a way to setup multiple bindings, so that

"magically" the service and the client (another service) try a whole bunch of bindings with timeouts configured and eventually fail over/find to the one that works and use that, ie. first try basicHttpBinding, with a timeout, if that works communicate that way, otherwise try the next one in the list, and so on and so on. When specifying netTcpBinding I would like to also specify - try these port number ranges, eg. 8000 - 8500 but not all the others.

Is this possible?
Question by:John Bolter
    LVL 74

    Expert Comment

    by:käµfm³d 👽
    I don't believe so, but you could certainly write code to accomplish this. When you create an instance of your client, the constructor is overloaded to accept the name of the endpoint you would like to use. You can wrap each successive call in a try/catch, and simply pass in whatever is in the name property of each endpoint as you create new clients.

    Author Comment

    by:John Bolter
    Some guy on Twitter posted earlier with these links that I read. I don't know whether it is what I want or not or what I'm describing.
    LVL 74

    Accepted Solution

    The way that I'm reading that article, "service discovery" is more about, "Which distinct services are available to me, and where does each live?" It will tell you which endpoints are available, but it won't cycle through them if one fails. As I understand it, you could basically ditch all of that stuff that you have in the confg file--the service discovery agent would provide you with that information.

    Author Comment

    by:John Bolter

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
    Article by: Najam
    Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now