从 silverlight 通过 wcf 发送图像时出现问题
Silverlight 将 WCF 与 basicHttpBinding 一起使用,
<basicHttpBinding>
<binding name="BasicHttpBinding_BugsService"
maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="None"/>
</binding>
</basicHttpBinding>
我将图像作为 byte[]
发送,只要图像小于 20KB,它就可以工作,
但当图像更大时,我会收到错误:
远程服务器返回错误:NotFound
in the Reference.cs
public bool EndSave(System.IAsyncResult result)
{
object[] _args = new object[0];
bool _result = ((bool)(base.EndInvoke("Save", _args, result))); // error
return _result;
}
Silverlight uses WCF with basicHttpBinding
<basicHttpBinding>
<binding name="BasicHttpBinding_BugsService"
maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="None"/>
</binding>
</basicHttpBinding>
I send the image as an byte[]
, and it's working as long as the image has less than 20KB
but when it's bigger i get the error:
The remote server returned an error: NotFound
in the Reference.cs
public bool EndSave(System.IAsyncResult result)
{
object[] _args = new object[0];
bool _result = ((bool)(base.EndInvoke("Save", _args, result))); // error
return _result;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请捕获接口实现中wcf端的异常并将其发布。
该错误可能与此问题有关:
"WCF 消息大小问题< /a>”
Please catch the exception on the wcf side in the interface implementation and post that.
The error may be related to this problem:
"WCF Message Size Issue"
检查绑定配置上的“maxReceivedMessageSize”属性(表示大小(以字节为单位))。 如果您的数据超过该大小,该消息将被丢弃。
Check the "maxReceivedMessageSize" property (representing the size in bytes) on the binding configuration. If your data exceeds that size, the message is discarded.