axis-c-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nadira...@apache.org
Subject svn commit: r1446448 - in /axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl: symbolTable/CContainedAttribute.java symbolTable/CSchemaUtils.java wsdl2ws/CUtils.java wsdl2ws/ParamWriter.java wsdl2ws/c/BeanParamWriter.java wsdl2ws/info/ParameterInfo.java
Date Fri, 15 Feb 2013 05:32:05 GMT
Author: nadiramra
Date: Fri Feb 15 05:32:05 2013
New Revision: 1446448

URL: http://svn.apache.org/r1446448
Log:
AXISCPP-1092 Generated code for attribute with no type assigned fails to compile 

Modified:
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/symbolTable/CContainedAttribute.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/symbolTable/CSchemaUtils.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/ParameterInfo.java

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/symbolTable/CContainedAttribute.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/symbolTable/CContainedAttribute.java?rev=1446448&r1=1446447&r2=1446448&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/symbolTable/CContainedAttribute.java
(original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/symbolTable/CContainedAttribute.java
Fri Feb 15 05:32:05 2013
@@ -22,6 +22,10 @@ import org.apache.axis.wsdl.symbolTable.
 import org.apache.axis.wsdl.symbolTable.SymbolTable;
 import org.apache.axis.wsdl.wsdl2ws.info.Type;
 
+/**
+ * 
+ *
+ */
 public class CContainedAttribute 
 {
     /** Field qname - the qname. Immutable, no setter for  it. */
@@ -38,6 +42,12 @@ public class CContainedAttribute 
     
     /** Field optional - is attribute optional? */
     private boolean optional = false;
+    
+    /** Field fixedValue - corresponds to fixed attribute value */
+    private String fixedValue = null;
+    
+    /** Field defaultValue - corresponds to default attribute value */
+    private String defaultValue = null;
 
     protected CContainedAttribute(TypeEntry typeEntry, QName qname) {
         this.qname     = qname;
@@ -76,4 +86,31 @@ public class CContainedAttribute 
         return optional;
     }
 
+    /**
+     * @param s fixed value
+     */
+    public void setFixedValue(String s) {
+        fixedValue = s;        
+    }
+
+    /**
+     * @return the fixedValue
+     */
+    public String getFixedValue() {
+        return fixedValue;
+    }
+    
+    /**
+     * @param s default value
+     */
+    public void setDefaultValue(String s) {
+        defaultValue = s;
+    }
+
+    /**
+     * @return the default value if there is one, or null;
+     */
+    public String getDefaultValue() {
+        return defaultValue;
+    }
 }

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/symbolTable/CSchemaUtils.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/symbolTable/CSchemaUtils.java?rev=1446448&r1=1446447&r2=1446448&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/symbolTable/CSchemaUtils.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/symbolTable/CSchemaUtils.java Fri Feb
15 05:32:05 2013
@@ -1717,10 +1717,17 @@ public class CSchemaUtils extends Schema
             CContainedAttribute attr = new CContainedAttribute(type, attributeName);
 
             String useValue = Utils.getAttribute(child, "use");
-    
             if (useValue != null) 
                 attr.setOptional(useValue.equalsIgnoreCase("optional"));
-    
+            
+            String fixedValue = Utils.getAttribute(child, "fixed");
+            if (fixedValue != null)
+                attr.setFixedValue(fixedValue);
+            
+            String defaultValue = Utils.getAttribute(child, "default");
+            if (defaultValue != null)
+                attr.setDefaultValue(defaultValue);
+
             v.add(attr);
         }
     }

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java?rev=1446448&r1=1446447&r2=1446448&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java Fri Feb 15 05:32:05
2013
@@ -877,6 +877,15 @@ public class CUtils 
     public static String getDeserializerMethodName(String typeName, boolean isAttrib)
     {
         String methodname = (String)c_simpleTypeToMethodSuffixMapper.get(typeName);
+        
+        // for attributes that are not defined with a type, just treat as string. Here
+        // is an example: 
+        //   <s:attribute fixed="http://tempuri.org/DStruttura.xsd" name="namespace" />
+        // The above translates to anyType, but since we do not have such a method
+        // for attributes, just treat as a string.
+        if (isAttrib && methodname.equals("AnyType"))
+            methodname = "String";
+        
         methodname = (isAttrib ? c_getAttributeAs : c_getElementAs) + methodname;
         return methodname;
     }

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java?rev=1446448&r1=1446447&r2=1446448&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java Fri Feb 15 05:32:05
2013
@@ -142,7 +142,9 @@ public abstract class ParamWriter extend
             this.attribs[i].setType(attr.getType());
             this.attribs[i].setAttribute(true);
             this.attribs[i].setElementName(attr.getType().getName());
-            this.attribs[i].setOptional(attr.isOptional());           
+            this.attribs[i].setOptional(attr.isOptional()); 
+            this.attribs[i].setAttributeFixedValue(attr.getFixedValue());
+            this.attribs[i].setAttributeDefaultValue(attr.getDefaultValue());
         }
 
         for (int i = intAttrFieldSz; i < intAttrFieldSz + intEleFieldSz; i++)

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java?rev=1446448&r1=1446447&r2=1446448&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java Fri Feb
15 05:32:05 2013
@@ -682,9 +682,8 @@ public class BeanParamWriter extends Par
                     c_writer.write(tab2 + "param->"
                             + attribs[i].getParamNameAsMember() + " = "
                             + "axiscSoapDeSerializer"
-                            + CUtils.getDeserializerMethodName(
-                                    attribs[i].getTypeName(), attribs[i].isAttribute()) +
"(pDZ, \""
-                            + soapTagName + "\",0);\n");
+                            + CUtils.getDeserializerMethodName(attribs[i].getTypeName(),
attribs[i].isAttribute()) 
+                            + "(pDZ, \"" + soapTagName + "\",0);\n");                   

                 }                
                 else
                 {

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/ParameterInfo.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/ParameterInfo.java?rev=1446448&r1=1446447&r2=1446448&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/ParameterInfo.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/ParameterInfo.java Fri Feb
15 05:32:05 2013
@@ -41,7 +41,9 @@ public class ParameterInfo
     private boolean isAttribute = false;
     private boolean isNillable = false;
     private boolean isOptional = false;
-    
+    private String  attributeDefaultValue = null;
+    private String  attributeFixedValue = null;
+
     private boolean isSimpleType = true;
 
     private int maxOccurs = 1;
@@ -361,4 +363,36 @@ public class ParameterInfo
     {
         this.minOccurs = minOccurs;
     }
+
+    /**
+     * @return default or fixed attribute value
+     */
+    public String getAttributeDefaultValue()
+    {
+        return attributeDefaultValue;
+    }
+    
+    /**
+     * @param s attribute default or fixed value
+     */
+    public void setAttributeDefaultValue(String s)
+    {
+        attributeDefaultValue = s;
+    }
+    
+    /**
+     * @return default or fixed attribute value
+     */
+    public String getAttributeFixedValue()
+    {
+        return attributeFixedValue;
+    }
+    
+    /**
+     * @param s attribute default or fixed value
+     */
+    public void setAttributeFixedValue(String s)
+    {
+        attributeFixedValue = s;
+    }
 }



Mime
View raw message