|
As some of you may already have figured out, there have been a few breaking chnages in WCF's RC1 OM which is currently being distributed with the June CTP of .NET Fx 3.0. One point of confusion: Metadata publishing is no longer enabled by default for WCF services. You must now explicitly configure metadata endpoints for your service by adding the ServiceMetadataBehavior (from System.ServiceModel.Description namespace) to your service and adding a IMetadataExchange-based endpoint using the standard mechanisms for adding endpoints to a WCF service. The metadataPublishing behavior configuration section has been renamed to serviceMetadata accordingly. Also, the enableGetWsdl configuration attribute has been split into two attributes: httpGetEnabled and httpsGetEnabled. Likewise, the metadataLocation attribute has been renamed to externalMetadataLocation. OK, so much for the theory. So here is a complete sample in config - this enables both WSDL and MEX metadata: <configuration> <system.serviceModel> <services> <service name="Service.TecTvService" behaviorConfiguration="metadataBehavior"> <host> <baseAddresses> <add baseAddress="http://localhost:7777/tectv"/> </baseAddresses> </host> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> <endpoint address="net.tcp://localhost:1234/tectv" binding="netTcpBinding" bindingConfiguration="unsecureTcp" contract="Contracts.ITecTv" /> <endpoint address="http://localhost:7777/tectv/http" binding="basicHttpBinding" contract="Contracts.ITecTv" /> </service> </services> <behaviors> <serviceBehaviors> <behavior name="metadataBehavior"> <serviceMetadata httpGetEnabled="true" /> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> </configuration>
|