我有两个服务,并且在它们之间发送相当大的消息(~100kb)。尽管前面提到的值是消息大小的典型值,但它可能会大幅波动(正向和负向)。
因此,为了处理我必须传输膨胀消息的情况,我在客户端和服务器端的 app.config 中调高了所有最大消息大小、最大字符串大小等属性(相关端点正确引用了绑定)其中规定了尺寸)。
为了安全起见,我设置的界限完全超出了任何可能的消息大小。然而,当服务间通信在消息大小规模的较低端被证明是可靠的时,在较高端则并非如此——消息似乎根本没有被传递。
最奇怪的是if消息超出了最大大小,然后会抛出异常(我遇到过足够多的异常,知道这一点!哈哈),但没有抛出任何异常 - 这一切都完全安静地过去。我已经尝试过各种大小的消息,并且它肯定只会随着消息大小的增长而开始发生。我可以证明目标服务没有接收到,因为在接收时,该服务会在数据库中生成日志 - 但对于大消息,不会生成日志。
正如我所说,我几乎可以肯定我已经增加了 app.config 中所有适用属性的大小,因此我对这种行为完全感到困惑!
关于什么可能导致这种神秘行为有什么建议吗?
好吧,这个问题似乎已经解决了(突然之间,在之前从未抱怨过之后,WCF 开始对 app.config 中的某个值感到不安,改变了它,然后它似乎就起作用了!)
但是现在我有一个同样奇怪的问题!由于某种原因,它拒绝接受我已配置要发布的元数据。我的 app.config (主机端)设置如下:
<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“。任何帮助都会greatly赞赏。
Cheers!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)