【问题标题】:problem when sending images through wcf from silverlight从 silverlight 通过 wcf 发送图像时出现问题
【发布时间】:2010-11-04 05:37:17
【问题描述】:

Silverlight 将 WCF 与 basicHttpBinding

结合使用
<basicHttpBinding>              
    <binding name="BasicHttpBinding_BugsService" 
             maxBufferSize="2147483647" 
             maxReceivedMessageSize="2147483647">                  
       <security mode="None"/>
    </binding>              
</basicHttpBinding>

我以byte[] 发送图像,只要图像小于 20KB,它就可以工作

但是当它变大时我得到错误:

远程服务器返回错误:NotFound

在 Reference.cs 中

public bool EndSave(System.IAsyncResult result) 
{
    object[] _args = new object[0];
    bool _result = ((bool)(base.EndInvoke("Save", _args, result))); // error
    return _result;
}

【问题讨论】:

    标签: wcf silverlight image upload send


    【解决方案1】:

    请在接口实现中捕获 wcf 端的异常并发布。

    错误可能与这个问题有关: "WCF Message Size Issue"

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        猜你喜欢
        • 2011-07-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-10-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多