首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >wcf最大消息大小

wcf最大消息大小
EN

Stack Overflow用户
提问于 2008-12-15 17:34:51
回答 3查看 13.1K关注 0票数 2

我有两个服务,并且在它们之间发送相当大的消息(~100 am )。尽管前面提到的值是消息大小的典型值,但它有可能在很大程度上波动(无论是正的还是负的)。

因此,为了处理必须传输膨胀的消息的情况,我在客户机和服务器端(相关端点正确引用了声明大小的绑定)中的app.config中的所有最大消息大小、最大字符串大小等属性进行了扩展。

为了安全起见,我所放置的绑定完全超过了任何可能的消息大小。但是,如果服务间通信在消息大小的较低端证明是可靠的,那么在更高的端则不是这样--消息似乎根本不被传递。

最奇怪的是,如果消息超过了最大值,那么就会抛出一个异常(我已经遇到了足够多的异常,我已经知道了!)但是什么都不会被抛出--一切都会悄无声息地过去。我对各种大小的消息进行了实验,这肯定只是随着消息大小的增长而开始发生的。我可以证明目的地服务没有接收到,因为在接收到服务时,服务会在DB中记录--但是使用大消息,就不会生成日志。

正如我所说的,我几乎肯定我已经增加了app.config中所有适用属性的大小,所以我对这种行为感到完全和彻底的困惑!

对于是什么导致这种令人困惑的行为,有什么建议吗?

EN

回答 3

Stack Overflow用户

发布于 2008-12-17 10:25:49

这个问题似乎已经解决了(在以前从未抱怨过之后,WCF突然开始对app.config中的某个值感到不安,并改变了这一点,那时它似乎起作用了!)

然而,现在我有一个同样奇怪的问题!出于某些原因,它拒绝接受我已经配置了要发布的元数据。我的app.config (主机端)设置如下:

代码语言:javascript
运行
复制
<services>
  <service name="DataFeederService.FeederService" behaviorConfiguration="DataFeederService.FeederServiceBehavior">
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8010/Feeder"/>
        <add baseAddress="net.pipe://localhost/FeederPipe"/>
      </baseAddresses>
    </host>
    <!-- Service Endpoints -->
    <!-- Unless fully qualified, address is relative to base address supplied above -->
    <endpoint name="namedPipeEndpoint" 
    address=""  
    bindingConfiguration="IPCWindowsSecurity" 
    binding="netNamedPipeBinding" 
    contract="DataFeederService.IFeederService">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>

    <endpoint name="httpEndpoint" 
    address="FeederService" 
    binding="wsHttpBinding" 
    bindingConfiguration="httpBinding" 
    contract="DataFeederService.IWebFeederService"/>

    <!-- Metadata Endpoints -->
    <!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. -->
    <!-- This endpoint does not use a secure binding and should be secured or removed before deployment -->
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
  </service>
</services>

<bindings>
  <netNamedPipeBinding>
    <binding name="IPCWindowsSecurity" 
    maxBufferPoolSize="965536" 
    maxBufferSize="965536" 
    maxReceivedMessageSize="965536">
      <readerQuotas maxStringContentLength="965536" />
      <security mode="Transport">
        <transport protectionLevel="EncryptAndSign" />
      </security>
    </binding>
  </netNamedPipeBinding>
  <wsHttpBinding>
    <binding name="httpBinding" 
    maxBufferPoolSize="965536"
    maxReceivedMessageSize="965536">
      <readerQuotas maxStringContentLength="965536" />
    </binding>
  </wsHttpBinding>
</bindings>

<behaviors>
  <serviceBehaviors>
    <behavior name="DataFeederService.FeederServiceBehavior">
      <!-- To avoid disclosing metadata information, 
      set the value below to false and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="True" policyVersion="Policy15"/>
      <!-- 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="True" httpHelpPageEnabled="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>

我已经尽力找出了为什么它会声称元数据没有在指定的地址"http://localhost:8010/Feeder/mex“上发布。任何帮助都将是非常感谢的

干杯!

票数 1
EN

Stack Overflow用户

发布于 2008-12-17 11:17:14

对不起,伙计们,经过进一步的拖网捕捞,我发现了错误的根源!数据域中的一个类已被更改( datacontract属性已被删除,但奇怪的是,DataMemeber被保留在相关属性上!)很奇怪!)

不管怎么说,谢谢你的帮助,尤其是你让我到了这个地步,我终于可以在这个该死的项目上洗手了:)

票数 1
EN

Stack Overflow用户

发布于 2008-12-16 12:46:29

WCF中存在一些可能导致其“静默”(即没有例外)失败的局部问题,这是很难调试的。听起来这可能就是你看到的情况。

在这种情况下,WCF中的启用跟踪选项可能非常有用,因为它应该允许您查看消息是否确实到达服务以及调度程序如何处理它。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/369132

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档