解决WCF错误:元数据发布此服务目前已禁用目前、错误、数据、WCF

由网友(浅笑丷梨花落゛)分享简介:我要发布自定义绑定配置一个web服务。我使用的是自定义的绑定配置,增加65536个字节的默认邮件大小。我遇到的问题是,当我使用web.config设置如下图所示,我得到一个错误:I want to publish a Webservice with custom binding configuration. I am...

我要发布自定义绑定配置一个web服务。我使用的是自定义的绑定配置,增加65536个字节的默认邮件大小。我遇到的问题是,当我使用web.config设置如下图所示,我得到一个错误:

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>

推荐答案

我继续我的研究,并按照本文它解决了我的问题:

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.

阅读全文

相关推荐

最新文章