WCF サービスが処理できる要求の最大サイズは、WCF バインディングの MaxReceivedMessageSize プロパティによって制御されます。デフォルト値は 65536 で、これを超えると 400 応答コードが返されます。
サービスをホストする Web サイトの web.config で、セクションに次のノードを追加します。
<system.serviceModel>
<services>
<!-- The name of the service -->
<service name="NorthwindService">
<!-- you can leave the address blank or specify your end point URI -->
<endpoint address ="YourServiceEndpoint"
binding="webHttpBinding" bindingConfiguration="higherMessageSize"
contract ="System.Data.Services.IRequestHandler">
</endpoint>
</service>
</services>
<bindings>
<webHttpBinding>
<!-- configure the maxReceivedMessageSize value to suit the max size of
the request ( in bytes ) you want the service to recieve-->
<binding name="higherMessageSize" maxReceivedMessageSize ="MaxMessageSize"/>
</webHttpBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
</system.serviceModel>
IIS でホストされている場合、ASP.Net 要求サイズの制限により、大きな要求が拒否される可能性もあります。HttpRuntimeSection.MaxRequestLength プロパティを設定する必要があります。
<system.web>
<httpRuntime MaxRequestLength="ValueInKiloBytes" />
</system.web>
WCF が、HTTP レベルで表示されていないカバーの下で例外をスローしているかどうかを特定します。サーバー側で WCF トレースを構成して、WCF レイヤーから必要な情報をログに記録できます。トレースをセットアップし、失敗を再現したら、ログにこれらの例外メッセージのいずれかまたは両方が含まれているかどうかを確認します。
System.ServiceModel.ProtocolException
"The maximum message size quota for incoming messages (65536) has been exceeded.
To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element."
System.Web.HttpException
"Maximum request length exceeded."
ログにこのメッセージが含まれている場合は、エラーの原因がメッセージ サイズであることを確認し、それに応じてこの修正を適用してください。
PD:フォームは"POST"
メソッドを使用する必要があることに注意してください。