简体   繁体   中英

problem when sending images through wcf from silverlight

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;
}

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 "

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM