1

I need to create web service in java (for generating reports) that receives a String with JSON format for the tables' information. May be will be a large amount of characters but I don't know for sure if this will have trouble at moment to receive them.

Are there restrictions about the size of String parameter in the method? Or if you have any suggestion about json or something else I'll be grateful. Thanks.

Shriroop
  • 1,174
  • 2
  • 16
  • 28

1 Answers1

0

Your concern has very little to do with web services and a lot to do with how a String is stored in Java. Java uses a char[] to back a String object. Since array elements are accessed with integer values, there can be as many elements as the max value of Integer, which is (2^31)-1 or 2147483647.

In other words, you can, theoretically, your String value could use up to 2147483647 char values to be represented.

If your web service is going over HTTP, you will want to read any restrictions the HTTP specification might have the size of content, header values, and URLs.

Sotirios Delimanolis
  • 274,122
  • 60
  • 696
  • 724
  • thanks for your answer, i think that read something about 65.536 bytes in a method (http://stackoverflow.com/questions/5908436/reached-the-65536-bytes-limit) and others, and see something in google about the http...i'll read it, thank you! – rockybalboa Nov 17 '13 at 23:57