axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nadira...@apache.org
Subject svn commit: r687483 - in /webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws: CUtils.java c/ParmHeaderFileWriter.java cpp/ClientStubHeaderWriter.java cpp/ClientStubWriter.java cpp/ParmHeaderFileWriter.java info/WSDLInfo.java
Date Wed, 20 Aug 2008 21:55:27 GMT
Author: nadiramra
Date: Wed Aug 20 14:55:26 2008
New Revision: 687483

URL: http://svn.apache.org/viewvc?rev=687483&view=rev
Log:
AXISCPP-1051 - Bad code generated for several Cisco Call Manager WSDL

Modified:
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubHeaderWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/WSDLInfo.java

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java?rev=687483&r1=687482&r2=687483&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java Wed Aug 20
14:55:26 2008
@@ -69,7 +69,7 @@
     };
     
     // Maps simple types to a QName.
-    private static Hashtable c_basicTypeToQNameMapper = new Hashtable();
+    public static Hashtable c_basicTypeToQNameMapper = new Hashtable();
     
     // Returns the initialization value string for a basic type.
     public static Hashtable c_initValueForBasicType = new Hashtable();
@@ -781,6 +781,19 @@
     }
     
     /**
+     * Returns boolean indicating whether name is a primitive type
+     * such as xsd__xxxx or xsdc__xxxxx.
+     * 
+     * @param qname
+     * @return
+     */
+    public static boolean isPrimitiveBasicType(String name)
+    {
+        return (c_basicTypeToQNameMapper.containsKey(name)
+                && (name.startsWith("xsd__") || name.startsWith("xsdc__")));
+    }
+    
+    /**
      * Method to determine if name passed in is that of a simple type. 
      * 
      * @param name

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java?rev=687483&r1=687482&r2=687483&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java
Wed Aug 20 14:55:26 2008
@@ -428,7 +428,7 @@
                 String basicType = attribs[i].getTypeName();
                 Type theType = attribs[i].getType();
 
-                if (theType.isRestriction() && !CUtils.isSimpleType(basicType))
+                if (theType.isRestriction() && !CUtils.isPrimitiveBasicType(basicType))
                     typeSet.add(basicType);
                 else if (!attribs[i].isSimpleType())
                 {
@@ -450,7 +450,7 @@
                 if (extBaseType.lastIndexOf("*") > -1)
                     extBaseType = extBaseType.substring(0, extBaseType.lastIndexOf("*"));
 
-                if (!CUtils.isSimpleType(extBaseType))
+                if (!CUtils.isPrimitiveBasicType(extBaseType))
                     typeSet.add(extBaseType);
             }            
             

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubHeaderWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubHeaderWriter.java?rev=687483&r1=687482&r2=687483&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubHeaderWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubHeaderWriter.java
Wed Aug 20 14:55:26 2008
@@ -140,30 +140,21 @@
 
                 //write parameter names 
                 Iterator params = minfo.getInputParameterTypes().iterator();
-                if (params.hasNext())
-                {
-                    ParameterInfo fparam = (ParameterInfo) params.next();
-                    String paramTypeName = CUtils.getClassNameFromParamInfoConsideringArrays(fparam,wscontext);
-                    if ((paramTypeName.lastIndexOf ("_Array") > 0)
-                            ||(CUtils.isSimpleType(paramTypeName)
-                                    && fparam.isNillable()
-                                    && !(CUtils.isPointerType(paramTypeName))))
-                        writer.write(paramTypeName + " * Value" + 0);
-                    else
-                        writer.write(paramTypeName + " Value" + 0);
-                }
-                
-                for (int j = 1; params.hasNext(); j++)
+                String commaSeperator = "";
+                for (int j = 0; params.hasNext(); j++)
                 {
                     ParameterInfo nparam = (ParameterInfo) params.next();
                     String paramTypeName = CUtils.getClassNameFromParamInfoConsideringArrays(nparam,
wscontext);
                     if ((paramTypeName.lastIndexOf ("_Array") > 0)
                             || (CUtils.isSimpleType(paramTypeName)
-                                    && nparam.isNillable()
+                                    && (nparam.isNillable() || nparam.isOptional())
                                     && !(CUtils.isPointerType(paramTypeName))))
-                        writer.write(", " + paramTypeName + " * Value" + j);
+                        writer.write(commaSeperator + paramTypeName + " * Value" + j);
                     else
-                        writer.write(", " + paramTypeName + " Value" + j);
+                        writer.write(commaSeperator + paramTypeName + " Value" + j);
+                    
+                    if (j==0)
+                        commaSeperator = ", ";
                 }
                 
                 if (isAllTreatedAsOutParams)

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java?rev=687483&r1=687482&r2=687483&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java
Wed Aug 20 14:55:26 2008
@@ -212,14 +212,25 @@
 
         if (returntype != null)
         {
-            outparamType = CUtils.getClassNameFromParamInfoConsideringArrays(returntype,
wscontext);
             retType = wscontext.getTypemap().getType(returntype.getSchemaName());
             if (retType != null)
             {
-                returntypeisarray = retType.isArray();
-                if (CUtils.isSimpleType(retType.getLanguageSpecificName()))
-                    returntypeissimple = true;
+                outparamType = CUtils.getClassNameFromParamInfoConsideringArrays(returntype,
wscontext);
+                if (retType.isSimpleType())
+                   returntypeissimple = true;
+                else
+                {
+                    returntypeissimple = CUtils.isSimpleType (outparamType);
+                    returntypeisarray = (outparamType.lastIndexOf ("_Array") > 0);
+                }
+            
+                returntypeisarray |= retType.isArray();
             }
+            else
+            {
+                outparamType = returntype.getLangName ();
+                returntypeissimple = CUtils.isSimpleType (outparamType);
+            } 
         }
 
         //=============================================================================
@@ -257,8 +268,8 @@
             
             typeissimple = CUtils.isSimpleType(paramTypeName);
             if (typeissimple
-                    && (!(((ParameterInfo) paramsB.get (0)).isNillable () 
-                            || ((ParameterInfo) paramsB.get (0)).isOptional())
+                    && (!(((ParameterInfo) paramsB.get (i)).isNillable () 
+                            || ((ParameterInfo) paramsB.get (i)).isOptional())
                     || CUtils.isPointerType(paramTypeName)))
                 writer.write (paramTypeName + " Value" + i);
             else if (paramTypeName.lastIndexOf ("*") > 0)

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java?rev=687483&r1=687482&r2=687483&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java
Wed Aug 20 14:55:26 2008
@@ -553,7 +553,7 @@
                 String basicType = attribs[i].getTypeName();
                 Type theType = attribs[i].getType();
                 
-                if (theType.isRestriction() && !CUtils.isSimpleType(basicType))
+                if (theType.isRestriction() && !CUtils.isPrimitiveBasicType(basicType))
                     typeSet.add(basicType);
                 else if (!attribs[i].isSimpleType())
                 {
@@ -575,7 +575,7 @@
                 if (extBaseType.lastIndexOf("*") > -1)
                     extBaseType = extBaseType.substring(0, extBaseType.lastIndexOf("*"));
 
-                if (!CUtils.isSimpleType(extBaseType))
+                if (!CUtils.isPrimitiveBasicType(extBaseType))
                     typeSet.add(extBaseType);
             }            
             

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/WSDLInfo.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/WSDLInfo.java?rev=687483&r1=687482&r2=687483&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/WSDLInfo.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/WSDLInfo.java Wed
Aug 20 14:55:26 2008
@@ -884,6 +884,7 @@
 
                 methodSuffix = (String)CUtils.c_basicTypeToMethodSuffixMapper.get(classForPrimitiveType);
                 CUtils.c_qnameToBasicTypeMapper.put(typedataQName, class4qname);
+                CUtils.c_basicTypeToQNameMapper.put(class4qname, typedataQName);
                 CUtils.c_basicTypeToEnumMapper.put(typedataLocalpart, primitiveXSDType);
 
                 if (initValueForType != null)
@@ -903,6 +904,7 @@
                     if (isPointerType)
                         CUtils.c_pointerBasedTypes.add(typedataLocalpartSanitized); 
                     CUtils.c_qnameToBasicTypeMapper.put(typedataQNameSanitized, class4qnameSanitized);
+                    CUtils.c_basicTypeToQNameMapper.put(class4qnameSanitized, typedataQNameSanitized);
                     CUtils.c_basicTypeToEnumMapper.put(typedataLocalpartSanitized, primitiveXSDType);
                     if (initValueForType != null)
                         CUtils.c_initValueForBasicType.put(typedataLocalpartSanitized, initValueForType);



Mime
View raw message