Problem getting very large JSON in WebService RestFul

0

We work here on the company with Android + WebService (.Net RestFul) for data communication.

We are getting the data in JSON format in a method, below:

//Método
public Retorno MetodoA(string sConexao, string sBanco, string sImeiDispositivo, List<Entidade> sJSON)

//Contrato
[OperationContract]
        [WebInvoke(UriTemplate = "/MetodoA/{sConexao}/{sBanco}/{sImeiDispositivo}",
            Method = "POST",
            BodyStyle = WebMessageBodyStyle.Bare,
            RequestFormat = WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json)]
        Retorno MetodoA(string sConexao, string sBanco, string sImeiDispositivo, List<Entidade> sJSON);

So far it was working normally, but we sent a very large JSON, and started to make an error that we could not find the solution yet.

I think the problem is in web.config, but I do not know what exactly. I have in my WebService a place where I am passing the maximum value and Buffer for sending and receiving.

<system.serviceModel>
    <!-- AQUI -->
    <bindings>
      <!-- pick whichever binding you want .... -->
      <webHttpBinding>
        <!-- binding configuration with a name -->
        <binding name="ExtendedMaxSize" maxBufferSize="2000000" maxReceivedMessageSize="2000000"/>
      </webHttpBinding>
    </bindings>

This is the error that returns:

  

The server encountered an error while processing the request. See the server logs for more details.

But this error only happens when the JSON data is too large.

What can it be?

    
asked by anonymous 20.01.2015 / 12:16

1 answer

1

Putting this code below into my web.config, I was able to see that it was a field that was with a different type than received. I changed it and it worked.

<serviceDebug includeExceptionDetailInFaults="true"/> 
    
20.01.2015 / 16:39