Skip to Content
Programming WCF Services, 3rd Edition
book

Programming WCF Services, 3rd Edition

by Juval Lowy
August 2010
Intermediate to advanced
908 pages
26h 22m
English
O'Reilly Media, Inc.
Content preview from Programming WCF Services, 3rd Edition

Service Bus Discovery

The benefits of dynamic addresses and decoupling clients and services on the address axis apply just as well to services that rely on the service bus to receive client calls. The problem is that UDP-based discovery is purely an intranet facility—there is no way to broadcast address information across the Internet. This means services that use the service bus cannot use WCF discovery.

However, you can use the events relay binding to substitute UDP multicast requests to provide discovery and announcements. This allows you to combine the benefits of ease of deployment of discoverable services with the unhindered connectivity of the service bus. The rest of this appendix walks through a small framework I wrote to support discovery over the service bus, bringing it on par with the built-in support for discovery in WCF, along with my set of helper classes. It also serves as an example for rolling out your own discovery mechanism.

Solution Architecture

For the built-in discovery of WCF, there are standard contracts for the discovery exchange. Sadly, these contracts are defined as internal. The first step in a custom discovery mechanism is to define the contracts for discovery request and callbacks. I defined the IServiceBusDiscovery contract:

[ServiceContract]
public interface IServiceBusDiscovery
{
   [OperationContract(IsOneWay = true)]
   void OnDiscoveryRequest(string contractName,string contractNamespace,
                           Uri[] scopesToMatch,Uri responseAddress);
}

The discovery endpoint ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming WCF Services, 4th Edition

Programming WCF Services, 4th Edition

Juval Lowy, Michael Montgomery
Programming .NET Security

Programming .NET Security

Adam Freeman, Allen Jones

Publisher Resources

ISBN: 9781449382476Supplemental ContentErrata Page