axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thil...@apache.org
Subject svn commit: r439720 - in /webservices/axis2/trunk/java/modules: integration/ integration/test/org/apache/axis2/engine/ integration/test/org/apache/axis2/mtom/ kernel/src/org/apache/axis2/client/
Date Sun, 03 Sep 2006 04:16:36 GMT
Author: thilina
Date: Sat Sep  2 21:16:34 2006
New Revision: 439720

URL: http://svn.apache.org/viewvc?rev=439720&view=rev
Log:
Fixing http://issues.apache.org/jira/browse/AXIS2-1095?page=all
Sync CallBack should build the envelope with attachments in the onComplete() method. If not
the inStream gets closed after calling the setComplete() method, making the unbuilt data unavailable.

Modified:
    webservices/axis2/trunk/java/modules/integration/maven.xml
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/Echo.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMFileCacheTest.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/MTOM-enabled-axis2.xml
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/MTOM-fileCache-enabled-axis2.xml
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java

Modified: webservices/axis2/trunk/java/modules/integration/maven.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/maven.xml?rev=439720&r1=439719&r2=439720&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/maven.xml (original)
+++ webservices/axis2/trunk/java/modules/integration/maven.xml Sat Sep  2 21:16:34 2006
@@ -463,17 +463,21 @@
             <copy file="test/org/apache/axis2/engine/commons-http-enabled-axis2.xml"
                   tofile="target/test-resources/commons-http-enabledRepository/conf/axis2.xml"/>
 
-            <!-- MTOM enabled Repository -->
+           <!-- MTOM enabled Repository -->
             <mkdir dir="target/test-resources/MTOM-enabledRepository"/>
             <mkdir dir="target/test-resources/MTOM-enabledRepository/conf"/>
             <copy file="test/org/apache/axis2/mtom/MTOM-enabled-axis2.xml"
                   tofile="target/test-resources/MTOM-enabledRepository/conf/axis2.xml"/>
+        	<copy file="../addressing/target/addressing-${addressing_version}.mar"
+        	      tofile="target/test-resources/MTOM-enabledRepository/modules/addressing-${addressing_version}.mar"/>
 
-            <!-- MTOM enabled Repository -->
+            <!-- MTOM file cache enabled Repository -->
             <mkdir dir="target/test-resources/MTOM-fileCache-enabledRepository"/>
             <mkdir dir="target/test-resources/MTOM-fileCache-enabledRepository/conf"/>
             <copy file="test/org/apache/axis2/mtom/MTOM-fileCache-enabled-axis2.xml"
                   tofile="target/test-resources/MTOM-fileCache-enabledRepository/conf/axis2.xml"/>
