Large WCF web service request failing with (400) HTTP Bad Request

后端 未结 9 1647
隐瞒了意图╮
隐瞒了意图╮ 2020-11-28 03:30

I\'ve encountered this apparently common problem and have been unable to resolve it.

If I call my WCF web service with a relatively small number of items in

9条回答
  •  星月不相逢
    2020-11-28 04:04

    Try setting maxReceivedMessageSize on the server too, e.g. to 4MB:

        
    

    The main reason the default (65535 I believe) is so low is to reduce the risk of Denial of Service (DoS) attacks. You need to set it bigger than the maximum request size on the server, and the maximum response size on the client. If you're in an Intranet environment, the risk of DoS attacks is probably low, so it's probably safe to use a value much higher than you expect to need.

    By the way a couple of tips for troubleshooting problems connecting to WCF services:

    • Enable tracing on the server as described in this MSDN article.

    • Use an HTTP debugging tool such as Fiddler on the client to inspect the HTTP traffic.

提交回复
热议问题