Where to enable metadata (is enabled in config)?

18,147

Solution 1

You need to add a metadata exchange (MEX) endpoint to your service node. Try something like this:

<endpoint 
    address="http://host/svc/mex" 
    binding="mexHttpBinding" 
    bindingConfiguration=""
    contract="IMetadataExchange"/>

Solution 2

If you are using Workflow 4.0 with WorkflowServiceHost and loading your service from a xamlx resource, it will not recognize a WCF serviceBehavior tag with a name. I don't know why (seems like a bug to me). For example, this tag from above:

<serviceBehaviors>
    <behavior name="TelerikWcfServices.Service1Behavior">
      <serviceMetadata httpGetEnabled="True"/>
      <serviceDebug includeExceptionDetailInFaults="False" />
    </behavior>
  </serviceBehaviors>

would need its name attribute eliminated like this:

<serviceBehaviors>
    <behavior>
      <serviceMetadata httpGetEnabled="True"/>
      <serviceDebug includeExceptionDetailInFaults="False" />
    </behavior>
  </serviceBehaviors>

and the service element would eliminate the reference to the behavior configuration name as in

<service 
    name="TelerikWcfServices.IScheduler">
    <endpoint address="http://localhost/Telerik" binding="basicHttpBinding"
      bindingConfiguration="" name="Telerik"      contract="TelerikWcfServices.IScheduler">...
Share:
18,147

Related videos on Youtube

GurdeepS
Author by

GurdeepS

Updated on April 19, 2022

Comments

  • GurdeepS
    GurdeepS about 2 years

    I have a basic wcf service and when I go to the wcfctestclient to test it, I get an error saying metadata could not be found please add it etc. Unfortunately, the MSDN link in the error popup is broken and my WCF service's app.config has metadata enabled:

      <serviceBehaviors>
        <behavior name="TelerikWcfServices.Service1Behavior">
          <!-- To avoid disclosing metadata information, 
          set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="True"/>
          <!-- To receive exception details in faults for debugging purposes, 
          set the value below to true.  Set to false before deployment 
          to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="False" />
        </behavior>
      </serviceBehaviors>
    

    Other than that, I haven't changed any metadata settings anywhere else in my code.

    Where can I enable metadata to fix the error?

  • GurdeepS
    GurdeepS over 14 years
    But then that changes the entire endpoint? I assume I can't use both? So what do I do when I need one of the other bindings?
  • Justin
    Justin over 12 years
    Tried adding that endpoint to my service node and it still says "The HTML document does not contain Web service discovery information."
  • flipdoubt
    flipdoubt almost 10 years
    Does this really work without setting <serviceMetadata httpGetEnabled="True"/>? It does not work for me.