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

Appendix C. Discovery

All the WCF calls demonstrated throughout this book share two constraints. First, the port or the pipe assigned to the service must be available. The application developer or the administrator literally has to guess or have some way of knowing the port or the pipe is not used by any other application on that machine. TCP port sharing can alleviate this problem, but does not help with the second constraint: the client must a priori know the address of the service endpoints—not just the port number or the pipe name, but also the name of the service machine (in the case of TCP).

It would be great if the service could use any available address, decided upon at runtime. In turn, the client would need to discover that address at runtime. In fact, there is even an industry standard-based solution that stipulates how that discovery takes place. That solution, called simply discovery (and its supporting mechanisms), is the subject of this appendix.

Note

Discovery is not a new idea, and veteran developers have often opted for not embedding the type of the class to instantiate in their code and instead resorted to a class factory to resolve or discover the actual type supporting the desired interface:

IMyInterface obj = MyClassFactory.CreateInstance<IMyInterface>();

In WCF, since the client always programs against the interface or the proxy, the address of the service is analogous to the type of the implementation class in regular .NET programming. Address discovery is therefore ...

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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

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: 9781449382476Errata Page