Author: veithen
Date: Sun Dec 19 12:01:45 2010
New Revision: 1050819

URL: http://svn.apache.org/viewvc?rev=1050819&view=rev
Log:
AXIS2-4586: Applied the patch provided by Anuj Bhatia.

Modified:
    
axis/axis2/java/core/trunk/modules/jibx/src/org/apache/axis2/jibx/template/JibXDatabindingTemplate.xsl

Modified: 
axis/axis2/java/core/trunk/modules/jibx/src/org/apache/axis2/jibx/template/JibXDatabindingTemplate.xsl
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jibx/src/org/apache/axis2/jibx/template/JibXDatabindingTemplate.xsl?rev=1050819&r1=1050818&r2=1050819&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/jibx/src/org/apache/axis2/jibx/template/JibXDatabindingTemplate.xsl
 (original)
+++ 
axis/axis2/java/core/trunk/modules/jibx/src/org/apache/axis2/jibx/template/JibXDatabindingTemplate.xsl
 Sun Dec 19 12:01:45 2010
@@ -404,6 +404,8 @@
     <!-- Simple parameter values (those with serializers) can be handled by
       direct conversion to elements. Complex parameter values need to use data
       sources. This code handles both types. -->
+            // create message context
+            final org.apache.axis2.context.MessageContext _messageContext = 
new org.apache.axis2.context.MessageContext();
             try {
                 int _opIndex = <xsl:apply-templates mode="get-index" 
select="/class/meth...@name=$method-name]"></xsl:apply-templates>;
                 javax.xml.namespace.QName opname = 
_operations[_opIndex].getName();
@@ -431,8 +433,7 @@
                 // add SOAP headers
                 _serviceClient.addHeadersToEnvelope(env);
                 
-                // create message context with that envelope
-                org.apache.axis2.context.MessageContext _messageContext = new 
org.apache.axis2.context.MessageContext();
+                // set that envelope on the message context
                 _messageContext.setEnvelope(env);
     
                 // add the message context to the operation client
@@ -467,6 +468,8 @@
                 // should never happen, but just in case
                 throw new RuntimeException("Unexpected exception type: " +
                     outex.getClass().getName(), outex);
+            } finally {
+                
_messageContext.getTransportOut().getSender().cleanup(_messageContext);
             }
         }
     </xsl:if>
@@ -487,6 +490,12 @@
                             }
                         } catch (Exception e) {
                             onError(e);
+                        } finally {
+                            try {
+                                
_messageContext.getTransportOut().getSender().cleanup(_messageContext);
+                            } catch (org.apache.axis2.AxisFault axisFault) {
+                                onError(axisFault);
+                            }   
                         }
                     }
 


Reply via email to