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 di...@apache.org on 2003/03/03 23:33:21 UTC
cvs commit: xml-axis/java/src/org/apache/axis/encoding SerializationContextImpl.java
dims 2003/03/03 14:33:21
Modified: java/src/org/apache/axis AxisEngine.java
java/src/org/apache/axis/encoding
SerializationContextImpl.java
Log:
Fix for Bug 17021 - Patch for .Net interoperability with zero length nested arrays
from dave_marquard@forgent.com
Revision Changes Path
1.101 +2 -1 xml-axis/java/src/org/apache/axis/AxisEngine.java
Index: AxisEngine.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/AxisEngine.java,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -r1.100 -r1.101
--- AxisEngine.java 11 Dec 2002 22:38:06 -0000 1.100
+++ AxisEngine.java 3 Mar 2003 22:33:20 -0000 1.101
@@ -100,6 +100,7 @@
public static final String PROP_DEFAULT_CONFIG_CLASS = "axis.engineConfigClass";
public static final String PROP_SOAP_VERSION = "defaultSOAPVersion";
public static final String PROP_TWOD_ARRAY_ENCODING = "enable2DArrayEncoding";
+ public static final String PROP_SEND_MINIMIZED_ELEMENTS = "sendMinimizedElements";
public static final String DEFAULT_ATTACHMENT_IMPL="org.apache.axis.attachments.AttachmentsImpl";
@@ -351,7 +352,7 @@
* web services.
*/
private static final String [] BOOLEAN_OPTIONS = new String [] {
- PROP_DOMULTIREFS, PROP_SEND_XSI, PROP_XML_DECL
+ PROP_DOMULTIREFS, PROP_SEND_XSI, PROP_XML_DECL, PROP_SEND_MINIMIZED_ELEMENTS
};
/**
1.90 +20 -1 xml-axis/java/src/org/apache/axis/encoding/SerializationContextImpl.java
Index: SerializationContextImpl.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/SerializationContextImpl.java,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -r1.89 -r1.90
--- SerializationContextImpl.java 3 Feb 2003 23:16:36 -0000 1.89
+++ SerializationContextImpl.java 3 Mar 2003 22:33:21 -0000 1.90
@@ -156,6 +156,12 @@
private boolean sendXSIType = true;
/**
+ * Should I send minimized elements? As in <element/> instead of
+ * <element></element>.
+ */
+ private boolean sendMinimizedElements = true;
+
+ /**
* A place to hold objects we cache for multi-ref serialization, and
* remember the IDs we assigned them.
*/
@@ -264,6 +270,12 @@
if (shouldSendMultiRefs != null)
doMultiRefs = shouldSendMultiRefs.booleanValue();
+ Boolean shouldSendMinimized =
+ (Boolean)optionSource.getOption(AxisEngine.PROP_SEND_MINIMIZED_ELEMENTS);
+
+ if (shouldSendMinimized != null)
+ sendMinimizedElements = shouldSendMinimized.booleanValue();
+
// The SEND_TYPE_ATTR and PROP_SEND_XSI options indicate
// whether the elements should have xsi:type attributes.
// Only turn this off is the user tells us to
@@ -984,7 +996,14 @@
nsStack.pop();
if (writingStartTag) {
- writer.write("/>");
+ if (sendMinimizedElements) {
+ writer.write("/>");
+ }
+ else {
+ writer.write("></");
+ writer.write(elementQName);
+ writer.write('>');
+ }
if (pretty) writer.write('\n');
writingStartTag = false;
return;