Class RequestSizeLimits
Those builders consume the raw InputStream rather than the servlet
parameter API, so a container-level post limit (Tomcat's maxPostSize,
for example) never sees the body and does not constrain it. Without a ceiling
here an anonymous client can size the allocation itself.
Each limit resolves through the usual Axis2 parameter chain — message,
operation, service, service group, then axis2.xml — so a deployment
that legitimately accepts large uploads can raise it for one service without
loosening the global default. A value of -1 restores the unbounded
behaviour.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long2 MB: form encoding is for field data, not bulk transfer.static final longDefaultJSON_MAX_REQUEST_SIZE: 100 MB, matching SOAP.static final longDefaultMTOM_MAX_REQUEST_SIZE: 100 MB.static final long100 MB, matching the whole-request ceiling for the single-part case.static final long100 MB: generous for document and attachment uploads, but finite.static final longDefaultSOAP_MAX_REQUEST_SIZE: 100 MB.static final StringCeiling on an application/x-www-form-urlencoded request body.static final StringCeiling on a JSON body, for every builder in the axis2-json module.static final StringCeiling on amultipart/relatedbody: MTOM and SwA.static final StringCeiling on any single part within a multipart/form-data request.static final StringCeiling on a whole multipart/form-data request.static final StringCeiling on a plain SOAP or POX body.static final longSentinel for "no ceiling", matching the commons-fileupload2 convention. -
Method Summary
Modifier and TypeMethodDescriptionstatic longresolve(MessageContext messageContext, String parameterName, long defaultValue) Resolve a size limit for the message being built.
-
Field Details
-
MULTIPART_MAX_REQUEST_SIZE
Ceiling on a whole multipart/form-data request.- See Also:
-
MULTIPART_MAX_FILE_SIZE
Ceiling on any single part within a multipart/form-data request.- See Also:
-
FORM_URLENCODED_MAX_REQUEST_SIZE
Ceiling on an application/x-www-form-urlencoded request body.- See Also:
-
DEFAULT_MULTIPART_MAX_REQUEST_SIZE
public static final long DEFAULT_MULTIPART_MAX_REQUEST_SIZE100 MB: generous for document and attachment uploads, but finite.- See Also:
-
DEFAULT_MULTIPART_MAX_FILE_SIZE
public static final long DEFAULT_MULTIPART_MAX_FILE_SIZE100 MB, matching the whole-request ceiling for the single-part case.- See Also:
-
DEFAULT_FORM_URLENCODED_MAX_REQUEST_SIZE
public static final long DEFAULT_FORM_URLENCODED_MAX_REQUEST_SIZE2 MB: form encoding is for field data, not bulk transfer.- See Also:
-
MTOM_MAX_REQUEST_SIZE
Ceiling on amultipart/relatedbody: MTOM and SwA.The same reasoning as the form builders, which is why this belongs here: the MIME builder reads the transport stream directly, so a servlet container's post-size limit never sees the body. It also means the caller picks which builder runs by choosing the Content-Type, so bounding only the form builders bounds nothing -- an attacker simply sends
multipart/related.- See Also:
-
SOAP_MAX_REQUEST_SIZE
Ceiling on a plain SOAP or POX body.- See Also:
-
DEFAULT_MTOM_MAX_REQUEST_SIZE
public static final long DEFAULT_MTOM_MAX_REQUEST_SIZEDefaultMTOM_MAX_REQUEST_SIZE: 100 MB.- See Also:
-
DEFAULT_SOAP_MAX_REQUEST_SIZE
public static final long DEFAULT_SOAP_MAX_REQUEST_SIZEDefaultSOAP_MAX_REQUEST_SIZE: 100 MB.- See Also:
-
JSON_MAX_REQUEST_SIZE
Ceiling on a JSON body, for every builder in the axis2-json module.JSON is the primary protocol, so this is the ceiling most deployments actually rely on. Streaming does not make a JSON builder safe to leave unbounded: a single string token is still materialised whole.
- See Also:
-
DEFAULT_JSON_MAX_REQUEST_SIZE
public static final long DEFAULT_JSON_MAX_REQUEST_SIZEDefaultJSON_MAX_REQUEST_SIZE: 100 MB, matching SOAP. The HTTP/2 JSON builders are tuned for payloads of 50 MB and more, so a smaller default would break the deployments they were written for.- See Also:
-
UNLIMITED
public static final long UNLIMITEDSentinel for "no ceiling", matching the commons-fileupload2 convention.- See Also:
-
-
Method Details
-
resolve
Resolve a size limit for the message being built.- Parameters:
messageContext- the message being built; null yields the defaultparameterName- one of the parameter name constants on this classdefaultValue- the limit to apply when the parameter is not set- Returns:
- the configured limit in bytes, or
UNLIMITED
-