What are the Different Ways to Obtain WCF Service Metadata Information?

A client can obtain much of the information that is required to communicate with a service by querying the service metadata. The service metadata describes the WCF service; it includes information about the operations that it exposes and the types that those operations use

WS-MetadataExchange

You can expose service metadata directly to the client by configuring a Web Services Metadata Exchange (WS-MetadataExchange) endpoint that implements the IMetadataExchange contract.

If your WCF service exposes a WS-MetadataExchange endpoint, you can use tools such as the Add Service Reference function in Visual Studio 2008 to create the necessary WCF types and satisfy the remaining prerequisites

Not WS-MetadataExchange

If your WCF service does not expose a WS-MetadataExchange endpoint, you should obtain the information and artifacts from the service provider. The information that is exchanged will include the endpoint address(es), the binding(s) to be used, and the contract type as a .NET interface.

Service providers may deliver this information in various ways such as:

  • The original service contract as an annotated .NET interface and written instructions about which bindings and endpoints to use.

  • Metadata documents such as the Web Services Description Language (WSDL) and XML Schema Definition (XSD). The client can use the ServiceModel Metadata Utility Tool (Svcutil.exe) to process the artifacts and generate client-side proxy types.

  • A pregenerated client proxy that can just be included in the client's project

 

Tags: