I had add help page endpoint as in an example on MSDN and my metadata exchange endpoint stop work. Here exception details when i try to see metadata http://imgur.com/delete/HYe9c9OocABgxOj Without it all works great but i need to attach help page
<system.serviceModel>
<services>
<service behaviorConfiguration="MyServiceBehaviors" name="GoalTracker.WcfRestService.Service1">
<endpoint address="mex" binding="mexHttpBinding" contract="GoalTracker.WcfRestService.IService1" />
<endpoint address="" binding="webHttpBinding" contract="GoalTracker.WcfRestService.IService1" />
<endpoint address="Help" kind="webHttpEndpoint"
behaviorConfiguration="RESTEndpointBehavior"
contract="GoalTracker.WcfRestService.IService1" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MyServiceBehaviors">
<!-- Add the following element to your service behavior configuration. -->
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="True"
httpHelpPageEnabled="True"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="RESTEndpointBehavior">
<webHttp helpEnabled="true"/>
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
Contract on your mex
endpoint should be IMetadataExchange
However, I am not sure why you need mex
endpoint as your service is REST based.
By setting helpEnabled="true"
in the endpoint behavior, the help page will be automatically enabled. You don't need to add another endpoint with "Help"
address. Please remove that endpoint.
Set the kind="webHttpEndpoint"
and behaviorConfiguration="RESTEndpointBehavior"
on the main endpoint where address=""
.
So it should look like this:
<service behaviorConfiguration="MyServiceBehaviors" name="GoalTracker.WcfRestService.Service1">
<endpoint address="" kind="webHttpEndpoint"
behaviorConfiguration="RESTEndpointBehavior"
contract="GoalTracker.WcfRestService.IService1" />
</service>