您的位置:首页 > 其它

Silverlight + WCF错误“The remote server returned an error: NotFound.”的解决方法

2009-10-08 06:38 525 查看
今天在项目中发送数据包到服务器端,WCF返回错误信息:The remote server returned an error: NotFound. 经过排查,通过以下步骤进行了解决。

Silverlight企业级项目中,经常要发送大量数据包到服务器端,而WCF服务本身对数据包进行了限制,最大不能超过65535,而我在项目中尝试发送XML大数据包到服务器端,WCF返回以上错误。

起初考试在客户端尝试重新定义BasicHttpBinding对象

1 Dim binding As BasicHttpBinding = New BasicHttpBinding()

2

3 binding.MaxBufferSize = 2147483647

4 binding.MaxReceivedMessageSize = 2147483647

5
然后考虑修改ServiceReferences.ClientConfig文件,增加Buffer 尺寸。

Code

<?xml version="1.0" encoding="utf-8" ?>

<access-policy>

<cross-domain-access>

<policy>

<allow-from http-request-headers="*">

<domain uri="http://*"/>

</allow-from>

<grant-to>

<resource path="/" include-subpaths="true"/>

</grant-to>

</policy>

</cross-domain-access>

</access-policy

希望能够帮助到大家。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