Author: mmerz
Date: Mon Oct 25 11:13:23 2004
New Revision: 55520
Modified:
incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/AxisHook.java
incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/DropInDeploymentHandler.java
incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/util/encoding/XmlBeanSerializer.java
Log:
Fixed some Doc/Lit array serialization issues.
Minor Fix to XmlBean serialization.
Attempted to fix Bean Serialization when using Doc/Lit but some namspaces are
still showing up improperly. These namspace errors are ignored by the Axis
client but .NET clients fail silently. Jonathan will confer with AXIS
developers
to come up with a solution.
Contributor: Jonathan Colwell
Modified:
incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/AxisHook.java
==============================================================================
---
incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/AxisHook.java
(original)
+++
incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/AxisHook.java
Mon Oct 25 11:13:23 2004
@@ -35,16 +35,22 @@
import org.apache.axis.encoding.SerializerFactory;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.TypeMapping;
+import org.apache.axis.encoding.ser.ArraySerializerFactory;
+import org.apache.axis.encoding.ser.ArrayDeserializerFactory;
import org.apache.axis.encoding.ser.BeanDeserializerFactory;
import org.apache.axis.encoding.ser.BeanSerializerFactory;
import org.apache.axis.encoding.ser.VectorDeserializerFactory;
+import org.apache.axis.description.ElementDesc;
import org.apache.axis.description.FaultDesc;
+import org.apache.axis.description.FieldDesc;
import org.apache.axis.description.ServiceDesc;
+import org.apache.axis.description.TypeDesc;
import org.apache.axis.description.JavaServiceDesc;
import org.apache.axis.description.ParameterDesc;
import org.apache.axis.description.OperationDesc;
import org.apache.axis.utils.BeanPropertyDescriptor;
import org.apache.beehive.wsm.axis.badtiger.EnumWrapper;
+import org.apache.beehive.wsm.axis.util.encoding.ArraySpyFactory;
import org.apache.beehive.wsm.axis.util.encoding.CollectionSerializerFactory;
import org.apache.beehive.wsm.axis.util.encoding.XmlBeanSerializerFactory;
import org.apache.beehive.wsm.axis.util.encoding.XmlBeanDeserializerFactory;
@@ -116,7 +122,8 @@
od.setReturnQName(new QName(meth.getWrTargetNamespace(),
meth.getWrName()));
Class returnType = meth.getJavaReturnType();
- configureTypeMapping(sd, returnType);
+ QName type = configureTypeMapping(sd, returnType);
+ od.setReturnType(type);
od.setReturnClass(returnType);
//od.setReturnHeader(
}
@@ -202,20 +209,17 @@
return null;
}
- private static void configureTypeMapping(ServiceDesc desc, Class type)
+ private static QName configureTypeMapping(ServiceDesc desc, Class type)
throws InvalidTypeMappingException {
if (Void.TYPE.equals(type)) {
- // do nothing.
- }
- else if (type.isArray()) {
- configureTypeMapping(desc, type.getComponentType());
+ return null;
}
else {
TypeMapping tm = desc.getTypeMapping();
QName q = tm.getTypeQName(type);
-
+
if (Collection.class.isAssignableFrom(type)) {
/*
* NOTE [EMAIL PROTECTED] 2004-Oct-11 --
@@ -233,23 +237,27 @@
if (q == null) {
q = generateQName(type, desc);
}
+
+ if (type.isArray()) {
- if (! tm.isRegistered(type, q)) {
+ if (! tm.isRegistered(type, q)) {
+
+ tm.register(type, q,
+ new ArraySerializerFactory(type, q),
+ new ArrayDeserializerFactory());
-
+
+ }
+ q = configureTypeMapping(desc,
+ type.getComponentType());
+ }
+ else if (! tm.isRegistered(type, q)) {
+
if (XmlObject.class.isAssignableFrom(type)) {
q = XmlBeans.typeForClass(type).getName();
tm.register(type, q,
new XmlBeanSerializerFactory(type, q),
new XmlBeanDeserializerFactory(type, q));
-
- /*
- * FIXME [EMAIL PROTECTED] 2004-Oct-18 -- recursively
- * register classes inside the given XmlBean
- */
- // Method[] declared = type.getDeclaredMethods();
-
-
}
/*
* NOTE [EMAIL PROTECTED] 2004-Oct-11 -- these datahandler
@@ -314,7 +322,14 @@
* getAbsoluteFile and getCanonicalFile calls
*/
&& !File.class.isAssignableFrom(type)) {
-
+
+ /*
+ * NOTE [EMAIL PROTECTED] 2004-Oct-25 --
+ * tried adding some typedesc stuff to get the doc/lit
+ * namespaces working properly but it didn't help much.
+ */
+ //TypeDesc td = new TypeDesc(type);
+
tm.register( type, q,
new BeanSerializerFactory(type, q),
/*
@@ -334,10 +349,20 @@
if (!(subType.isPrimitive()
|| subType.getName().startsWith("java.")
|| subType.getName().startsWith("javax."))) {
-
+ /*
+ FieldDesc fd = new ElementDesc();
+ fd.setJavaType(subType);
+ fd.setFieldName(beanProps.getName());
+ fd.setXmlName(new QName("http://fake",
+ beanProps.getName()));
+ fd.setXmlType(*/
configureTypeMapping(desc, subType);
+ /*);
+ td.addFieldDesc(fd);
+ */
}
- }
+ }
+ //TypeDesc.registerTypeDescForClass(type, td);
}
else {
throw new InvalidTypeMappingException
@@ -347,6 +372,7 @@
}
}
}
+ return q;
}
}
Modified:
incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/DropInDeploymentHandler.java
==============================================================================
---
incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/DropInDeploymentHandler.java
(original)
+++
incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/DropInDeploymentHandler.java
Mon Oct 25 11:13:23 2004
@@ -56,6 +56,7 @@
import org.apache.axis.AxisProperties;
import org.apache.axis.Constants;
import org.apache.axis.MessageContext;
+import org.apache.axis.client.Call;
import org.apache.axis.components.compiler.Compiler;
import org.apache.axis.components.compiler.CompilerError;
import org.apache.axis.components.compiler.CompilerFactory;
@@ -70,6 +71,7 @@
import org.apache.axis.utils.Messages;
import org.apache.axis.utils.XMLUtils;
import org.apache.beehive.wsm.axis.HandlerHandler;
+import org.apache.beehive.wsm.axis.badtiger.EnumWrapper;
import org.apache.beehive.wsm.axis.util.ClasspathUtils;
import org.apache.commons.logging.Log;
import org.w3c.dom.Document;
@@ -111,6 +113,16 @@
ss.setEngine(mc.getAxisEngine());
ss.init();
mc.setService(ss);
+ /*
+ * NOTE [EMAIL PROTECTED] 2004-Oct-22 --
+ * not sure why, but xsi types were still being sent even
+ * with literal Use. Forcing it to not send the types unless
+ * encoded.
+ */
+ mc.setProperty(Call.SEND_TYPE_ATTR,
+ new Boolean(EnumWrapper.ENCODED
+ .equals(ss.getUse())));
+
// blow away the real path to bypass the regular JWSHandler
mc.removeProperty(Constants.MC_REALPATH);
}
Modified:
incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/util/encoding/XmlBeanSerializer.java
==============================================================================
---
incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/util/encoding/XmlBeanSerializer.java
(original)
+++
incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/util/encoding/XmlBeanSerializer.java
Mon Oct 25 11:13:23 2004
@@ -77,6 +77,7 @@
+ XmlObject.class.getName());
}
else {
+ context.setWriteXMLType(null);
context.startElement(name, attributes);
/*
XmlObject xObj = (XmlObject)value;