WCF protocol configuration

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).

    <services>
      <service name="com.company.testapp">
        <endpoint address="" binding="basicHttpBinding" contract="com.company.prod1.I12">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:80/CompanyName/ProductName/I1123" />
          </baseAddresses>
        </host>
      </service>
    </services>

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 http://msdn.microsoft.com/en-us/library/hh924831(v=vs.110).aspx

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?
John BolterAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

käµfm³d 👽Commented:
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.
0
John BolterAuthor Commented:
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.

http://geekswithblogs.net/shaunxu/archive/2012/07/06/service-discovery-in-wcf-4.0-ndash-part-1.aspx
0
käµfm³d 👽Commented:
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.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
John BolterAuthor Commented:
Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.