Click here to Skip to main content
11,931,104 members (63,146 online)
Rate this:
Please Sign up or sign in to vote.
See more: ASP.NET WCF
I have created WCF service hosted on IIS. I get the following error when browse the service.

Metadata publishing for this service is currently disabled.

Here is the code for web.config

<?xml version="1.0"?>
        <compilation debug="true" targetFramework="4.0"/>
            <service behaviorConfiguration="ServiceBehavior" name="IISHostedServiceEx1.MyService">
                <endpoint address="http://localhost/IISHostedServiceEx1/MyService.svc" binding="wsHttpBinding" contract="IMyService">
                        <dns value="localhost"/>
                <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
                <behavior name="ServiceBehavior">
                    <!-- 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"/>

        <modules runAllManagedModulesForAllRequests="true"/>

Can any body tell me how can i resolve it?

thanks in advance.
Posted 18-Jan-13 6:38am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I believe the problem is the address you're using for the wsHttpBinding element.
Generally, there's no need to specify the address, unless you actually want it to run in a subaddres of the actual .svc file, as below:

    <service behaviorConfiguration="ClientProcessadorEventos" name="ClienteExternoWS.ClientProcessadorEventos">
      <endpoint address="mex" binding="mexHttpBinding" name="Mex" contract="ServiceInterfaces.IProcessadorEventos"/>
      <endpoint address="basic" binding="basicHttpBinding" name="Basic" contract="ServiceInterfaces.IProcessadorEventos"/>
      <endpoint address="" binding="wsHttpBinding" name="Ws" contract="ServiceInterfaces.IProcessadorEventos"/>
      <behavior name="ClientProcessadorEventos">
        <serviceMetadata httpGetEnabled="true"/>

In this case, my service exposes the same contract on the pure .svc address (root, as the address is not specified), and it also exposes as basicBinding on the [ServiceName].svc/Basic address.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web03 | 2.8.151126.1 | Last Updated 18 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100