You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ds...@apache.org on 2007/04/23 13:21:30 UTC

svn commit: r531436 - /webservices/axis2/branches/java/1_2/modules/jibx/src/org/apache/axis2/jibx/JiBXDataSource.java

Author: dsosnoski
Date: Mon Apr 23 04:21:28 2007
New Revision: 531436

URL: http://svn.apache.org/viewvc?view=rev&rev=531436
Log:
Flush output after serializing XML to assure data is written

Modified:
    webservices/axis2/branches/java/1_2/modules/jibx/src/org/apache/axis2/jibx/JiBXDataSource.java

Modified: webservices/axis2/branches/java/1_2/modules/jibx/src/org/apache/axis2/jibx/JiBXDataSource.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/jibx/src/org/apache/axis2/jibx/JiBXDataSource.java?view=diff&rev=531436&r1=531435&r2=531436
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/jibx/src/org/apache/axis2/jibx/JiBXDataSource.java (original)
+++ webservices/axis2/branches/java/1_2/modules/jibx/src/org/apache/axis2/jibx/JiBXDataSource.java Mon Apr 23 04:21:28 2007
@@ -109,11 +109,12 @@
      * @throws JiBXException
      */
     private void marshal(IMarshallingContext ctx) throws JiBXException {
-        if (marshallerIndex < 0) {
-            ((IMarshallable)dataObject).marshal(ctx);
-        } else {
-            try {
-
+        try {
+            
+            if (marshallerIndex < 0) {
+                ((IMarshallable)dataObject).marshal(ctx);
+            } else {
+    
                 // open namespaces from wrapper element
                 IXMLWriter wrtr = ctx.getXmlWriter();
                 wrtr.openNamespaces(openNamespaceIndexes, openNamespacePrefixes);
@@ -122,17 +123,18 @@
                     name = elementNamespacePrefix + ':' + name;
                 }
                 wrtr.startTagOpen(0, name);
-
+    
                 // marshal object representation (may include attributes) into element
                 IMarshaller mrsh = ctx.getMarshaller(marshallerIndex,
                                                      bindingFactory
                                                              .getMappedClasses()[marshallerIndex]);
                 mrsh.marshal(dataObject, ctx);
                 wrtr.endTag(0, name);
-
-            } catch (IOException e) {
-                throw new JiBXException("Error marshalling XML representation", e);
             }
+            ctx.getXmlWriter().flush();
+
+        } catch (IOException e) {
+            throw new JiBXException("Error marshalling XML representation", e);
         }
     }
 



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