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 gd...@apache.org on 2002/05/24 20:20:44 UTC
cvs commit: xml-axis/java/test/encoding DataDeser.java DataDeserFactory.java DataSerFactory.java TestDOM.java TestDeser.java TestHrefs.java TestSer.java
gdaniels 02/05/24 11:20:44
Modified: java/samples/encoding DataDeser.java DataDeserFactory.java
DataSerFactory.java
java/src/org/apache/axis EngineConfigurationFactory.java
MessageContext.java SOAPPart.java
java/src/org/apache/axis/attachments AttachmentPart.java
java/src/org/apache/axis/configuration
DefaultEngineConfigurationFactory.java
ServletEngineConfigurationFactory.java
java/src/org/apache/axis/deployment/wsdd WSDDService.java
java/src/org/apache/axis/encoding
DeserializationContextImpl.java Deserializer.java
java/src/org/apache/axis/encoding/ser ArrayDeserializer.java
ArraySerializerFactory.java Base64Deserializer.java
Base64Serializer.java Base64SerializerFactory.java
BaseSerializerFactory.java BeanDeserializer.java
BeanSerializerFactory.java
DateSerializerFactory.java ElementDeserializer.java
ElementSerializer.java
ElementSerializerFactory.java EnumDeserializer.java
EnumSerializer.java EnumSerializerFactory.java
HexDeserializer.java HexSerializer.java
HexSerializerFactory.java
JAFDataHandlerDeserializer.java
JAFDataHandlerSerializer.java
JAFDataHandlerSerializerFactory.java
MapDeserializer.java MapSerializerFactory.java
SimpleDeserializer.java
SimpleNonPrimitiveSerializerFactory.java
SimplePrimitiveSerializerFactory.java
VectorDeserializer.java VectorSerializer.java
VectorSerializerFactory.java
java/src/org/apache/axis/handlers/soap SOAPService.java
java/src/org/apache/axis/message BodyBuilder.java
EnvelopeBuilder.java HeaderBuilder.java
MessageElement.java RPCElement.java RPCHandler.java
SOAPBody.java SOAPEnvelope.java
SOAPFaultBuilder.java SOAPHandler.java
java/test/encoding DataDeser.java DataDeserFactory.java
DataSerFactory.java TestDOM.java TestDeser.java
TestHrefs.java TestSer.java
Removed: java/src/org/apache/axis/encoding DeserializerImpl.java
Log:
Make streaming deserialization work again!
There is now a MessageContext option for "high-fidelity" recording.
If this is true (the default), we will SAX-record the entire message
just like we were doing before - this allows byte-for-byte reconstruction
of messages for intermediaries/encryption/etc. If it's false, we only
record what is necessary (i.e. when we come to elements with ID
attributes, we record them for multiref deserialization) and deserialize
on the fly during the parse.
DETAILS:
* Remove Deserializer interface, replace with Deserializer class which
extends SOAPHandler.
* Introduce "highFidelity" flag in MessageContext. Defaults to true, so
unless you do something everything works as before. The option also
exists in SOAPService and WSDDService, so if you specify "streaming='on'"
in your service deployment, you'll get on-the-fly deserialization.
* Add a setter for "needDeser" on RPCElement, which gets used by BodyBuilder
* BodyBuilder checks if we're doing high-fidelity recording, and if NOT,
directly uses RPCHandlers during parsing, which results in immediate
deserialization on the fly.
* Even if we're not recording the whole message, if we come across
MessageElements with ID attributes, record them for later multi-ref
deserialization.
* Remove main()s from a few tests, since it's better to let junit deal
for you (these were put in before I realized how simple running a single
test was within the framework)
* Various little bits of cleanup, unused imports, etc.
TODOs:
* The way the current SOAPHandler framework works with respect to creating
new MessageElements and maintaining the element stack in the DserContext
is very brittle and hard to understand. This should be cleaned up and
factored out again - it was clean at one point and now enough stuff
has creeped in to make it worthy of a revisit. Start to frame this work
with makeNewElement() in SOAPHandler.
Revision Changes Path
1.2 +4 -4 xml-axis/java/samples/encoding/DataDeser.java
Index: DataDeser.java
===================================================================
RCS file: /home/cvs/xml-axis/java/samples/encoding/DataDeser.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DataDeser.java 26 Jan 2002 02:52:38 -0000 1.1
+++ DataDeser.java 24 May 2002 18:20:41 -0000 1.2
@@ -2,7 +2,7 @@
import org.apache.axis.encoding.DeserializationContext;
import org.apache.axis.encoding.Deserializer;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.FieldTarget;
import org.apache.axis.Constants;
import org.apache.axis.message.SOAPHandler;
@@ -13,7 +13,7 @@
import java.io.IOException;
import java.util.Hashtable;
-public class DataDeser extends DeserializerImpl
+public class DataDeser extends Deserializer
{
public static final String STRINGMEMBER = "stringMember";
public static final String FLOATMEMBER = "floatMember";
@@ -37,7 +37,7 @@
* This method is invoked when an element start tag is encountered.
* @param namespace is the namespace of the element
* @param localName is the name of the element
- * @param qName is the prefixed qName of the element
+ * @param prefix is the element's prefix
* @param attributes are the attributes on the element...used to get the type
* @param context is the DeserializationContext
*/
@@ -63,6 +63,6 @@
if (dSer == null)
throw new SAXException("No deserializer for a " + typeQName + "???");
- return (SOAPHandler) dSer;
+ return dSer;
}
}
1.2 +1 -1 xml-axis/java/samples/encoding/DataDeserFactory.java
Index: DataDeserFactory.java
===================================================================
RCS file: /home/cvs/xml-axis/java/samples/encoding/DataDeserFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DataDeserFactory.java 26 Jan 2002 02:52:38 -0000 1.1
+++ DataDeserFactory.java 24 May 2002 18:20:41 -0000 1.2
@@ -67,7 +67,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import org.apache.axis.Constants;
import java.util.Iterator;
1.2 +1 -1 xml-axis/java/samples/encoding/DataSerFactory.java
Index: DataSerFactory.java
===================================================================
RCS file: /home/cvs/xml-axis/java/samples/encoding/DataSerFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DataSerFactory.java 26 Jan 2002 02:52:38 -0000 1.1
+++ DataSerFactory.java 24 May 2002 18:20:41 -0000 1.2
@@ -67,7 +67,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import org.apache.axis.Constants;
import java.util.Iterator;
1.6 +0 -2 xml-axis/java/src/org/apache/axis/EngineConfigurationFactory.java
Index: EngineConfigurationFactory.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/EngineConfigurationFactory.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- EngineConfigurationFactory.java 17 May 2002 18:20:49 -0000 1.5
+++ EngineConfigurationFactory.java 24 May 2002 18:20:41 -0000 1.6
@@ -55,8 +55,6 @@
package org.apache.axis;
-import javax.xml.rpc.namespace.QName;
-
/**
* EngineConfigurationFactory is an interface used to construct
* concrete EngineConfiguration instances.
1.91 +20 -0 xml-axis/java/src/org/apache/axis/MessageContext.java
Index: MessageContext.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/MessageContext.java,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -r1.90 -r1.91
--- MessageContext.java 9 May 2002 18:16:19 -0000 1.90
+++ MessageContext.java 24 May 2002 18:20:41 -0000 1.91
@@ -164,6 +164,13 @@
private int timeout = 0;
/**
+ * An indication of whether we require "high fidelity" recording of
+ * deserialized messages for this interaction. Defaults to true for
+ * now, and can be set to false, usually at service-dispatch time.
+ */
+ private boolean highFidelity = true;
+
+ /**
* Storage for an arbitrary bag of properties associated with this
* MessageContext.
*/
@@ -543,6 +550,11 @@
// This MessageContext should now defer properties it can't find
// to the Service's options.
bag.setParent(sh.getOptions());
+
+ // Note that we need (or don't need) high-fidelity SAX recording
+ // of deserialized messages according to the setting on the
+ // new service.
+ highFidelity = service.needsHighFidelityRecording();
}
}
@@ -929,5 +941,13 @@
}
return null;
+ }
+
+ public boolean isHighFidelity() {
+ return highFidelity;
+ }
+
+ public void setHighFidelity(boolean highFidelity) {
+ this.highFidelity = highFidelity;
}
};
1.21 +10 -3 xml-axis/java/src/org/apache/axis/SOAPPart.java
Index: SOAPPart.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/SOAPPart.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- SOAPPart.java 9 May 2002 18:25:18 -0000 1.20
+++ SOAPPart.java 24 May 2002 18:20:41 -0000 1.21
@@ -256,8 +256,14 @@
*/
private void setCurrentMessage(Object currMsg, int form) {
if (log.isDebugEnabled()) {
+ String msgStr;
+ if (currMsg instanceof String) {
+ msgStr = (String)currMsg;
+ } else {
+ msgStr = currMsg.getClass().getName();
+ }
log.debug(JavaUtils.getMessage("setMsgForm", formNames[form],
- "" + currMsg));
+ "" + msgStr));
}
currentMessage = currMsg ;
currentForm = form ;
@@ -428,8 +434,9 @@
} else {
is = new InputSource(new StringReader(getAsString()));
}
- DeserializationContext dser =
- new DeserializationContextImpl(is, getMessage().getMessageContext(), getMessage().getMessageType());
+ DeserializationContext dser = new DeserializationContextImpl(is,
+ getMessage().getMessageContext(),
+ getMessage().getMessageType());
// This may throw a SAXException
try {
1.7 +1 -22 xml-axis/java/src/org/apache/axis/attachments/AttachmentPart.java
Index: AttachmentPart.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/attachments/AttachmentPart.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- AttachmentPart.java 27 Feb 2002 13:06:11 -0000 1.6
+++ AttachmentPart.java 24 May 2002 18:20:41 -0000 1.7
@@ -56,30 +56,9 @@
package org.apache.axis.attachments;
import org.apache.axis.Part;
-import org.apache.axis.Message;
+import org.apache.axis.transport.http.HTTPConstants;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
-import javax.activation.DataHandler;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.IOException;
-
-/**
- * An AttachmentPart contains attachment data along with MIME
- * headers, and implements the standard Part API.
- * <p>
- * It provides access to attachment content via
- * javax.activation.DataHandlers, so it will not be built if Axis
- * is built without activation.jar, and core Axis code must not
- * import it (lest it also become dependent on axis.jar).
- * Attachment-aware code, of course, is no problem.
- *
- * @author Rob Jellinghaus (robj@unrealities.com)
- * @author Rick Rineholt
- */
-
-import org.apache.axis.transport.http.HTTPConstants ;
public class AttachmentPart extends Part {
protected static Log log =
1.8 +0 -4 xml-axis/java/src/org/apache/axis/configuration/DefaultEngineConfigurationFactory.java
Index: DefaultEngineConfigurationFactory.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/configuration/DefaultEngineConfigurationFactory.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- DefaultEngineConfigurationFactory.java 17 May 2002 18:21:37 -0000 1.7
+++ DefaultEngineConfigurationFactory.java 24 May 2002 18:20:41 -0000 1.8
@@ -57,14 +57,10 @@
import org.apache.axis.EngineConfigurationFactory;
import org.apache.axis.EngineConfiguration;
-import org.apache.axis.Constants;
import org.apache.axis.utils.JavaUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
-import java.io.File;
-import java.io.InputStream;
/**
* This is a default implementation of EngineConfigurationFactory.
1.3 +8 -8 xml-axis/java/src/org/apache/axis/configuration/ServletEngineConfigurationFactory.java
Index: ServletEngineConfigurationFactory.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/configuration/ServletEngineConfigurationFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ServletEngineConfigurationFactory.java 27 Feb 2002 17:13:32 -0000 1.2
+++ ServletEngineConfigurationFactory.java 24 May 2002 18:20:41 -0000 1.3
@@ -55,10 +55,8 @@
package org.apache.axis.configuration;
-import org.apache.axis.EngineConfigurationFactory;
import org.apache.axis.EngineConfiguration;
import org.apache.axis.ConfigurationException;
-import org.apache.axis.Constants;
import org.apache.axis.utils.JavaUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -121,12 +119,14 @@
FileProvider config = null ;
- if (!(new File(webInfPath,
- SERVER_CONFIG_FILE)).exists()){
- InputStream is = null ;
- is = ctx.getResourceAsStream("/WEB-INF/"+
- SERVER_CONFIG_FILE);
- if (is != null) config = new FileProvider(is);
+ if (webInfPath == null || !(new File(webInfPath,
+ SERVER_CONFIG_FILE)).exists()){
+ InputStream is = ctx.getResourceAsStream("/WEB-INF/"+
+ SERVER_CONFIG_FILE);
+ if (is == null) {
+ // !!! THROW EXCEPTION
+ }
+ config = new FileProvider(is);
}
if ( config == null ) {
try {
1.64 +12 -0 xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDService.java
Index: WSDDService.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDService.java,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- WSDDService.java 13 May 2002 13:11:34 -0000 1.63
+++ WSDDService.java 24 May 2002 18:20:42 -0000 1.64
@@ -117,6 +117,12 @@
ServiceDesc desc = new ServiceDesc();
/**
+ * Is streaming (i.e. NO high-fidelity recording, deserialize on the fly)
+ * on for this service?
+ */
+ private boolean streaming = false;
+
+ /**
* Default constructor
*/
public WSDDService()
@@ -149,6 +155,11 @@
}
}
+ String streamStr = e.getAttribute("streaming");
+ if (streamStr != null && streamStr.equals("on")) {
+ streaming = true;
+ }
+
Element [] operationElements = getChildElements(e, "operation");
for (int i = 0; i < operationElements.length; i++) {
WSDDOperation operation = new WSDDOperation(operationElements[i],
@@ -379,6 +390,7 @@
SOAPService service = new SOAPService(reqHandler, providerHandler,
respHandler);
service.setStyle(style);
+ service.setHighFidelityRecording(!streaming);
if ( getQName() != null )
service.setName(getQName().getLocalPart());
1.29 +34 -11 xml-axis/java/src/org/apache/axis/encoding/DeserializationContextImpl.java
Index: DeserializationContextImpl.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/DeserializationContextImpl.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- DeserializationContextImpl.java 16 May 2002 12:54:36 -0000 1.28
+++ DeserializationContextImpl.java 24 May 2002 18:20:42 -0000 1.29
@@ -101,18 +101,17 @@
{
protected static Log log =
LogFactory.getLog(DeserializationContextImpl.class.getName());
-
-
+
private NSStack namespaces = new NSStack();
private Locator locator;
private Stack handlerStack = new Stack();
- private SAX2EventRecorder recorder = new SAX2EventRecorder();
+ //private SAX2EventRecorder recorder = new SAX2EventRecorder();
+ private SAX2EventRecorder recorder = null;
private SOAPEnvelope envelope;
-
/* A map of IDs -> IDResolvers */
private HashMap idMap;
private LocalIDResolver localIDs;
@@ -137,10 +136,15 @@
* @param ctx is the MessageContext
* @param initialHandler is the EnvelopeBuilder handler
*/
- public DeserializationContextImpl(MessageContext ctx, EnvelopeBuilder initialHandler)
+ public DeserializationContextImpl(MessageContext ctx,
+ EnvelopeBuilder initialHandler)
{
msgContext = ctx;
-
+
+ // If high fidelity is required, record the whole damn thing.
+ if (ctx == null || ctx.isHighFidelity())
+ recorder = new SAX2EventRecorder();
+
envelope = initialHandler.getEnvelope();
envelope.setRecorder(recorder);
@@ -153,14 +157,19 @@
* @param ctx is the MessageContext
* @param messageType is the MessageType to construct an EnvelopeBuilder
*/
- public DeserializationContextImpl(InputSource is, MessageContext ctx,
- String messageType)
+ public DeserializationContextImpl(InputSource is,
+ MessageContext ctx,
+ String messageType)
{
EnvelopeBuilder builder = new EnvelopeBuilder(messageType,
ctx.getSOAPConstants());
msgContext = ctx;
-
+
+ // If high fidelity is required, record the whole damn thing.
+ if (ctx == null || ctx.isHighFidelity())
+ recorder = new SAX2EventRecorder();
+
envelope = builder.getEnvelope();
envelope.setRecorder(recorder);
@@ -176,13 +185,19 @@
* @param messageType is the MessageType to construct an EnvelopeBuilder
* @param env is the SOAPEnvelope to construct an EnvelopeBuilder
*/
- public DeserializationContextImpl(InputSource is, MessageContext ctx,
- String messageType, SOAPEnvelope env)
+ public DeserializationContextImpl(InputSource is,
+ MessageContext ctx,
+ String messageType,
+ SOAPEnvelope env)
{
EnvelopeBuilder builder = new EnvelopeBuilder(env, messageType);
msgContext = ctx;
+ // If high fidelity is required, record the whole damn thing.
+ if (ctx == null || ctx.isHighFidelity())
+ recorder = new SAX2EventRecorder();
+
envelope = builder.getEnvelope();
envelope.setRecorder(recorder);
@@ -637,6 +652,10 @@
*/
public void pushNewElement(MessageElement elem)
{
+ if (log.isDebugEnabled()) {
+ log.debug("Pushing element " + elem.getName());
+ }
+
if (!doneParsing && (recorder != null)) {
recorder.newElement(elem);
}
@@ -908,6 +927,10 @@
curElement = (MessageElement)curElement.getParentElement();
if (log.isDebugEnabled()) {
+ String name = curElement != null ?
+ curElement.getClass().getName() + ":" +
+ curElement.getName() : null;
+ log.debug("Popped element stack to " + name);
log.debug("Exit: DeserializationContextImpl::endElement()");
}
}
1.30 +321 -84 xml-axis/java/src/org/apache/axis/encoding/Deserializer.java
Index: Deserializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/Deserializer.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- Deserializer.java 6 Mar 2002 19:35:49 -0000 1.29
+++ Deserializer.java 24 May 2002 18:20:42 -0000 1.30
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -18,7 +18,7 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
+ * if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
@@ -26,7 +26,7 @@
*
* 4. The names "Axis" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
@@ -53,70 +53,77 @@
* <http://www.apache.org/>.
*/
-
package org.apache.axis.encoding;
-import java.io.IOException;
-import java.io.Writer;
-
-import org.apache.axis.Message;
-import org.apache.axis.MessageContext;
-
-import org.apache.axis.encoding.Target;
+import org.apache.axis.Constants;
-import org.apache.axis.message.IDResolver;
+import org.apache.axis.message.EnvelopeHandler;
import org.apache.axis.message.MessageElement;
import org.apache.axis.message.SAX2EventRecorder;
+import org.apache.axis.message.SAXOutputter;
import org.apache.axis.message.SOAPHandler;
-import org.apache.axis.utils.NSStack;
-import org.apache.axis.message.SOAPEnvelope;
-
-import org.w3c.dom.Element;
-
+import org.apache.axis.Part;
+import org.apache.axis.utils.JavaUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
-import javax.xml.parsers.SAXParser;
+import org.apache.axis.encoding.Target;
import javax.xml.rpc.namespace.QName;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Stack;
+
+import java.io.StringWriter;
+import java.util.Enumeration;
import java.util.Vector;
-/**
- * This interface describes the AXIS Deserializer.
- * A compliant implementiation must extend either
- * the AXIS SoapHandler (org.apache.axis.message.SOAPHandler)
- * or the AXIS DeserializerImpl (org.apache.axis.encoding.DeserializerImpl)
+/** The Deserializer base class.
*
- * The DeserializerImpl provides a lot of the default behavior including the
- * support for id/href. So you may want to try extending it as opposed to
- * extending SoapHandler.
- *
- * An Axis compliant Deserializer must provide one or more
- * of the following methods:
- *
- * public <constructor>(Class javaType, QName xmlType)
- * public <constructor>()
- *
- * This will allow for construction of generic factories that introspect the class
- * to determine how to construct a deserializer.
- * The xmlType, javaType arguments are filled in with the values known by the factory.
-g */
-public interface Deserializer extends javax.xml.rpc.encoding.Deserializer, Callback {
+ * @author Glen Daniels (gdaniels@allaire.com)
+ * Re-architected for JAX-RPC Compliance by
+ * @author Rich Scheuerle (sche@us.ibm.com)
+ */
+
+public class Deserializer extends SOAPHandler
+ implements javax.xml.rpc.encoding.Deserializer
+{
+ protected static Log log =
+ LogFactory.getLog(Deserializer.class.getName());
+
+ protected Object value = null;
+
+ // isEnded is set when the endElement is called
+ protected boolean isEnded = false;
+
+ protected Vector targets = null;
+
+ protected QName defaultType = null;
+ private boolean componentsReady = true;
+
+
+ /**
+ * JAX-RPC compliant method which returns mechanism type.
+ */
+ public String getMechanismType() {
+ return Constants.AXIS_SAX;
+ }
/**
* Get the deserialized value.
* @return Object representing deserialized value or null
*/
- public Object getValue();
-
+ public Object getValue()
+ {
+ return value;
+ }
/**
* Set the deserialized value.
- * @param Object representing deserialized value
+ * @param value Object representing deserialized value
*/
- public void setValue(Object value);
+ public void setValue(Object value)
+ {
+ this.value = value;
+ }
/**
* If the deserializer has component values (like ArrayDeserializer)
@@ -124,17 +131,22 @@
* The default implementation returns null.
* @return Object representing deserialized value or null
*/
- public Object getValue(Object hint);
+ public Object getValue(Object hint)
+ {
+ return null;
+ }
/**
* If the deserializer has component values (like ArrayDeserializer)
* this method sets the specific component via the hint.
* The default implementation does nothing.
- * @param Object representing deserialized value or null
+ * @param hint Object representing deserialized value or null
*/
- public void setValue(Object value, Object hint) throws SAXException;
+ public void setValue(Object value, Object hint) throws SAXException
+ {
+ }
- /**
+ /**
* In some circumstances an element may not have
* a type attribute, but a default type qname is known from
* information in the container. For example,
@@ -143,8 +155,12 @@
* This method is used to communicate the default type information
* to the deserializer.
*/
- public void setDefaultType(QName qName);
- public QName getDefaultType();
+ public void setDefaultType(QName qName) {
+ defaultType = qName;
+ }
+ public QName getDefaultType() {
+ return defaultType;
+ }
/**
* For deserializers of non-primitives, the value may not be
@@ -154,22 +170,35 @@
* each Target registered with the Deserializer. The Target
* object abstracts the function of setting a target with a
* value. See the Target interface for more info.
- * @param Target
+ * @param target
*/
- public void registerValueTarget(Target target);
-
+ public void registerValueTarget(Target target)
+ {
+ if (targets == null)
+ targets = new Vector();
+
+ targets.addElement(target);
+ }
+
/**
* Get the Value Targets of the Deserializer.
* @return Vector of Target objects or null
*/
- public Vector getValueTargets();
-
+ public Vector getValueTargets() {
+ return targets;
+ }
+
/**
* Remove the Value Targets of the Deserializer.
*/
- public void removeValueTargets() ;
+ public void removeValueTargets() {
+ if (targets != null) {
+ targets.clear();
+ targets = null;
+ }
+ }
- /**
+ /**
* Move someone else's targets to our own (see DeserializationContext)
*
* The DeserializationContext only allows one Deserializer to
@@ -178,8 +207,21 @@
* to copy the Target objects to the waiting Deserializer.
* @param other is the Deserializer to copy targets from.
*/
- public void moveValueTargets(Deserializer other);
-
+ public void moveValueTargets(Deserializer other)
+ {
+ if ((other == null) || (other.getValueTargets() == null))
+ return;
+
+ if (targets == null)
+ targets = new Vector();
+
+ Enumeration e = other.getValueTargets().elements();
+ while (e.hasMoreElements()) {
+ targets.addElement(e.nextElement());
+ }
+ other.removeValueTargets();
+ }
+
/**
* Some deserializers (ArrayDeserializer) require
* all of the component values to be known before the
@@ -192,7 +234,9 @@
* This routine is used to indicate when the components are ready.
* The default (true) is useful for most Deserializers.
*/
- public boolean componentsReady();
+ public boolean componentsReady() {
+ return componentsReady;
+ }
/**
* The valueComplete() method is invoked when the
@@ -205,13 +249,33 @@
* specific Deserializer will need to call valueComplete()
* when your components are ready (See ArrayDeserializer)
*/
- public void valueComplete() throws SAXException;
-
-
- /**
- * The following are the SAX specific methods.
- * DeserializationImpl provides default behaviour, which
- * in most cases is appropriate.
+ public void valueComplete() throws SAXException
+ {
+ if (componentsReady()) {
+ if (targets != null) {
+ Enumeration e = targets.elements();
+ while (e.hasMoreElements()) {
+ Target target = (Target)e.nextElement();
+ target.set(value);
+ if (log.isDebugEnabled()) {
+ log.debug(JavaUtils.getMessage("setValueInTarget00",
+ "" + value, "" + target));
+ }
+ }
+ // Don't need targets any more, so clear them
+ removeValueTargets();
+ }
+ }
+ }
+
+ private int startIdx = 0;
+ private int endIdx = -1;
+ protected boolean isHref = false;
+ protected boolean isNil = false; // xsd:nil attribute is set to true
+ protected String id = null; // Set to the id of the element
+
+ /**
+ * Subclasses may override these
*/
/**
@@ -243,8 +307,7 @@
* valueComplete method.
*
* So the methods that you potentially want to override are:
- * onStartElement, onStartChild, componentsReady, set(object, hint)
- *
+ * onStartElement, onStartChild, componentsReady, setValue(object, hint)
* You probably should not override startElement or endElement.
* If you need specific behaviour at the end of the element consider overriding
* onEndElement.
@@ -254,8 +317,89 @@
public void startElement(String namespace, String localName,
String qName, Attributes attributes,
DeserializationContext context)
- throws SAXException;
-
+ throws SAXException
+ {
+ super.startElement(namespace, localName, qName, attributes, context);
+
+ // If the xsi:nil attribute, set the value to null and return since
+ // there is nothing to deserialize.
+ String nil = Constants.getValue(attributes,
+ Constants.URIS_SCHEMA_XSI,
+ "nil");
+ if (nil != null && nil.equals("true")) {
+ value = null;
+ isNil = true;
+ return;
+ }
+
+ // If this element has an id, then associate the value with the id.
+ // (Prior to this association, the MessageElement of the element is
+ // associated with the id. Failure to replace the MessageElement at this
+ // point will cause an infinite loop during deserialization if the
+ // current element contains child elements that cause an href back to this id.)
+ // Also note that that endElement() method is responsible for the final
+ // association of this id with the completed value.
+ id = attributes.getValue("id");
+ if (id != null) {
+ context.addObjectById(id, value);
+ if (log.isDebugEnabled()) {
+ log.debug(JavaUtils.getMessage("deserInitPutValueDebug00", "" + value, id));
+ }
+ context.registerFixup("#" + id, this);
+ }
+
+ String href = attributes.getValue("href");
+ if (href != null) {
+ isHref = true;
+
+ Object ref = context.getObjectByRef(href);
+ if (log.isDebugEnabled()) {
+ log.debug(JavaUtils.getMessage(
+ "gotForID00",
+ new String[] {"" + ref, href, (ref == null ? "*null*" : ref.getClass().toString())}));
+ }
+
+ if (ref == null) {
+ // Nothing yet... register for later interest.
+ context.registerFixup(href, this);
+ componentsReady = false;
+ return;
+ }
+
+ if (ref instanceof MessageElement) {
+ context.replaceElementHandler(new EnvelopeHandler(this));
+
+ SAX2EventRecorder r = context.getRecorder();
+ context.setRecorder(null);
+ ((MessageElement)ref).publishToHandler((DefaultHandler) context);
+ context.setRecorder(r);
+ } else {
+
+ if( !href.startsWith("#") && defaultType != null && ref instanceof Part ){
+ //For attachments this is the end of the road-- invoke deserializer
+ Deserializer dser= context.getDeserializerForType(defaultType );
+ if(null != dser){
+ dser.startElement(namespace, localName,
+ qName, attributes,
+ context);
+ ref = dser.getValue();
+
+ }
+ }
+
+ // If the ref is not a MessageElement, then it must be an
+ // element that has already been deserialized. Use it directly.
+ value = ref;
+ valueComplete();
+ }
+
+ } else {
+ isHref = false;
+ onStartElement(namespace, localName, qName, attributes,
+ context);
+ }
+ }
+
/**
* This method is invoked after startElement when the element requires
* deserialization (i.e. the element is not an href and the value is not nil.)
@@ -263,15 +407,56 @@
* involves obtaining a correct Deserializer and plugging its handler.
* @param namespace is the namespace of the element
* @param localName is the name of the element
- * @param qName is the prefixed qname of the element
+ * @param qName is the prefixed qName of the element
* @param attributes are the attributes on the element...used to get the type
* @param context is the DeserializationContext
*/
public void onStartElement(String namespace, String localName,
String qName, Attributes attributes,
DeserializationContext context)
- throws SAXException;
-
+ throws SAXException
+ {
+ // If I'm the base class, try replacing myself with an
+ // appropriate deserializer gleaned from type info.
+ if (this.getClass().equals(Deserializer.class)) {
+ QName type = context.getTypeFromAttributes(namespace,
+ localName,
+ attributes);
+ // If no type is specified, use the defaultType if available.
+ // xsd:string is used if no type is provided.
+ if (type == null) {
+ type = defaultType;
+ if (type == null) {
+ type = Constants.XSD_STRING;
+ }
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug(JavaUtils.getMessage("gotType00", "Deser", "" + type));
+ }
+
+ // We know we're deserializing, but we don't have
+ // a specific deserializer. So create one using the
+ // attribute type qname.
+ if (type != null) {
+ Deserializer dser = context.getDeserializerForType(type);
+ if (dser != null) {
+ // Move the value targets to the new deserializer
+ dser.moveValueTargets(this);
+ context.replaceElementHandler((org.apache.axis.message.SOAPHandler) dser);
+ // And don't forget to give it the start event...
+ dser.startElement(namespace, localName, qName,
+ attributes, context);
+ } else {
+ throw new SAXException(
+ JavaUtils.getMessage("noDeser00", "" + type));
+ }
+ } else {
+ startIdx = context.getCurrentRecordPos();
+ }
+ }
+ }
+
/**
* onStartChild is called on each child element.
* The default behavior supplied by DeserializationImpl is to do nothing.
@@ -290,7 +475,12 @@
public SOAPHandler onStartChild(String namespace, String localName,
String prefix, Attributes attributes,
DeserializationContext context)
- throws SAXException;
+ throws SAXException
+ {
+ return null;
+ }
+
+
/**
* endElement is called when the end element tag is reached.
@@ -301,9 +491,33 @@
* @param localName is the local name of the child element
* @param context is the deserialization context
*/
- public void endElement(String namespace, String localName,
+ public final void endElement(String namespace, String localName,
DeserializationContext context)
- throws SAXException;
+ throws SAXException
+ {
+
+ isEnded = true;
+ if (!isHref) {
+ onEndElement(namespace, localName, context);
+ }
+
+ // Time to call valueComplete to copy the value to
+ // the targets. First a call is made to componentsReady
+ // to ensure that all components are ready.
+ if (componentsReady()) {
+ valueComplete();
+ }
+
+ // If this element has an id, then associate the value with the id.
+ // Subsequent hrefs to the id will obtain the value directly.
+ // This is necessary for proper multi-reference deserialization.
+ if (id != null) {
+ context.addObjectById(id, value);
+ if (log.isDebugEnabled()) {
+ log.debug(JavaUtils.getMessage("deserPutValueDebug00", "" + value, id));
+ }
+ }
+ }
/**
* onEndElement is called by endElement. It is not called
@@ -314,8 +528,31 @@
*/
public void onEndElement(String namespace, String localName,
DeserializationContext context)
- throws SAXException;
-
+ throws SAXException
+ {
+ // If we only have SAX events, but someone really wanted a
+ // value, try sending them the contents of this element
+ // as a String...
+ // ??? Is this the right thing to do here?
+
+ if (this.getClass().equals(Deserializer.class) &&
+ targets != null &&
+ !targets.isEmpty()) {
+ endIdx = context.getCurrentRecordPos();
+
+ StringWriter writer = new StringWriter();
+ SerializationContextImpl serContext =
+ new SerializationContextImpl(writer,
+ context.getMessageContext());
+ serContext.setSendDecl(false);
+
+ SAXOutputter so = null;
+ so = new SAXOutputter(serContext);
+ context.getCurElement().publishContents(so);
+ if (!isNil) {
+ value = writer.getBuffer().toString();
+ }
+ }
+ }
+
}
-
-
1.12 +4 -5 xml-axis/java/src/org/apache/axis/encoding/ser/ArrayDeserializer.java
Index: ArrayDeserializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/ArrayDeserializer.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ArrayDeserializer.java 9 May 2002 18:30:45 -0000 1.11
+++ ArrayDeserializer.java 24 May 2002 18:20:42 -0000 1.12
@@ -58,7 +58,7 @@
import org.apache.axis.Constants;
import org.apache.axis.encoding.DeserializationContext;
import org.apache.axis.encoding.Deserializer;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerTarget;
import org.apache.axis.message.SOAPHandler;
import org.apache.axis.utils.JavaUtils;
@@ -85,8 +85,7 @@
* Multi-reference stuff:
* @author Rich Scheuerle (scheu@us.ibm.com)
*/
-public class ArrayDeserializer extends DeserializerImpl
- implements Deserializer
+public class ArrayDeserializer extends Deserializer
{
protected static Log log =
LogFactory.getLog(ArrayDeserializer.class.getName());
@@ -398,7 +397,7 @@
dSer = context.getDeserializerForType(itemType);
}
if (dSer == null) {
- dSer = new DeserializerImpl();
+ dSer = new Deserializer();
// Determine a default type for the deserializer
if (itemType == null) {
QName defaultType = defaultItemType;
@@ -426,7 +425,7 @@
log.debug("Exit: ArrayDeserializer.onStartChild()");
}
- return (SOAPHandler) dSer;
+ return dSer;
}
/**
1.2 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/ArraySerializerFactory.java
Index: ArraySerializerFactory.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/ArraySerializerFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ArraySerializerFactory.java 26 Jan 2002 02:40:34 -0000 1.1
+++ ArraySerializerFactory.java 24 May 2002 18:20:42 -0000 1.2
@@ -67,7 +67,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
/**
* SerializerFactory for arrays
*
1.4 +2 -2 xml-axis/java/src/org/apache/axis/encoding/ser/Base64Deserializer.java
Index: Base64Deserializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/Base64Deserializer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Base64Deserializer.java 4 Feb 2002 22:34:53 -0000 1.3
+++ Base64Deserializer.java 24 May 2002 18:20:42 -0000 1.4
@@ -67,7 +67,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.Base64;
/**
@@ -77,7 +77,7 @@
* Modified by @author Rich scheuerle <sc...@us.ibm.com>
* @see <a href="http://www.w3.org/TR/xmlschema-2/#base64Binary">XML Schema 3.2.16</a>
*/
-public class Base64Deserializer extends DeserializerImpl implements Deserializer {
+public class Base64Deserializer extends Deserializer {
public QName xmlType;
public Class javaType;
1.4 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/Base64Serializer.java
Index: Base64Serializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/Base64Serializer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Base64Serializer.java 2 Feb 2002 18:06:18 -0000 1.3
+++ Base64Serializer.java 24 May 2002 18:20:42 -0000 1.4
@@ -69,7 +69,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.Base64;
import org.w3c.dom.Element;
import org.w3c.dom.Document;
1.3 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/Base64SerializerFactory.java
Index: Base64SerializerFactory.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/Base64SerializerFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Base64SerializerFactory.java 31 Jan 2002 03:26:09 -0000 1.2
+++ Base64SerializerFactory.java 24 May 2002 18:20:42 -0000 1.3
@@ -67,7 +67,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
/**
* SerializerFactory for hexBinary.
*
1.6 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/BaseSerializerFactory.java
Index: BaseSerializerFactory.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/BaseSerializerFactory.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- BaseSerializerFactory.java 29 Mar 2002 22:13:05 -0000 1.5
+++ BaseSerializerFactory.java 24 May 2002 18:20:42 -0000 1.6
@@ -73,7 +73,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
1.27 +4 -4 xml-axis/java/src/org/apache/axis/encoding/ser/BeanDeserializer.java
Index: BeanDeserializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/BeanDeserializer.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- BeanDeserializer.java 24 May 2002 16:48:58 -0000 1.26
+++ BeanDeserializer.java 24 May 2002 18:20:42 -0000 1.27
@@ -60,7 +60,7 @@
import org.apache.axis.description.TypeDesc;
import org.apache.axis.encoding.DeserializationContext;
import org.apache.axis.encoding.Deserializer;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.TypeMapping;
import org.apache.axis.message.SOAPHandler;
import org.apache.axis.utils.BeanPropertyDescriptor;
@@ -83,7 +83,7 @@
* @author Rich Scheuerle <sc...@us.ibm.com>
* @author Tom Jordahl <to...@macromedia.com>
*/
-public class BeanDeserializer extends DeserializerImpl implements Deserializer, Serializable
+public class BeanDeserializer extends Deserializer implements Serializable
{
protected static Log log =
LogFactory.getLog(BeanDeserializer.class.getName());
@@ -288,7 +288,7 @@
// There may not be enough information yet to choose the
// specific deserializer.
if (dSer == null) {
- dSer = new DeserializerImpl();
+ dSer = new Deserializer();
// determine a default type for this child element
TypeMapping tm = context.getTypeMapping();
Class type = propDesc.getType();
@@ -310,7 +310,7 @@
collectionIndex));
}
}
- return (SOAPHandler)dSer;
+ return dSer;
}
public BeanPropertyDescriptor getObjectPropertyDesc(QName qname, DeserializationContext context) {
1.3 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/BeanSerializerFactory.java
Index: BeanSerializerFactory.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/BeanSerializerFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- BeanSerializerFactory.java 9 Mar 2002 19:29:48 -0000 1.2
+++ BeanSerializerFactory.java 24 May 2002 18:20:42 -0000 1.3
@@ -68,7 +68,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import org.apache.axis.utils.JavaUtils;
/**
* SerializerFactory for Bean
1.2 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/DateSerializerFactory.java
Index: DateSerializerFactory.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/DateSerializerFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DateSerializerFactory.java 26 Jan 2002 02:40:34 -0000 1.1
+++ DateSerializerFactory.java 24 May 2002 18:20:42 -0000 1.2
@@ -67,7 +67,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
/**
* SerializerFactory for Date primitives
*
1.7 +2 -2 xml-axis/java/src/org/apache/axis/encoding/ser/ElementDeserializer.java
Index: ElementDeserializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/ElementDeserializer.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ElementDeserializer.java 10 May 2002 17:23:17 -0000 1.6
+++ ElementDeserializer.java 24 May 2002 18:20:42 -0000 1.7
@@ -74,7 +74,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import org.apache.axis.utils.JavaUtils;
@@ -87,7 +87,7 @@
* @author Glen Daniels (gdaniels@macromedia.com)
* Modified by @author Rich scheuerle <sc...@us.ibm.com>
*/
-public class ElementDeserializer extends DeserializerImpl implements Deserializer
+public class ElementDeserializer extends Deserializer
{
protected static Log log =
LogFactory.getLog(ElementDeserializer.class.getName());
1.4 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/ElementSerializer.java
Index: ElementSerializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/ElementSerializer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ElementSerializer.java 7 May 2002 16:08:50 -0000 1.3
+++ ElementSerializer.java 24 May 2002 18:20:42 -0000 1.4
@@ -71,7 +71,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import org.apache.axis.utils.JavaUtils;
/**
1.2 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/ElementSerializerFactory.java
Index: ElementSerializerFactory.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/ElementSerializerFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ElementSerializerFactory.java 26 Jan 2002 02:40:34 -0000 1.1
+++ ElementSerializerFactory.java 24 May 2002 18:20:42 -0000 1.2
@@ -67,7 +67,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
/**
* SerializerFactory for Element
*
1.2 +2 -2 xml-axis/java/src/org/apache/axis/encoding/ser/EnumDeserializer.java
Index: EnumDeserializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/EnumDeserializer.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- EnumDeserializer.java 26 Jan 2002 02:40:34 -0000 1.1
+++ EnumDeserializer.java 24 May 2002 18:20:42 -0000 1.2
@@ -67,7 +67,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import java.beans.IntrospectionException;
import java.lang.reflect.Method;
@@ -77,7 +77,7 @@
* @author Rich Scheuerle <sc...@us.ibm.com>
* @author Sam Ruby <ru...@us.ibm.com>
*/
-public class EnumDeserializer extends SimpleDeserializer implements Deserializer {
+public class EnumDeserializer extends SimpleDeserializer {
private Method fromStringMethod = null;
1.4 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/EnumSerializer.java
Index: EnumSerializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/EnumSerializer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- EnumSerializer.java 25 Feb 2002 17:38:15 -0000 1.3
+++ EnumSerializer.java 24 May 2002 18:20:42 -0000 1.4
@@ -68,7 +68,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import org.apache.axis.InternalException;
import org.apache.axis.utils.JavaUtils;
1.2 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/EnumSerializerFactory.java
Index: EnumSerializerFactory.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/EnumSerializerFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- EnumSerializerFactory.java 26 Jan 2002 02:40:34 -0000 1.1
+++ EnumSerializerFactory.java 24 May 2002 18:20:42 -0000 1.2
@@ -67,7 +67,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
/**
* SerializerFactory for Enum
*
1.3 +2 -2 xml-axis/java/src/org/apache/axis/encoding/ser/HexDeserializer.java
Index: HexDeserializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/HexDeserializer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- HexDeserializer.java 8 Feb 2002 23:18:53 -0000 1.2
+++ HexDeserializer.java 24 May 2002 18:20:42 -0000 1.3
@@ -67,7 +67,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.Hex;
/**
@@ -77,7 +77,7 @@
* Modified by @author Rich scheuerle <sc...@us.ibm.com>
* @see <a href="http://www.w3.org/TR/xmlschema-2/#hexBinary">XML Schema 3.2.16</a>
*/
-public class HexDeserializer extends DeserializerImpl implements Deserializer {
+public class HexDeserializer extends Deserializer {
public QName xmlType;
public Class javaType;
1.5 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/HexSerializer.java
Index: HexSerializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/HexSerializer.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- HexSerializer.java 5 Apr 2002 16:15:37 -0000 1.4
+++ HexSerializer.java 24 May 2002 18:20:42 -0000 1.5
@@ -69,7 +69,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.Hex;
import org.w3c.dom.Element;
import org.w3c.dom.Document;
1.3 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/HexSerializerFactory.java
Index: HexSerializerFactory.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/HexSerializerFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- HexSerializerFactory.java 8 Feb 2002 23:18:53 -0000 1.2
+++ HexSerializerFactory.java 24 May 2002 18:20:42 -0000 1.3
@@ -67,7 +67,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
/**
* SerializerFactory for hexBinary.
*
1.5 +17 -24 xml-axis/java/src/org/apache/axis/encoding/ser/JAFDataHandlerDeserializer.java
Index: JAFDataHandlerDeserializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/JAFDataHandlerDeserializer.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- JAFDataHandlerDeserializer.java 15 Mar 2002 01:14:10 -0000 1.4
+++ JAFDataHandlerDeserializer.java 24 May 2002 18:20:42 -0000 1.5
@@ -55,44 +55,39 @@
package org.apache.axis.encoding.ser;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-import javax.xml.rpc.namespace.QName;
-import java.io.IOException;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.axis.encoding.Serializer;
-import org.apache.axis.encoding.SerializerFactory;
-import org.apache.axis.encoding.SerializationContext;
-import org.apache.axis.encoding.Deserializer;
-import org.apache.axis.encoding.DeserializerFactory;
+import org.apache.axis.attachments.AttachmentUtils;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
-
-import org.apache.axis.utils.JavaUtils;
-import org.apache.axis.Constants;
+import org.apache.axis.encoding.Deserializer;
import org.apache.axis.message.SOAPHandler;
-import org.apache.axis.attachments.AttachmentUtils;
+import org.apache.axis.utils.JavaUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+import javax.xml.rpc.namespace.QName;
/**
* JAFDataHandler Serializer
* @author Rick Rineholt
* Modified by Rich Scheuerle <sc...@us.ibm.com>
*/
-public class JAFDataHandlerDeserializer extends DeserializerImpl implements Deserializer {
-
+public class JAFDataHandlerDeserializer extends Deserializer {
protected static Log log =
LogFactory.getLog(JAFDataHandlerDeserializer.class.getName());
public void startElement(String namespace, String localName,
String qName, Attributes attributes,
DeserializationContext context)
- throws SAXException{
+ throws SAXException {
+
+ if (!context.isDoneParsing()) {
+ if (myElement == null) {
+ myElement = makeNewElement(namespace, localName, qName, attributes, context);
+ context.pushNewElement(myElement);
+ }
+ }
+// super.startElement(namespace, localName, qName, attributes, context);
QName type = context.getTypeFromAttributes(namespace,
localName,
@@ -125,7 +120,5 @@
throws SAXException {
throw new SAXException(JavaUtils.getMessage(
"noSubElements", namespace + ":" + localName));
-
-
}
}
1.6 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/JAFDataHandlerSerializer.java
Index: JAFDataHandlerSerializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/JAFDataHandlerSerializer.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- JAFDataHandlerSerializer.java 24 May 2002 12:53:18 -0000 1.5
+++ JAFDataHandlerSerializer.java 24 May 2002 18:20:42 -0000 1.6
@@ -68,7 +68,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import org.apache.axis.utils.JavaUtils;
import javax.activation.DataHandler;
1.2 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/JAFDataHandlerSerializerFactory.java
Index: JAFDataHandlerSerializerFactory.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/JAFDataHandlerSerializerFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- JAFDataHandlerSerializerFactory.java 26 Jan 2002 02:40:34 -0000 1.1
+++ JAFDataHandlerSerializerFactory.java 24 May 2002 18:20:42 -0000 1.2
@@ -76,7 +76,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
/**
* A JAFDataHandlerSerializer Factory
1.6 +5 -5 xml-axis/java/src/org/apache/axis/encoding/ser/MapDeserializer.java
Index: MapDeserializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/MapDeserializer.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- MapDeserializer.java 9 May 2002 18:30:45 -0000 1.5
+++ MapDeserializer.java 24 May 2002 18:20:42 -0000 1.6
@@ -71,7 +71,7 @@
import org.apache.axis.encoding.DeserializerTarget;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import org.apache.axis.utils.JavaUtils;
import org.apache.axis.Constants;
@@ -88,7 +88,7 @@
* @author Glen Daniels (gdaniels@macromedia.com)
* Modified by @author Rich scheuerle <sc...@us.ibm.com>
*/
-public class MapDeserializer extends DeserializerImpl implements Deserializer {
+public class MapDeserializer extends Deserializer {
protected static Log log =
LogFactory.getLog(MapDeserializer.class.getName());
@@ -186,7 +186,7 @@
* the values into the HashMap we're building.
*
*/
- class ItemHandler extends DeserializerImpl implements Deserializer {
+ class ItemHandler extends Deserializer {
Object key;
Object myValue;
int numSet = 0;
@@ -228,7 +228,7 @@
// If no deserializer, use the base DeserializerImpl.
if (dser == null)
- dser = new DeserializerImpl();
+ dser = new Deserializer();
// When the child value is ready, we
// want our set method to be invoked.
@@ -247,7 +247,7 @@
if (dt != null) {
dser.registerValueTarget(dt);
}
- return (SOAPHandler) dser;
+ return dser;
}
}
}
1.2 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/MapSerializerFactory.java
Index: MapSerializerFactory.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/MapSerializerFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MapSerializerFactory.java 26 Jan 2002 02:40:34 -0000 1.1
+++ MapSerializerFactory.java 24 May 2002 18:20:42 -0000 1.2
@@ -76,7 +76,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
/**
* A MapSerializer Factory
1.14 +2 -2 xml-axis/java/src/org/apache/axis/encoding/ser/SimpleDeserializer.java
Index: SimpleDeserializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/SimpleDeserializer.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- SimpleDeserializer.java 17 May 2002 19:09:35 -0000 1.13
+++ SimpleDeserializer.java 24 May 2002 18:20:42 -0000 1.14
@@ -58,7 +58,7 @@
import org.apache.axis.description.TypeDesc;
import org.apache.axis.encoding.DeserializationContext;
import org.apache.axis.encoding.Deserializer;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.SimpleType;
import org.apache.axis.encoding.TypeMapping;
import org.apache.axis.message.SOAPHandler;
@@ -85,7 +85,7 @@
* @author Sam Ruby (rubys@us.ibm.com)
* Modified for JAX-RPC @author Rich Scheuerle (scheu@us.ibm.com)
*/
-public class SimpleDeserializer extends DeserializerImpl {
+public class SimpleDeserializer extends Deserializer {
StringBuffer val = new StringBuffer();
private Constructor constructor = null;
1.2 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/SimpleNonPrimitiveSerializerFactory.java
Index: SimpleNonPrimitiveSerializerFactory.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/SimpleNonPrimitiveSerializerFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SimpleNonPrimitiveSerializerFactory.java 26 Jan 2002 02:40:34 -0000 1.1
+++ SimpleNonPrimitiveSerializerFactory.java 24 May 2002 18:20:42 -0000 1.2
@@ -67,7 +67,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
/**
* SerializerFactory for simple items that could be multi-refed (i.e. java.lang.Integer)
*
1.2 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/SimplePrimitiveSerializerFactory.java
Index: SimplePrimitiveSerializerFactory.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/SimplePrimitiveSerializerFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SimplePrimitiveSerializerFactory.java 26 Jan 2002 02:40:34 -0000 1.1
+++ SimplePrimitiveSerializerFactory.java 24 May 2002 18:20:42 -0000 1.2
@@ -67,7 +67,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
/**
* SerializerFactory for primitives that have Simple Serialization (i.e. int, short etc.)
*
1.6 +4 -4 xml-axis/java/src/org/apache/axis/encoding/ser/VectorDeserializer.java
Index: VectorDeserializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/VectorDeserializer.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- VectorDeserializer.java 9 May 2002 18:30:45 -0000 1.5
+++ VectorDeserializer.java 24 May 2002 18:20:42 -0000 1.6
@@ -70,7 +70,7 @@
import org.apache.axis.encoding.DeserializerTarget;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import org.apache.axis.utils.JavaUtils;
import org.apache.axis.Constants;
@@ -85,7 +85,7 @@
* @author Carsten Ziegeler (cziegeler@apache.org)
* Modified by @author Rich scheuerle <sc...@us.ibm.com>
*/
-public class VectorDeserializer extends DeserializerImpl implements Deserializer
+public class VectorDeserializer extends Deserializer
{
protected static Log log =
LogFactory.getLog(VectorDeserializer.class.getName());
@@ -165,7 +165,7 @@
dSer = context.getDeserializerForType(itemType);
}
if (dSer == null) {
- dSer = new DeserializerImpl();
+ dSer = new Deserializer();
}
// When the value is deserialized, inform us.
@@ -177,7 +177,7 @@
if (log.isDebugEnabled()) {
log.debug("Exit: VectorDeserializer::onStartChild()");
}
- return (SOAPHandler) dSer;
+ return dSer;
}
/**
1.2 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/VectorSerializer.java
Index: VectorSerializer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/VectorSerializer.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- VectorSerializer.java 21 Mar 2002 19:10:10 -0000 1.1
+++ VectorSerializer.java 24 May 2002 18:20:42 -0000 1.2
@@ -69,7 +69,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import org.apache.axis.utils.JavaUtils;
import java.io.IOException;
1.2 +1 -1 xml-axis/java/src/org/apache/axis/encoding/ser/VectorSerializerFactory.java
Index: VectorSerializerFactory.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/VectorSerializerFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- VectorSerializerFactory.java 21 Mar 2002 19:10:10 -0000 1.1
+++ VectorSerializerFactory.java 24 May 2002 18:20:42 -0000 1.2
@@ -76,7 +76,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
/**
* A VectorSerializer Factory
1.61 +15 -2 xml-axis/java/src/org/apache/axis/handlers/soap/SOAPService.java
Index: SOAPService.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/soap/SOAPService.java,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -r1.60 -r1.61
--- SOAPService.java 24 May 2002 15:38:23 -0000 1.60
+++ SOAPService.java 24 May 2002 18:20:43 -0000 1.61
@@ -77,7 +77,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.w3c.dom.Document;
-import org.xml.sax.SAXException;
import javax.xml.rpc.namespace.QName;
import java.io.FileInputStream;
@@ -109,7 +108,13 @@
/** Service-specific type mappings
*/
private TypeMappingRegistry tmr;
-
+
+ /**
+ * Does this service require a high-fidelity SAX recording of messages?
+ * (default is true)
+ */
+ private boolean highFidelityRecording = true;
+
/**
* Our ServiceDescription. Holds pretty much all the interesting
* metadata about this service.
@@ -387,5 +392,13 @@
if (validTransports != null) {
validTransports.removeElement(transportName);
}
+ }
+
+ public boolean needsHighFidelityRecording() {
+ return highFidelityRecording;
+ }
+
+ public void setHighFidelityRecording(boolean highFidelityRecording) {
+ this.highFidelityRecording = highFidelityRecording;
}
}
1.29 +28 -19 xml-axis/java/src/org/apache/axis/message/BodyBuilder.java
Index: BodyBuilder.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/BodyBuilder.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- BodyBuilder.java 16 May 2002 12:54:36 -0000 1.28
+++ BodyBuilder.java 24 May 2002 18:20:43 -0000 1.29
@@ -65,13 +65,11 @@
import org.apache.axis.description.OperationDesc;
import org.apache.axis.description.ServiceDesc;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.utils.JavaUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
-import javax.xml.soap.SOAPException;
import javax.xml.rpc.namespace.QName;
public class BodyBuilder extends SOAPHandler
@@ -94,17 +92,23 @@
DeserializationContext context)
throws SAXException
{
+ super.startElement(namespace, localName, qName, attributes, context);
if (!context.isDoneParsing()) {
- if (myElement == null) {
- myElement = new SOAPBody(namespace, localName, qName,
- attributes, context,
- envelope.getSOAPConstants());
- envelope.setBody((SOAPBody)myElement);
- }
- context.pushNewElement(myElement);
+ envelope.setBody((SOAPBody)myElement);
}
}
+ public MessageElement makeNewElement(String namespace, String localName,
+ String qName, Attributes attributes,
+ DeserializationContext context) {
+ return new SOAPBody(namespace,
+ localName,
+ qName,
+ attributes,
+ context,
+ context.getMessageContext().getSOAPConstants());
+ }
+
public SOAPHandler onStartChild(String namespace,
String localName,
String prefix,
@@ -153,14 +157,19 @@
gotRPCElement = true;
element = new RPCElement(namespace, localName, prefix,
attributes, context, operations);
-// * This will be a first cut at switching streaming deserialization back on. *
-// Only deserialize this way if there is a unique operation for this QName for
-// now. If there are overloads, we'll need to start recording.
-// if (operations != null && operations.length == 1) {
-// handler = new RPCHandler((RPCElement)element, false);
-// ((RPCHandler)handler).setOperation(operations[0]);
-// msgContext.setOperation(operations[0]);
-// }
+ // Only deserialize this way if there is a unique operation
+ // for this QName. If there are overloads,
+ // we'll need to start recording. If we're making a high-
+ // fidelity recording anyway, don't bother (for now).
+ if (!msgContext.isHighFidelity() &&
+ (operations == null || operations.length == 1)) {
+ ((RPCElement)element).setNeedDeser(false);
+ handler = new RPCHandler((RPCElement)element, false);
+ if (operations != null) {
+ ((RPCHandler)handler).setOperation(operations[0]);
+ msgContext.setOperation(operations[0]);
+ }
+ }
}
}
@@ -168,7 +177,7 @@
element = new SOAPBodyElement(namespace, localName, prefix,
attributes, context);
if (element.getFixupDeserializer() != null)
- handler = (SOAPHandler) element.getFixupDeserializer();
+ handler = element.getFixupDeserializer();
}
if (handler == null)
@@ -176,7 +185,7 @@
handler.myElement = element;
- //context.pushNewElement(element);
+ context.pushNewElement(element);
if (log.isDebugEnabled()) {
log.debug("Exit: BodyBuilder::onStartChild()");
1.18 +2 -4 xml-axis/java/src/org/apache/axis/message/EnvelopeBuilder.java
Index: EnvelopeBuilder.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/EnvelopeBuilder.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- EnvelopeBuilder.java 12 Apr 2002 09:46:36 -0000 1.17
+++ EnvelopeBuilder.java 24 May 2002 18:20:43 -0000 1.18
@@ -159,14 +159,12 @@
if (!gotBody)
throw new SAXException(JavaUtils.getMessage("noCustomElems00"));
- /*
- element = new MessageElement(namespace, localName, prefix,
+ MessageElement element = new MessageElement(namespace, localName, prefix,
attributes, context);
if (element.getFixupDeserializer() != null)
return element.getFixupDeserializer();
- */
-
+
return null;
}
1.11 +0 -3 xml-axis/java/src/org/apache/axis/message/HeaderBuilder.java
Index: HeaderBuilder.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/HeaderBuilder.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- HeaderBuilder.java 16 May 2002 12:54:36 -0000 1.10
+++ HeaderBuilder.java 24 May 2002 18:20:43 -0000 1.11
@@ -61,13 +61,10 @@
*/
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.utils.JavaUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
-
-import javax.xml.soap.SOAPException;
public class HeaderBuilder extends SOAPHandler
{
1.95 +29 -3 xml-axis/java/src/org/apache/axis/message/MessageElement.java
Index: MessageElement.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/MessageElement.java,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -r1.94 -r1.95
--- MessageElement.java 16 May 2002 12:54:36 -0000 1.94
+++ MessageElement.java 24 May 2002 18:20:43 -0000 1.95
@@ -203,6 +203,10 @@
// Register this ID with the context.....
if (id != null) {
context.registerElementByID(id, this);
+ if (recorder == null) {
+ recorder = new SAX2EventRecorder();
+ context.setRecorder(recorder);
+ }
}
href = attributes.getValue(Constants.ATTR_HREF);
@@ -237,6 +241,7 @@
public void setEndIndex(int endIndex)
{
endEventIndex = endIndex;
+ //context.setRecorder(null);
}
public boolean isDirty() { return _isDirty; }
@@ -249,6 +254,27 @@
public Attributes getAttributes() { return attributes; }
+ /**
+ * Obtain an Attributes collection consisting of all attributes
+ * for this MessageElement, including namespace declarations.
+ *
+ * @return
+ */
+ public Attributes getCompleteAttributes() {
+ if (namespaces == null)
+ return attributes;
+
+ AttributesImpl attrs = new AttributesImpl(attributes);
+ for (Iterator iterator = namespaces.iterator(); iterator.hasNext();) {
+ Mapping mapping = (Mapping) iterator.next();
+ String prefix = mapping.getPrefix();
+ String nsURI = mapping.getNamespaceURI();
+ attrs.addAttribute(Constants.NS_URI_XMLNS, prefix,
+ "xmlns:" + prefix, nsURI, "CDATA");
+ }
+ return attrs;
+ }
+
public String getName() { return( name ); }
public void setName(String name) { this.name = name; }
@@ -459,7 +485,7 @@
if (dser == null)
throw new Exception(JavaUtils.getMessage("noDeser00", "" + type));
- context.pushElementHandler(new EnvelopeHandler((SOAPHandler)dser));
+ context.pushElementHandler(new EnvelopeHandler(dser));
publishToHandler((org.xml.sax.ContentHandler) context);
@@ -800,7 +826,7 @@
throws SOAPException {
try {
addAttribute(name.getURI(), name.getLocalName(), value);
- } catch (Throwable t) {
+ } catch (RuntimeException t) {
throw new SOAPException(t);
}
return this;
@@ -812,7 +838,7 @@
try {
Mapping map = new Mapping(uri, prefix);
addMapping(map);
- } catch (Throwable t) {
+ } catch (RuntimeException t) {
throw new SOAPException(t);
}
return this;
1.56 +4 -0 xml-axis/java/src/org/apache/axis/message/RPCElement.java
Index: RPCElement.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/RPCElement.java,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- RPCElement.java 23 Apr 2002 16:25:38 -0000 1.55
+++ RPCElement.java 24 May 2002 18:20:43 -0000 1.56
@@ -147,6 +147,10 @@
return name;
}
+ public void setNeedDeser(boolean needDeser) {
+ this.needDeser = needDeser;
+ }
+
public void deserialize() throws SAXException
{
needDeser = false;
1.39 +5 -4 xml-axis/java/src/org/apache/axis/message/RPCHandler.java
Index: RPCHandler.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/RPCHandler.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- RPCHandler.java 10 May 2002 15:24:31 -0000 1.38
+++ RPCHandler.java 24 May 2002 18:20:43 -0000 1.39
@@ -65,7 +65,7 @@
import org.apache.axis.description.ParameterDesc;
import org.apache.axis.encoding.DeserializationContext;
import org.apache.axis.encoding.Deserializer;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.FieldTarget;
import org.apache.axis.utils.JavaUtils;
import org.apache.commons.logging.Log;
@@ -130,6 +130,7 @@
if (log.isDebugEnabled()) {
log.debug("Enter: RPCHandler.onStartChild()");
}
+
if (!context.isDoneParsing()) {
context.pushNewElement(new MessageElement(namespace,
localName, prefix+":"+localName,attributes,context));
@@ -213,7 +214,7 @@
"nil");
if ( isNil != null && isNil.equals("true") )
- return( (SOAPHandler) new DeserializerImpl() );
+ return( new Deserializer() );
Deserializer dser = null;
if ((type == null) && (namespace != null) && (!namespace.equals(""))) {
@@ -223,7 +224,7 @@
if (type != null) {
dser = context.getDeserializerForType(type);
} else {
- dser = new DeserializerImpl();
+ dser = new Deserializer();
}
}
@@ -239,7 +240,7 @@
if (log.isDebugEnabled()) {
log.debug("Exit: RPCHandler.onStartChild()");
}
- return (SOAPHandler) dser;
+ return dser;
}
public void endElement(String namespace, String localName,
1.17 +3 -10 xml-axis/java/src/org/apache/axis/message/SOAPBody.java
Index: SOAPBody.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPBody.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- SOAPBody.java 16 May 2002 12:54:36 -0000 1.16
+++ SOAPBody.java 24 May 2002 18:20:43 -0000 1.17
@@ -57,26 +57,19 @@
import org.apache.axis.AxisFault;
import org.apache.axis.Constants;
-import org.apache.axis.Message;
-import org.apache.axis.MessageContext;
import org.apache.axis.encoding.DeserializationContext;
import org.apache.axis.encoding.SerializationContext;
-import org.apache.axis.utils.JavaUtils;
import org.apache.axis.soap.SOAPConstants;
-
+import org.apache.axis.utils.JavaUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
import org.xml.sax.Attributes;
-import javax.xml.soap.SOAPElement;
+import javax.xml.rpc.namespace.QName;
import javax.xml.soap.Name;
+import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
-import javax.xml.rpc.namespace.QName;
-
-import java.util.ArrayList;
import java.util.Enumeration;
-import java.util.Iterator;
import java.util.Vector;
/**
1.67 +0 -1 xml-axis/java/src/org/apache/axis/message/SOAPEnvelope.java
Index: SOAPEnvelope.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPEnvelope.java,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- SOAPEnvelope.java 24 May 2002 08:00:09 -0000 1.66
+++ SOAPEnvelope.java 24 May 2002 18:20:43 -0000 1.67
@@ -72,7 +72,6 @@
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
-import org.xml.sax.helpers.AttributesImpl;
import javax.xml.soap.SOAPException;
import javax.xml.rpc.namespace.QName;
1.19 +1 -1 xml-axis/java/src/org/apache/axis/message/SOAPFaultBuilder.java
Index: SOAPFaultBuilder.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPFaultBuilder.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- SOAPFaultBuilder.java 2 Apr 2002 22:05:18 -0000 1.18
+++ SOAPFaultBuilder.java 24 May 2002 18:20:43 -0000 1.19
@@ -158,7 +158,7 @@
}
}
- return (SOAPHandler) currentDeser;
+ return currentDeser;
}
public void onEndChild(String namespace, String localName,
1.7 +13 -5 xml-axis/java/src/org/apache/axis/message/SOAPHandler.java
Index: SOAPHandler.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPHandler.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SOAPHandler.java 26 Jan 2002 02:47:22 -0000 1.6
+++ SOAPHandler.java 24 May 2002 18:20:43 -0000 1.7
@@ -75,13 +75,21 @@
{
// By default, make a new element
if (!context.isDoneParsing()) {
- if (myElement == null)
- myElement = new MessageElement(namespace, localName,
- qName, attributes, context);
- context.pushNewElement(myElement);
+ if (myElement == null) {
+ myElement = makeNewElement(namespace, localName, qName, attributes, context);
+ context.pushNewElement(myElement);
+ }
}
}
-
+
+ public MessageElement makeNewElement(String namespace, String localName,
+ String qName, Attributes attributes,
+ DeserializationContext context)
+ {
+ return new MessageElement(namespace, localName,
+ qName, attributes, context);
+ }
+
public void endElement(String namespace, String localName,
DeserializationContext context)
throws SAXException
1.2 +4 -5 xml-axis/java/test/encoding/DataDeser.java
Index: DataDeser.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/encoding/DataDeser.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DataDeser.java 26 Jan 2002 02:52:38 -0000 1.1
+++ DataDeser.java 24 May 2002 18:20:44 -0000 1.2
@@ -2,7 +2,7 @@
import org.apache.axis.encoding.DeserializationContext;
import org.apache.axis.encoding.Deserializer;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.FieldTarget;
import org.apache.axis.Constants;
import org.apache.axis.message.SOAPHandler;
@@ -10,10 +10,9 @@
import org.xml.sax.SAXException;
import javax.xml.rpc.namespace.QName;
-import java.io.IOException;
import java.util.Hashtable;
-public class DataDeser extends DeserializerImpl
+public class DataDeser extends Deserializer
{
public static final String STRINGMEMBER = "stringMember";
public static final String FLOATMEMBER = "floatMember";
@@ -34,7 +33,7 @@
* This method is invoked when an element start tag is encountered.
* @param namespace is the namespace of the element
* @param localName is the name of the element
- * @param qName is the prefixed qName of the element
+ * @param prefix is the prefix of the element
* @param attributes are the attributes on the element...used to get the type
* @param context is the DeserializationContext
*/
@@ -60,6 +59,6 @@
if (dSer == null)
throw new SAXException("No deserializer for a " + typeQName + "???");
- return (SOAPHandler) dSer;
+ return dSer;
}
}
1.2 +1 -1 xml-axis/java/test/encoding/DataDeserFactory.java
Index: DataDeserFactory.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/encoding/DataDeserFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DataDeserFactory.java 26 Jan 2002 02:52:38 -0000 1.1
+++ DataDeserFactory.java 24 May 2002 18:20:44 -0000 1.2
@@ -67,7 +67,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import org.apache.axis.Constants;
import java.util.Iterator;
1.2 +1 -1 xml-axis/java/test/encoding/DataSerFactory.java
Index: DataSerFactory.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/encoding/DataSerFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DataSerFactory.java 26 Jan 2002 02:52:38 -0000 1.1
+++ DataSerFactory.java 24 May 2002 18:20:44 -0000 1.2
@@ -67,7 +67,7 @@
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.DeserializationContext;
-import org.apache.axis.encoding.DeserializerImpl;
+import org.apache.axis.encoding.Deserializer;
import org.apache.axis.Constants;
import java.util.Iterator;
1.10 +1 -0 xml-axis/java/test/encoding/TestDOM.java
Index: TestDOM.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/encoding/TestDOM.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- TestDOM.java 21 Feb 2002 04:28:27 -0000 1.9
+++ TestDOM.java 24 May 2002 18:20:44 -0000 1.10
@@ -53,6 +53,7 @@
AxisEngine engine = new AxisServer();
engine.init();
MessageContext msgContext = new MessageContext(engine);
+ msgContext.setHighFidelity(true);
Message message = new Message(request);
message.setMessageContext(msgContext);
1.33 +0 -6 xml-axis/java/test/encoding/TestDeser.java
Index: TestDeser.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/encoding/TestDeser.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- TestDeser.java 13 May 2002 13:11:34 -0000 1.32
+++ TestDeser.java 24 May 2002 18:20:44 -0000 1.33
@@ -344,12 +344,6 @@
null);
}
- public static void main(String [] args) throws Exception
- {
- TestDeser tester = new TestDeser("test");
- tester.testString();
- }
-
// Complicated array tests
// type=soapenc:Array
1.16 +0 -10 xml-axis/java/test/encoding/TestHrefs.java
Index: TestHrefs.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/encoding/TestHrefs.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- TestHrefs.java 4 Dec 2001 20:31:07 -0000 1.15
+++ TestHrefs.java 24 May 2002 18:20:44 -0000 1.16
@@ -27,16 +27,6 @@
Constants.URI_CURRENT_SCHEMA_XSD);
}
- public static void main(String [] args)
- {
- TestHrefs tester = new TestHrefs("me");
- try {
- tester.testStringReference2();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
public TestHrefs(String name, String NS_XSI, String NS_XSD) {
super(name);
1.24 +0 -6 xml-axis/java/test/encoding/TestSer.java
Index: TestSer.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/encoding/TestSer.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- TestSer.java 13 May 2002 13:11:34 -0000 1.23
+++ TestSer.java 24 May 2002 18:20:44 -0000 1.24
@@ -30,12 +30,6 @@
public static final String myNS = "urn:myNS";
- public static void main(String [] args) throws Exception
- {
- TestSer tester = new TestSer("TestSer");
- tester.testRPCElement();
- }
-
public TestSer(String name) {
super(name);
}