gpt4 book ai didi

wpf - WCF:单向回调有问题

转载 作者:行者123 更新时间:2023-12-04 14:19:18 25 4
gpt4 key购买 nike

在从 WCF 服务调用 WPF 客户端的单向回调时,我不断收到这个令人费解的错误。

The message could not be transferred within the allotted timeout of 00:01:00. There was no space available in the reliable channel's transfer window. The time allotted to this operation may have been a portion of a longer timeout.



它不会发送太多数据,只是一个字符串列表,其中只有一个短字符串。

我的服务器有以下配置:
<xml version="1.0"?>
<configuration>

<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<services>
<service name="RawDealService.GameService">
<endpoint address ="" binding="wsDualHttpBinding" bindingConfiguration="basicConfig" contract="MyService.IGameService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
</service>
</services>
<bindings>
<wsDualHttpBinding>
<binding name="basicConfig" messageEncoding="Text">
<security mode="None"/>
</binding>
</wsDualHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- 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"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>

</configuration>

我的客户有以下配置:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_IGameService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" />
<security mode="None">
<message clientCredentialType="Windows" negotiateServiceCredential="true" />
</security>
</binding>
</wsDualHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:44259/GameService.svc" binding="wsDualHttpBinding"
bindingConfiguration="WSDualHttpBinding_IGameService" contract="IGameService"
name="WSDualHttpBinding_IGameService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>

<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
</startup>
</configuration>

考虑到消息相对较小并且回调只是单向的,这可能会发生,这只是令人困惑。我应该尝试一些不同的绑定(bind)吗?

最佳答案

我发现了这个问题,不幸的是,这个特定的错误消息让我走上了一条完全错误的道路。

我的 DataContract 设置中有一些具有继承的类,我没有正确标记 KnownType s。

我的猜测是在某些时候客户端试图反序列化关联的对象并失败。框架一定没有很好地处理错误,也许它一直试图一遍又一遍地发送,一分钟后没有得到响应。

也许如果我有一个双向调用,我会得到更多信息的堆栈跟踪。

关于wpf - WCF:单向回调有问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4273195/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com