dims 2002/11/29 15:48:22 Modified: java/src/org/apache/axis/wsdl/fromJava Emitter.java java/src/org/apache/axis/encoding TypeMapping.java TypeMappingImpl.java Log: Fix for Bug 13459 - <wsdl:types> section does not include all types in TypeMapping from [EMAIL PROTECTED] (Robert Cauble) Revision Changes Path 1.77 +22 -0 xml-axis/java/src/org/apache/axis/wsdl/fromJava/Emitter.java Index: Emitter.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/fromJava/Emitter.java,v retrieving revision 1.76 retrieving revision 1.77 diff -u -r1.76 -r1.77 --- Emitter.java 4 Nov 2002 17:01:28 -0000 1.76 +++ Emitter.java 29 Nov 2002 23:48:22 -0000 1.77 @@ -600,6 +600,10 @@ return def; } + private static TypeMapping standardTypes = + (TypeMapping)new org.apache.axis.encoding.TypeMappingRegistryImpl().getTypeMapping(null); + + /** * Build a Types object and load the input wsdl types * @param def Corresponding wsdl Definition @@ -616,6 +620,24 @@ if (inputSchema != null) { types.loadInputSchema(inputSchema); } + + if (tm != null) + { + Class [] mappedTypes = tm.getAllClasses(); + for (int i = 0; i < mappedTypes.length; i++) + { + Class mappedType = mappedTypes[i]; + /** + * If it's a non-standard type, make sure it shows up in + * our WSDL + */ + if (standardTypes.getSerializer(mappedType) == null) + { + types.writeTypeForPart(mappedType,null); + } + } + } + return types; } 1.6 +5 -0 xml-axis/java/src/org/apache/axis/encoding/TypeMapping.java Index: TypeMapping.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/TypeMapping.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- TypeMapping.java 11 Jun 2002 14:53:54 -0000 1.5 +++ TypeMapping.java 29 Nov 2002 23:48:22 -0000 1.6 @@ -123,6 +123,11 @@ * @return javaType class or type */ public Class getClassForQName(QName xmlType); + + /** + * Returns an array of all the classes contained within this mapping + */ + public Class [] getAllClasses(); } 1.36 +14 -0 xml-axis/java/src/org/apache/axis/encoding/TypeMappingImpl.java Index: TypeMappingImpl.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/TypeMappingImpl.java,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- TypeMappingImpl.java 26 Sep 2002 17:04:00 -0000 1.35 +++ TypeMappingImpl.java 29 Nov 2002 23:48:22 -0000 1.36 @@ -653,4 +653,18 @@ public void setDoAutoTypes(boolean doAutoTypes) { this.doAutoTypes = doAutoTypes; } + + /** + * Returns an array of all the classes contained within this mapping + */ + public Class [] getAllClasses() + { + java.util.HashSet temp = new java.util.HashSet(); + if (delegate != null) + { + temp.addAll(java.util.Arrays.asList(delegate.getAllClasses())); + } + temp.addAll(class2Pair.keySet()); + return (Class[])temp.toArray(new Class[temp.size()]); + } }