Skip to Content
Programming WCF Services, 2nd Edition
book

Programming WCF Services, 2nd Edition

by Juval Lowy
November 2008
Intermediate to advanced
784 pages
23h 28m
English
O'Reilly Media, Inc.
Content preview from Programming WCF Services, 2nd Edition

Contract Queries

Sometimes the client needs to programmatically verify whether a particular endpoint (identified by its address) supports a particular contract. For example, imagine an application where the end user specifies or configures the application during setup (or even at runtime) to consume and interact with a service. If the service does not support the required contracts, the application should alert the user that an invalid address was specified, and ask for an alternative or a correct address. For example, the Credentials Manager application used in Chapter 10 has just such a feature: the user needs to provide it with the address of the security credentials service that manages account membership and roles. Credentials Manager only allows the user to select a valid address, after verifying that the address supports the required service contracts.

Programmatic Metadata Processing

In order to support such functionality, the application needs to retrieve the service's metadata and see if at least one of the endpoints supports the requested contract. As explained in Chapter 1, the metadata may be available either in special metadata exchange endpoints (if the service supports them), or over the HTTP-GET protocol. When you use HTTP-GET, the address of the metadata exchange is the HTTP-GET address (usually just the HTTP base address of the service, suffixed by ?wsdl). To ease the task of parsing the returned metadata WCF offers a few helper classes, available in the System.ServiceModel.Description ...

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

Programming WCF Services

Juval Lowy

Publisher Resources

ISBN: 9780596157210Supplemental ContentErrata