I\'m trying to publish a wcf service using nettcpbinding. I want to publish metadata, using ?wsdl. I added the following line to the config file:
You need to publish service metadata via http for wsdl. Add the following tag to the <system.serviceModel> tag of your config file
<behaviors>
<serviceBehaviors>
<behavior name = "MetadataBehavior">
<serviceMetadata httpGetEnabled = "true"/>
</behavior>
</serviceBehaviors>
</behaviors>
You will also need to specify an http address where the service metadata in wsdl will be available from. Add this to the <service> node of your config file :
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8001" />
<add baseAddress="http://localhost:8000/Service1" />
</baseAddresses>
</host>
Then if you go to http://localhost:8000/Service1?wsdl, you should see the wsdl for your service.
You can try mexTcp binding and make sure your base address starts with net.tcp://.....
You need to use the <serviceMetadata>
element.
<behaviors>
<serviceBehaviors>
<behavior name="metadataSupport">
<!-- Enables the IMetadataExchange endpoint in services that -->
<!-- use "metadataSupport" in their behaviorConfiguration attribute. -->
<!-- In addition, the httpGetEnabled and httpGetUrl attributes publish -->
<!-- Service metadata for retrieval by HTTP/GET at the address -->
<!-- "http://localhost:8080/SampleService?wsdl" -->
<serviceMetadata httpGetEnabled="true" httpGetUrl=""/>
</behavior>
</serviceBehaviors>
</behaviors>