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 ia...@apache.org on 2003/12/19 11:12:11 UTC
cvs commit: ws-axis/java/src/org/apache/axis/encoding/ser ArraySerializer.java
ias 2003/12/19 02:12:11
Modified: java/src/org/apache/axis/encoding/ser ArraySerializer.java
Log:
Fix for Bug 25558 - Determine the QName of componet type from operation description first if possible
Revision Changes Path
1.51 +34 -1 ws-axis/java/src/org/apache/axis/encoding/ser/ArraySerializer.java
Index: ArraySerializer.java
===================================================================
RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/ser/ArraySerializer.java,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- ArraySerializer.java 25 Nov 2003 06:07:02 -0000 1.50
+++ ArraySerializer.java 19 Dec 2003 10:12:11 -0000 1.51
@@ -59,8 +59,12 @@
import org.apache.axis.Constants;
import org.apache.axis.MessageContext;
import org.apache.axis.components.logger.LogFactory;
+import org.apache.axis.description.OperationDesc;
+import org.apache.axis.description.ParameterDesc;
import org.apache.axis.encoding.SerializationContext;
import org.apache.axis.encoding.Serializer;
+import org.apache.axis.encoding.SerializerFactory;
+import org.apache.axis.encoding.TypeMapping;
import org.apache.axis.schema.SchemaVersion;
import org.apache.axis.soap.SOAPConstants;
import org.apache.axis.utils.JavaUtils;
@@ -155,7 +159,36 @@
// Get the QName of the componentType.
// If not found, look at the super classes
- QName componentQName = context.getQNameForClass(componentType);
+ QName componentQName = null;
+
+ // Try to get componentQName from operation description first.
+ MessageContext messageContext = context.getMessageContext();
+ if (messageContext != null) {
+ OperationDesc op = messageContext.getOperation();
+ if (op != null) {
+ QName typeQName = null;
+ ParameterDesc param = op.getParamByQName(name);
+ if (param == null) {
+ if (name.equals(op.getReturnQName())) {
+ typeQName = op.getReturnType();
+ }
+ }
+ else {
+ typeQName = param.getTypeQName();
+ }
+ TypeMapping tm = context.getTypeMapping();
+ SerializerFactory componentFactory = (SerializerFactory) tm.getSerializer(componentType, typeQName);
+ if (componentFactory != null && componentFactory instanceof SimpleSerializerFactory) {
+ SimpleSerializerFactory simpleComponentFactory = (SimpleSerializerFactory) componentFactory;
+ componentQName = simpleComponentFactory.getXMLType();
+ }
+ }
+ }
+
+ if (componentQName == null) {
+ componentQName = context.getQNameForClass(componentType);
+ }
+
if (componentQName == null) {
Class searchCls = componentType;
while(searchCls != null && componentQName == null) {