http://51uu.5d6d.com/viewthread.php?tid=120&extra=
The following is the example of the service configuration that exposing the metadata. I’ve bold the new configurations.
<? xml version = "1.0 "?>
< configuration >
< system.serviceModel >
< services >
< service behaviorConfiguration = "WcfBehavior " name = "WCF.Overpayment.OverpaymentPersistenceService ">
< endpoint address = "net.tcp://localhost:5000/OverpaymentService "
binding = "netTcpBinding " bindingConfiguration = "netTcpBindingConf "
contract = "WCF.Overpayment.IOverpaymentPersistenceService " />
< endpoint address = "mex " binding = "mexTcpBinding " name = "MEX " contract = "IMetadataExchange " />
< host >
< baseAddresses >
< add baseAddress = "net.tcp://localhost:5000/OverpaymentService " />
</ baseAddresses >
< timeouts closeTimeout = "00:00:10 " />
</ host >
</ service >
</ services >
< bindings >
< netTcpBinding >
< binding name = "netTcpBindingConf " transactionFlow = "true " maxReceivedMessageSize = "10000000 ">
< security mode = "None " />
</ binding >
</ netTcpBinding >
</ bindings >
< behaviors >
< serviceBehaviors >
< behavior name = "WcfBehavior ">
< serviceDebug includeExceptionDetailInFaults = "true " />
< serviceMetadata />
</ behavior >
</ serviceBehaviors >
</ behaviors >
</ system.serviceModel >
</ configuration >
Once you've set up this configuration, you'll be able to use the Visual Studio Command Prompt and type
svcutil net.tcp://localhost:5000/OverpaymentService
You should see the following
C:/temp/OverpaymentPersistenceService.cs
C:/temp/output.config
C:/temp>svcutil net.tcp://localhost:5000/OverpaymentService
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.648]
Copyright (c) Microsoft Corporation. All rights reserved.
Attempting to download metadata from 'net.tcp://localhost:5000/OverpaymentServic
e' using WS-Metadata Exchange. This URL does not support DISCO.
Generating files...
C:/temp/OverpaymentPersistenceService.cs
C:/temp/output.config
http://51uu.5d6d.com/viewthread.php?tid=120&extra=