从 silverlight 通过 wcf 发送图像时出现问题

发布于 2024-07-25 03:57:05 字数 776 浏览 5 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

浅唱々樱花落 2024-08-01 03:57:05

请捕获接口实现中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"

戏剧牡丹亭 2024-08-01 03:57:05

检查绑定配置上的“maxReceivedMessageSize”属性(表示大小(以字节为单位))。 如果您的数据超过该大小,该消息将被丢弃。

Check the "maxReceivedMessageSize" property (representing the size in bytes) on the binding configuration. If your data exceeds that size, the message is discarded.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文