File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
modules/kernel/src/org/apache/axis2/kernel Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 4141import org .apache .axis2 .context .MessageContext ;
4242import org .apache .axis2 .context .OperationContext ;
4343import org .apache .axis2 .deployment .DeploymentConstants ;
44+ import org .apache .axis2 .description .AxisService ;
4445import org .apache .axis2 .description .Parameter ;
4546import org .apache .axis2 .i18n .Messages ;
4647import org .apache .axis2 .kernel .http .HTTPConstants ;
@@ -508,6 +509,18 @@ public static void deleteAttachments(MessageContext msgContext) {
508509 log .debug ("Entering deleteAttachments()" );
509510 }
510511
512+ // Check if enableJSONOnly is true - if so, skip attachment cleanup to avoid loading Axiom
513+ AxisService axisService = msgContext .getAxisService ();
514+ if (axisService != null ) {
515+ String enableJSONOnly = (String ) axisService .getParameterValue ("enableJSONOnly" );
516+ if (enableJSONOnly != null && enableJSONOnly .equalsIgnoreCase ("true" )) {
517+ if (log .isDebugEnabled ()) {
518+ log .debug ("Skipping deleteAttachments() due to enableJSONOnly=true" );
519+ }
520+ return ;
521+ }
522+ }
523+
511524 Attachments attachments = msgContext .getAttachmentMap ();
512525
513526 if (attachments != null ) {
You can’t perform that action at this time.
0 commit comments