From 538513cda99acf5d5b68ed7ac2a88933dec64f07 Mon Sep 17 00:00:00 2001 From: Arunan Sugunakumar Date: Tue, 20 Feb 2024 16:23:32 +0530 Subject: [PATCH] Fix import for SOAP11Factory in DeferredMessageBuilder Resolves wso2/micro-integrator#3117 When org.apache.axiom.soap.impl.dom.soap11.SOAP11Factory is used, the Envelope type is different from other normal usecases. --- .../transport/passthru/util/DeferredMessageBuilder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/DeferredMessageBuilder.java b/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/DeferredMessageBuilder.java index 820b0939da..08e0c7e30a 100644 --- a/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/DeferredMessageBuilder.java +++ b/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/util/DeferredMessageBuilder.java @@ -18,7 +18,7 @@ import org.apache.axiom.om.OMElement; import org.apache.axiom.soap.SOAPEnvelope; -import org.apache.axiom.soap.impl.dom.soap11.SOAP11Factory; +import org.apache.axiom.soap.impl.llom.soap11.SOAP11Factory; import org.apache.axis2.AxisFault; import org.apache.axis2.Constants; import org.apache.axis2.builder.*; @@ -143,7 +143,7 @@ public OMElement getDocument(MessageContext msgCtx, InputStream in) throws if (builder != null) { try { if (contentLength != null && "0".equals(contentLength) && !msgCtx.isDoingREST()) { - element = new org.apache.axiom.soap.impl.llom.soap11.SOAP11Factory().getDefaultEnvelope(); + element = new SOAP11Factory().getDefaultEnvelope(); //since we are setting an empty envelop to achieve the empty body, we have to set a different //content-type other than text/xml, application/soap+xml or any other content-type which will //invoke the soap builder, otherwise soap builder will get hit and an empty envelope