This is an automated email from the ASF dual-hosted git repository.

robertlazarski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/axis-axis2-java-core.git


The following commit(s) were added to refs/heads/master by this push:
     new a8fa7a2977 Add another unit test to prevent axiom loading with 
enableJSONOnly=true
a8fa7a2977 is described below

commit a8fa7a297788e2ed2acb45bb140c7a7c3f35914b
Author: Robert Lazarski <[email protected]>
AuthorDate: Mon Nov 24 12:53:47 2025 -1000

    Add another unit test to prevent axiom loading with enableJSONOnly=true
---
 .../kernel/src/org/apache/axis2/kernel/TransportUtils.java  | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/modules/kernel/src/org/apache/axis2/kernel/TransportUtils.java 
b/modules/kernel/src/org/apache/axis2/kernel/TransportUtils.java
index 42452e0667..8b0fd0dab2 100644
--- a/modules/kernel/src/org/apache/axis2/kernel/TransportUtils.java
+++ b/modules/kernel/src/org/apache/axis2/kernel/TransportUtils.java
@@ -41,6 +41,7 @@ import org.apache.axis2.builder.BuilderUtil;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.deployment.DeploymentConstants;
+import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.Parameter;
 import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.kernel.http.HTTPConstants;
@@ -508,6 +509,18 @@ public class TransportUtils {
             log.debug("Entering deleteAttachments()");
         }
 
+        // Check if enableJSONOnly is true - if so, skip attachment cleanup to 
avoid loading Axiom
+        AxisService axisService = msgContext.getAxisService();
+        if (axisService != null) {
+            String enableJSONOnly = (String) 
axisService.getParameterValue("enableJSONOnly");
+            if (enableJSONOnly != null && 
enableJSONOnly.equalsIgnoreCase("true")) {
+                if (log.isDebugEnabled()) {
+                    log.debug("Skipping deleteAttachments() due to 
enableJSONOnly=true");
+                }
+                return;
+            }
+        }
+
         Attachments attachments = msgContext.getAttachmentMap();
 
         if (attachments != null) {

Reply via email to