【问题标题】:WCF service in Windows Phone 8.1Windows Phone 8.1 中的 WCF 服务
【发布时间】:2014-09-18 23:17:09
【问题描述】:

我在 Windows Phone 8.1 中调用 WCF 服务,有一个服务正在返回大量数据,这就是我收到异常的原因。

"System.ServiceModel.CommunicationException".

内部异常

"Remote server not found"

我真的卡住了,怎么办?我还增加了“web.config”中的超时时间

openTimeout="00:10:00" closeTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="00:10:00"

但没有得到结果。如果结果中有少量数据,则给出结果。任何帮助将不胜感激。

【问题讨论】:

  • 您能否发布您的 WCF 服务代码以及客户端和服务器端点配置。根据您提供的信息,很难确定是什么原因。

标签: c# windows-phone-8.1


【解决方案1】:

听起来好像找不到您的 WCF 服务。但是你说它确实适用于少量数据。我会尝试更改显示的 MaxMessageSize 属性here

在您的 wcf 服务的 web.config 中添加:

<bindings>
    <basicHttpBinding>
        <binding name="basicHttp" allowCookies="true"
                 maxReceivedMessageSize="20000000" 
                 maxBufferSize="20000000"
                 maxBufferPoolSize="20000000">
            <readerQuotas maxDepth="32" 
                 maxArrayLength="200000000"
                 maxStringContentLength="200000000"/>
        </binding>
    </basicHttpBinding>
</bindings>

到绑定

【讨论】:

  • user1,谢谢老哥的回复,我也添加了,但没有成功。请给我建议。
  • 您的服务中是否包含异常?即将&lt;serviceDebug includeExceptionDetailInFaults="true" /&gt; 添加到 web.config?然后我会看看你的异常中是否有更多细节
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-05-09
  • 1970-01-01
相关资源
最近更新 更多