Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Solve WCF Error: Metadata publishing for this service is currently disabled

I want to publish a Webservice with custom binding configuration. I am using a custom binding configuration to increase the default message size of 65536 bytes. The problem I am having is that when I use the web.config settings as shown below, I am getting an error:

Metadata publishing for this service is currently disabled.

My Main goal is to be able to increase the default message size, therefore any other config is welcome, however I was trying to keep it as simple as possible to avoid further issues.

Can you please spot what is wrong with my configuration?

<bindings>
  <basicHttpBinding>        
      <binding name="NewBinding0" closeTimeout="00:10:00" openTimeout="01:10:00"
     receiveTimeout="01:10:00" sendTimeout="01:10:00" maxBufferSize="99536"
     maxBufferPoolSize="5242880" maxReceivedMessageSize="99536">
        <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
          maxArrayLength="99536" maxBytesPerRead="99536" maxNameTableCharCount="2147483647" />
        <security>
          <transport clientCredentialType="Basic" />
        </security>

    </binding>
  </basicHttpBinding>
</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior name="MeterReadingOrderWSBehaviors">
      <serviceMetadata httpsGetEnabled="true" />         
    </behavior>
    </serviceBehaviors>

</behaviors>
<services>
  <service name="MeterReadingOrderWS.IMeterReadingOrderWS" behaviorConfiguration="MeterReadingOrderWSBehaviors">
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:3440/MeterReadingOrderWS.svc"/> 
      </baseAddresses>
    </host>
    <endpoint address="" contract="MeterReadingOrderWS.IMeterReadingOrderWS" binding="basicHttpBinding" bindingConfiguration="NewBinding0" />
    <endpoint address="mex" contract="IMetadataExchange" binding="mexHttpsBinding" />
  </service>
</services>

like image 558
Adrian Hedley Avatar asked Jun 09 '11 08:06

Adrian Hedley


2 Answers

I have continued my research and followed this article which solved my problem:

http://keithelder.net/2008/01/17/exposing-a-wcf-service-with-multiple-bindings-and-endpoints/

Hope it can help others as well.

like image 62
Adrian Hedley Avatar answered Nov 15 '22 10:11

Adrian Hedley


Note that your problem is seems to be related with Metadata behaviour, before that you have to check name of service i.e.WebApplication1.MyService in below code; this should be in same order namespace.service

    <endpoint  address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="MyServiceBebavior">
      <serviceMetadata  httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<!--<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />-->

like image 39
manoj prajapati Avatar answered Nov 15 '22 08:11

manoj prajapati