+        	<copy file="../addressing/target/addressing-${addressing_version}.mar"
+        	        	      tofile="target/test-resources/MTOM-fileCache-enabledRepository/modules/addressing-${addressing_version}.mar"/>
 
             <!-- Groovy repository -->
             <mkdir dir="target/groovyRepo"/>

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/Echo.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/Echo.java?rev=439720&r1=439719&r2=439720&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/Echo.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/Echo.java
Sat Sep  2 21:16:34 2006
@@ -37,6 +37,7 @@
 
 
     public OMElement echoOMElement(OMElement omEle) {
+    	omEle.buildWithAttachments();
         omEle.setLocalName(omEle.getLocalName() + "Response");
         if(omEle.getFirstElement().getText().trim().startsWith("fault")){
             throw new RuntimeException("fault string found in echoOMElement");

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMFileCacheTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMFileCacheTest.java?rev=439720&r1=439719&r2=439720&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMFileCacheTest.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMFileCacheTest.java
Sat Sep  2 21:16:34 2006
@@ -59,4 +59,8 @@
     public void testEchoXMLSync() throws Exception {
         super.testEchoXMLSync();
     }
+    
+    public void testEchoXMLSyncSeperateListener() throws Exception {
+        super.testEchoXMLSyncSeperateListener();
+    }
 }

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java?rev=439720&r1=439719&r2=439720&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java
Sat Sep  2 21:16:34 2006
@@ -48,6 +48,8 @@
 import org.apache.commons.logging.LogFactory;
 
 import javax.activation.DataHandler;
+import javax.xml.namespace.QName;
+
 import java.awt.*;
 import java.io.InputStream;
 
@@ -152,15 +154,13 @@
     public void testEchoXMLSync() throws Exception {
         OMElement payload = createEnvelope();
         Options options = new Options();
-//        options.setProperty(MessageContext.CHARACTER_SET_ENCODING, "UTF-16");
-        //options.setTimeOutInMilliSeconds(-1);
-        //options.setProperty(HTTPConstants.SO_TIMEOUT,new Integer(Integer.MAX_VALUE));
         options.setTo(targetEPR);
         options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
         options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
         options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
         ConfigurationContext configContext =
                 ConfigurationContextFactory.createConfigurationContextFromFileSystem("target/test-resources/integrationRepo",null);
+        
         ServiceClient sender = new ServiceClient(configContext,null);
         options.setAction(Constants.AXIS2_NAMESPACE_URI+"/"+operationName.getLocalPart());
         sender.setOptions(options);
@@ -178,6 +178,30 @@
         actualDH = (DataHandler) binaryNode.getDataHandler();
         new ImageIO().loadImage(actualDH.getDataSource()
                 .getInputStream());
+    }
+    
+    public void testEchoXMLSyncSeperateListener() throws Exception {
+        OMElement payload = createEnvelope();
+        Options options = new Options();
+        options.setTo(targetEPR);
+        options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
+        options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+        options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+        ConfigurationContext configContext =
+                ConfigurationContextFactory.createConfigurationContextFromFileSystem("target/test-resources/integrationRepo",null);
+        
+        ServiceClient sender = new ServiceClient(configContext,null);
+        sender.engageModule( new QName("addressing"));
+        options.setAction(Constants.AXIS2_NAMESPACE_URI+"/"+operationName.getLocalPart());
+        sender.setOptions(options);
+        options.setUseSeparateListener(true);
+        options.setTo(targetEPR);
+        OMElement result = sender.sendReceive(payload);
+
+        OMElement ele = (OMElement) result.getFirstOMChild();
+        OMText binaryNode = (OMText) ele.getFirstOMChild();
+        // to the assert equal
+        compareWithCreatedOMText(binaryNode);
     }
 
     protected InputStream getResourceAsStream(String path) {

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/MTOM-enabled-axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/MTOM-enabled-axis2.xml?rev=439720&r1=439719&r2=439720&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/MTOM-enabled-axis2.xml
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/MTOM-enabled-axis2.xml
Sat Sep  2 21:16:34 2006
@@ -64,8 +64,8 @@
     <!-- ================================================= -->
     <!-- Global Modules  -->
     <!-- ================================================= -->
-    <!-- Uncomment this to enable Addressing
-    <module ref="addressing"/> -->
+    <!-- Uncomment this to enable Addressing-->
+    <module ref="addressing"/> 
 
     <!-- ================================================= -->
     <!-- Phases  -->

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/MTOM-fileCache-enabled-axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/MTOM-fileCache-enabled-axis2.xml?rev=439720&r1=439719&r2=439720&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/MTOM-fileCache-enabled-axis2.xml
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/MTOM-fileCache-enabled-axis2.xml
Sat Sep  2 21:16:34 2006
@@ -66,8 +66,8 @@
     <!-- ================================================= -->
     <!-- Global Modules  -->
     <!-- ================================================= -->
-    <!-- Uncomment this to enable Addressing
-    <module ref="addressing"/> -->
+    <!-- Uncomment this to enable Addressing-->
+    <module ref="addressing"/> 
 
     <!-- ================================================= -->
     <!-- Phases  -->

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java?rev=439720&r1=439719&r2=439720&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
Sat Sep  2 21:16:34 2006
@@ -516,9 +516,9 @@
             }
             // process the result of the invocation
             if (callback.envelope != null) {
-                // building soap envelop
-                callback.envelope.build();
-                // closing transport
+                // transport was already returned by the call back receiver
+            	//Buidling of the Envelope should happen at the setComplete()
+            	// or onComplete() methods of the Callback class
                 return callback.envelope.getBody().getFirstElement();
             } else {
                 if (callback.error instanceof AxisFault) {
@@ -703,7 +703,12 @@
         private Exception error;
 
         public void onComplete(AsyncResult result) {
-            this.envelope = result.getResponseEnvelope();
+			this.envelope = result.getResponseEnvelope();
+			// Transport input stream gets closed after calling setComplete
+			// method. Have to build the whole envelope including the
+			// attachments at this stage. Data might get lost if the input
+			// stream gets closed before building the whole envelope.
+			this.envelope.buildWithAttachments();
             this.msgctx = result.getResponseMessageContext();
         }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message