Note that there are some explanatory texts on larger screens.

plurals
  1. POPosting large JSON to my WCF Service return bad request?
    primarykey
    data
    text
    <p>I have a WCF service that accept JSON String Entity and this is the method:</p> <p><strong>UPDATE: I solved the problem as this wasn't related to the WCF service, but to the GSON formatting that I am using because is not formating a special character like "ù" and the server refuse to accept this character.</strong></p> <pre><code> &lt;WebInvoke(UriTemplate:="UpdateUser", ResponseFormat:=WebMessageFormat.Json, RequestFormat:=WebMessageFormat.Json, Method:="POST", BodyStyle:=WebMessageBodyStyle.WrappedRequest)&gt; _ Public Function UpdateUser(user As String) As Stream Implements IService1.UpdateUser End Function </code></pre> <p>If I try to post trough JAVA HttpClient a JSON String with the code below and with short JSON string all work fine, but if the size of the JSON string is bigger, then the IIS 7.5 response with:</p> <p><strong>-MODULE_SET_RESPONSE_ERROR_STATUS ModuleName ManagedPipelineHandler Notification 128 HttpStatus 400 HttpReason Bad Request HttpSubStatus 0 ErrorCode 0 ConfigExceptionInfo Notification EXECUTE_REQUEST_HANDLER ErrorCode Operazione completata. (0x0)</strong></p> <p>I tried already with MaxReceivedMessageSize and other size settings in the Web.Config but without success.</p> <p>This is my Web.Config file</p> <pre><code> &lt;services&gt; &lt;service name="WBVoice4Facebook.Service1" behaviorConfiguration="ServiceBehaviour"&gt; &lt;endpoint address="" binding="webHttpBinding" bindingConfiguration="StreamedRequestWebBinding" contract="WBVoice4Facebook.IService1" behaviorConfiguration="web"&gt; &lt;/endpoint&gt; &lt;/service&gt; &lt;/services&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name="ServiceBehaviour"&gt; &lt;dataContractSerializer maxItemsInObjectGraph="2147483646"/&gt; &lt;serviceMetadata httpGetEnabled="true" /&gt; &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt; &lt;/behavior&gt; &lt;behavior name=""&gt; &lt;serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /&gt; &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;endpointBehaviors&gt; &lt;behavior name="web"&gt; &lt;dataContractSerializer maxItemsInObjectGraph="2147483646" /&gt; &lt;webHttp /&gt; &lt;/behavior&gt; &lt;/endpointBehaviors&gt; &lt;/behaviors&gt; &lt;bindings&gt; &lt;netMsmqBinding&gt; &lt;binding name="NewBinding0"&gt; &lt;security&gt; &lt;transport msmqAuthenticationMode="None" msmqProtectionLevel="None" /&gt; &lt;/security&gt; &lt;/binding&gt; &lt;/netMsmqBinding&gt; &lt;webHttpBinding&gt; &lt;binding name="StreamedRequestWebBinding" openTimeout="10:15:00" receiveTimeout="10:15:00" sendTimeout="10:15:00" bypassProxyOnLocal="true" hostNameComparisonMode="WeakWildcard" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" transferMode="Streamed" useDefaultWebProxy="false"&gt; &lt;readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" /&gt; &lt;security mode="TransportCredentialOnly"&gt; &lt;transport clientCredentialType="InheritedFromHost" /&gt; &lt;/security&gt; &lt;/binding&gt; &lt;/webHttpBinding&gt; &lt;/bindings&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload