Hi,
I've tried to create svc-less wcf service. Service works, but no metadata are genereted. How can I return service metadata back?
Hi,
I've tried to create svc-less wcf service. Service works, but no metadata are genereted. How can I return service metadata back?
Have you added a meta data endpoint to your service generation in the code?
ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
smb.HttpGetUrl = new Uri(EndPointAddress);
Host.Description.Behaviors.Add(smb);
Or using config file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service name="yourServiceName"
behaviorConfiguration="yourBehavior">
<host>
<baseAddresses>
<add baseAddress = "yourBaseAddress" />
</baseAddresses>
</host>
<endpoint address ="..."
binding="httpBinding"
contract="..." />
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="yourBehavior">
<serviceMetadata httpGetEnabled="True"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>