I'm trying to create wcf service hosted by ASP.NET (I did that some time ago, but now I can't...)
On this step I want to add Meta-data support. Once I've added the following endpoint to configuration:
<endpoint address="mex" behaviorConfiguration="McActivationApp.EnrollmentServiceAspNetAjaxBehavior"
binding="mexHttpBinding" contract="IMetadataExchange" />
I've got the following error:
The endpoint at 'http://MyPcName/MCActivation/EnrollmentService.svc/mex' does not have a Binding with the None MessageVersion. 'System.ServiceModel.Description.WebScriptEnablingBehavior' is only intended for use with WebHttpBinding or similar bindings.
I've tried to change 'IMetadataExchange' contract to ''. That cause another error:
The endpoint at 'http://MyPcName/MCActivation/EnrollmentService.svc/mex' does not have a Binding with the None MessageVersion. 'System.ServiceModel.Description.WebScriptEnablingBehavior' is only intended for use with WebHttpBinding or similar bindings.
Please advise, how can I add support for meta data properly?
Here is full 'system.serviceModel' section.
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="McActivationApp.EnrollmentServiceAspNetAjaxBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="McActivationApp.EnrollmentServiceAspNetAjaxBehavior">
<serviceMetadata httpGetEnabled="True"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<services>
<service behaviorConfiguration="McActivationApp.EnrollmentServiceAspNetAjaxBehavior"
name="McActivationApp.EnrollmentService">
<endpoint address="" behaviorConfiguration="McActivationApp.EnrollmentServiceAspNetAjaxBehavior"
binding="webHttpBinding" contract="McActivationApp.EnrollmentService" />
<endpoint address="mex" behaviorConfiguration="McActivationApp.EnrollmentServiceAspNetAjaxBehavior"
binding="mexHttpBinding" contract="McActivationApp.EnrollmentService" />
</service>
</services>
</system.serviceModel>
</configuration>