How to generating a WCF Client from Service Metadata

Metadata documents can be on a durable storage or be retrieved online.
Online retrieval follows either the WS-MetadataExchange protocol or
the Microsoft Discovery (DISCO) protocol. Svcutil.exe issues the
following metadata requests simultaneously to retrieve metadata:

WS-MetadataExchange (MEX) request to the supplied address.

MEX request to the supplied address with /mex appended.

DISCO request (using the DiscoveryClientProtocol from ASP.NET Web
services) to the supplied address.

Svcutil.exe generates the client based on the Web Services Description
Language (WSDL) or policy file received from the service. The user
principal name (UPN) is generated by concatenating the user name with
"@" and then adding a fully-qualified domain name (FQDN). However, for
users who registered on Active Directory, this format is not valid and
the UPN that the tool generates causes a failure in the Kerberos
authentication with the following error message: The logon attempt
failed. To resolve this problem, manually fix the client file that the
tool generated.

svcutil.exe [/t:code] <metadataDocumentPath>* | <url>* | <epr>