每当我连我的客户端将数据发送到我的WCF Azure的服务,我得到这个错误:maxReceivedMessageSize在Azure WCF服务太小
“的最大邮件大小配额传入消息(65536)已超出。要增加配额 ,请在适当的绑定 元素上使用MaxReceivedMessageSize属性。“
我读过无处不在关于在客户端和服务器配置文件上设置MaxReceivedMessageSize属性。我已经做到了。
但是,每当我更新客户端服务引用,它拉的设置恢复到65536默认(通过调查.svcinfo文件中)
这使我得出结论的问题,必须在服务方面。
我放在这在我的web.config文件:
<bindings>
<basicHttpBinding>
<!--The basicHttpBinding is used for clients which use the generated code to transmit data; the following settings make it possible to send larger amounts to the service-->
<binding maxReceivedMessageSize="10000000" receiveTimeout="01:00:00">
<readerQuotas maxStringContentLength="10000000" />
</binding>
</basicHttpBinding>
</bindings>
现在,很多帖子谈论命名绑定并在服务器端设置它在服务端点为好。这样的事情:
<services>
<service name="YourNamespace.YourServiceClass">
<endpoint name="endpoint1"
address="http://server:8888/YourService.svc"
binding="basicHttpBinding"
bindingConfiguration="lageMessageTransfer"
contract="IYourServiceContract" />
</service>
</services>
但是,我没有这些服务端点,我的服务很适合小尺寸。
这需要设置在哪里?
编辑:
更多信息,蒂姆似乎是在正确的轨道与默认端点上。我正在使用默认端点。看起来你不能明确地为该默认端点定义一个服务。或者如果可以的话,我必须做的不正确。
但是,您似乎可以按照Richard的说法修改默认端点上的绑定。这是通过简单地不指定绑定的名称来完成的。我尝试将服务中的值设置为更低的值,以查看是否有其他值正在降低它们,但它们完全被忽略。它就好像默认端点简单地忽略了我创建的绑定。
在我的整个配置文件:为什么没有被拾起新的绑定设置
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
<listeners>
<add name="sdt" type="System.Diagnostics.XmlWriterTraceListener" initializeData="logging.e2e" />
</listeners>
</source>
</sources>
</system.diagnostics>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding maxReceivedMessageSize="100" maxBufferSize="100" receiveTimeout="00:11:00">
<readerQuotas maxStringContentLength="100" />
</binding>
</basicHttpBinding>
</bindings>
<protocolMapping>
<add scheme="http" binding="basicHttpBinding" />
</protocolMapping>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="false" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
<connectionStrings><EDITEDOUT></connectionStrings>
</configuration>
的思考?
不幸的是,据我所知,如果你不能修改服务的配置,就会陷入困境。如果您绝对无法修改服务的配置,则需要采取措施确保您的有效负载小于65536字节的最大值。 – GunnerL3510 2011-06-17 01:54:04
我可以修改服务器的配置,但是它不会选择新的设置。 – Jared 2011-06-17 22:50:54