Click here to Skip to main content
Rate this: bad
good
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"?>
<configuration>
    <system.web>
        <compilation debug="true" targetFramework="4.0"/>
    </system.web>
    <system.serviceModel>
        <services>
            <service behaviorConfiguration="ServiceBehavior" name="IISHostedServiceEx1.MyService">
                <endpoint address="http://localhost/IISHostedServiceEx1/MyService.svc" binding="wsHttpBinding" contract="IMyService">
                    <identity>
                        <dns value="localhost"/>
                    </identity>
                </endpoint>
                <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
            </service>
        </services>
        <behaviors>
            <serviceBehaviors>
                <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"/>
                </behavior>
            </serviceBehaviors>
        </behaviors>
    </system.serviceModel>
 

    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
    </system.webServer>
</configuration>
 
Can any body tell me how can i resolve it?
 
thanks in advance.
Posted 18-Jan-13 5:38am

1 solution

Rate this: bad
good
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:
 
<system.serviceModel>
  <services>
    <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"/>
    </service>
  </services>
  <behaviors>
    <serviceBehaviors>
      <behavior name="ClientProcessadorEventos">
        <serviceMetadata httpGetEnabled="true"/>
      </behavior>
    </serviceBehaviors>
  </behaviors>
</system.serviceModel>
 
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.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 371
1 Sergey Alexandrovich Kryukov 269
2 CB Sharma 79
3 RyanDev 75
4 PhilLenoir 70
0 Sergey Alexandrovich Kryukov 6,676
1 OriginalGriff 6,056
2 CPallini 2,473
3 Richard MacCutchan 1,697
4 Abhinav S 1,560


Advertise | Privacy | Mobile
Web03 | 2.8.140821.2 | Last Updated 18 Jan 2013
Copyright © CodeProject, 1999-2014
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