Posting big JSON for my WCF service returns an invalid request?

I have a WCF service that accepts a JSON String Entity, and this is a method:

UPDATE: I solved the problem because it was not related to the WCF service, but with the GSON formatting, which I use because it does not form a special character such as β€œΓΉβ€, and the server refuses to accept this character.

<WebInvoke(UriTemplate:="UpdateUser", ResponseFormat:=WebMessageFormat.Json, RequestFormat:=WebMessageFormat.Json, Method:="POST", BodyStyle:=WebMessageBodyStyle.WrappedRequest)> _ Public Function UpdateUser(user As String) As Stream Implements IService1.UpdateUser End Function 

If I try to publish a JAVA HttpClient JSON line with the code below and with a short JSON line, everything will work fine, but if the JSON line size is larger, then IIS 7.5 response with:

-MODULE_SET_RESPONSE_ERROR_STATUS ModuleName ManagedPipelineHandler Notification 128 HttpStatus 400 Invalid request HttpReason HttpSubStatus 0 ErrorCode 0 ConfigExceptionInfo notification EXECUTE_REQUEST_HANDLER Operazione completata error code. (0x0)

I already tried with the settings of MaxReceivedMessageSize and other parameters in Web.Config, but to no avail.

This is my Web.Config file

  <services> <service name="WBVoice4Facebook.Service1" behaviorConfiguration="ServiceBehaviour"> <endpoint address="" binding="webHttpBinding" bindingConfiguration="StreamedRequestWebBinding" contract="WBVoice4Facebook.IService1" behaviorConfiguration="web"> </endpoint> </service> </services> <behaviors> <serviceBehaviors> <behavior name="ServiceBehaviour"> <dataContractSerializer maxItemsInObjectGraph="2147483646"/> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> <behavior name=""> <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> </serviceBehaviors> <endpointBehaviors> <behavior name="web"> <dataContractSerializer maxItemsInObjectGraph="2147483646" /> <webHttp /> </behavior> </endpointBehaviors> </behaviors> <bindings> <netMsmqBinding> <binding name="NewBinding0"> <security> <transport msmqAuthenticationMode="None" msmqProtectionLevel="None" /> </security> </binding> </netMsmqBinding> <webHttpBinding> <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"> <readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" /> <security mode="TransportCredentialOnly"> <transport clientCredentialType="InheritedFromHost" /> </security> </binding> </webHttpBinding> </bindings> 
+4
source share
1 answer

There is also a limit to asp.net runtime. More here

0
source

All Articles