I am using Apache HttpClient for connecting having a WS. All works fine however when the applying attempt to send a publish having a large size it brokes.

I am unsing HttpClint such as this:

  • Carrying out a publish of the XML to some Relaxation WS
  • This publish is definitely an String, the string is definitely an object planned as XML.
  • I am using UrlEncodedFormEntity to pass through the xml parameter towards the url

Once the HttpClient send the contetn, in the WS side, the parameter using the XML is empty. I cheked the once the xml is distributed and it is ok, I am talking about the XML is properly produced.

If how big the xml is more compact, it works fine. It's behavor is much like if HttpClient includes a limit size for publish or even the UrlEncodedFormEntity does.

any idea? Thanks.

If you're posting an XML file, you shouldn't use UrlEncodedFormEntity, you need to use FileEntity using the XML file. By doing this you are able to steer clear of the UrlEncodedFormEntity limit.

UrlEncodedFormEntity doesn't impose any limit around the content length, however, many HTTP servers really do, as 'application/x-www-form-urlencoded' content usually will get buffered in memory around the server side.

Just help, the answer was easy: The limitation is at the Tomcat becouse automatically the maxPostSize parameter is 2MB (I am talking about if it's not present in the connector tag in server.xml), and so i transformed it to 15Mb. I locate the tag connector with protocol HTTP and added the attribute maxPortSize="15728640" for !5Mb and delay pills work ok!!!!