wcf 返回图片_上载大图像时WCF服务错误-远程服务器返回意外响应:(413)请求实体太大...

I googled quite a lot about this issue. Got many a solutions but none worked for me. I trying to upload an image file using WCF service. Small images get uploaded fine but once the size increase it gives out errors. Here is the error i'm getting

the remote server returned an unexpected response: (413) request entity too large

and here is my web.config(i believe its something to do with the web.config)

Service contract :

[OperationContract]

[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]

ResponseBase SaveAlertSettings(AlertSettingInfo alertSettingInfo);

AlertSettingInfo.fileToUpload has base64string which is first converted to stream and then written to server as an image file. It works fine for small size image file. Throws error for larger file like 4 mb images files.

Talk1:

Can you show us your service contract?

Talk2:

updated

Talk3:

Thanks. So, SaveAlertSettings() uploads images? Maybe show us AlertSettingInfo too please if so

Talk4:

updated

Solutions1

Binding must be added for webHttpBinding

Talk1:

Limits must be added to both service and client configurations. If your service isn't configured to handle large size or if you don't have control over it then you can't do anything about it. stackoverflow.com/questions/16265725/…

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值