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 du...@apache.org on 2005/05/16 07:14:44 UTC
cvs commit: ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info AttributeInfo.java ElementInfo.java
dushshantha 2005/05/15 22:14:44
Modified: c/src/wsdl/org/apache/axis/wsdl/symbolTable
CElementDecl.java CSchemaUtils.java
c/src/wsdl/org/apache/axis/wsdl/wsdl2ws ParamWriter.java
WSDL2Ws.java
c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal
BeanParamWriter.java
c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info
AttributeInfo.java ElementInfo.java
Log:
Added support for the WSDL construct 'all'
Revision Changes Path
1.5 +21 -1 ws-axis/c/src/wsdl/org/apache/axis/wsdl/symbolTable/CElementDecl.java
Index: CElementDecl.java
===================================================================
RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/symbolTable/CElementDecl.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- CElementDecl.java 4 May 2005 10:36:57 -0000 1.4
+++ CElementDecl.java 16 May 2005 05:14:43 -0000 1.5
@@ -51,7 +51,13 @@
// indicate if the CElementDecl represents
// an xsd:choice element
private boolean choiceElement = false;
-
+
+ // Chinthana:
+ // indicate if the CElementDecl represents
+ // an xsd:all element
+ private boolean allElement = false;
+ //04/05/2005
+
/** Field documentation */
private String documentation;
@@ -117,6 +123,20 @@
this.choiceElement = choiceElement;
}
+ //Chinthana:
+ //setters and getters for allElement
+
+ public boolean getAllElement()
+ {
+ return this.allElement;
+ }
+
+ public void setAllElement(boolean allElement)
+ {
+ this.allElement = allElement;
+ }
+ //04/05/2005
+
/**
* @return
*/
1.5 +5 -0 ws-axis/c/src/wsdl/org/apache/axis/wsdl/symbolTable/CSchemaUtils.java
Index: CSchemaUtils.java
===================================================================
RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/symbolTable/CSchemaUtils.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- CSchemaUtils.java 4 May 2005 10:36:57 -0000 1.4
+++ CSchemaUtils.java 16 May 2005 05:14:43 -0000 1.5
@@ -830,6 +830,11 @@
if (elem != null)
{
+ //Chinthana
+ //indicates that this is an "all" element
+ elem.setAllElement(true);
+ if(elem.getAllElement())
+ //04/05/2005.................................
v.add(elem);
}
}
1.20 +9 -0 ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java
Index: ParamWriter.java
===================================================================
RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- ParamWriter.java 10 May 2005 09:37:07 -0000 1.19
+++ ParamWriter.java 16 May 2005 05:14:43 -0000 1.20
@@ -180,6 +180,15 @@
//..................................................
+ //Chinthana:
+ //setting the all element availability.
+ this.attribs[i].setAllElement(elem.getAllElement());
+ //04/05/2005..................................................
+ //setting the minoccures
+ this.attribs[i].setMinOccurs(elem.getMinOccurs());
+ //12/05/2005..................................................
+
+
if (elementType.isArray())
{ //soap encoding arrays.
1.59 +5 -0 ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java
Index: WSDL2Ws.java
===================================================================
RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- WSDL2Ws.java 4 May 2005 10:36:57 -0000 1.58
+++ WSDL2Ws.java 16 May 2005 05:14:43 -0000 1.59
@@ -1018,6 +1018,11 @@
eleinfo.setChoiceElement(elem.getChoiceElement());
//.................................................
+ // Chinthana:
+ // states whether this element is a xsd:all
+ eleinfo.setAllElement(elem.getAllElement());
+ //04/05/2005.................................................
+
typedata.setTypeNameForElementName(eleinfo);
}
}
1.70 +42 -3 ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
Index: BeanParamWriter.java
===================================================================
RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -r1.69 -r1.70
--- BeanParamWriter.java 13 May 2005 04:52:48 -0000 1.69
+++ BeanParamWriter.java 16 May 2005 05:14:44 -0000 1.70
@@ -196,8 +196,16 @@
writer.write("(param->" + attribs[i].getParamNameAsMember()+ ")\n\t{\n\t");
}
//..............................................................................
-
-
+
+ //Chinthana:
+ //if the attribute is a 'all' following should do
+
+ if(attribs[i].getAllElement())
+ {
+ writer.write("\tif(param->" + attribs[i].getParamNameAsMember()+ ")\n\t{\n\t");
+
+ }
+ //12/05/2005........................................................................
if(attribs[i].isAnyType())
{
@@ -337,6 +345,11 @@
if(attribs[i].getChoiceElement())
writer.write("\t}\n");
+
+ //Chinthana: end if
+ if(attribs[i].getAllElement())
+ writer.write("\t}\n");
+
}
writer.write("\treturn AXIS_SUCCESS;\n");
@@ -375,6 +388,8 @@
boolean peekCalled=false;
boolean firstIfWritten=false;
+ writer.write("\tconst char* allName = NULL;\n");
+ writer.write("\tbool peekCalled = false;\n");
for (int i = 0; i < attribs.length; i++)
{
@@ -403,6 +418,23 @@
}
//.............................................
+
+ //Chinthana:
+ //if the attribute is a 'all' construct we have to check Min occures
+ if(attribs[i].getAllElement())
+ {
+ if(attribs[i].getMinOccurs() == 0)
+ {
+ writer.write("\n\tif(!peekCalled)\n\t{\n\t");
+ writer.write("\tallName=pIWSDZ->peekNextElementName();\n");
+ writer.write("\t\tpeekCalled = true;\n");
+ writer.write("\t}\n");
+ writer.write("\tif(strcmp(allName,\"" + attribs[i].getParamNameAsMember()+ "\")==0)\n\t{\n\t");
+ writer.write("\tpeekCalled = false;\n\t");
+ }
+ }
+ //12/05/2005...........................................................
+
if( attribs[i].isAnyType())
{
writer.write("\tparam->any = pIWSDZ->getAnyObject();\n");
@@ -570,7 +602,14 @@
if(attribs[i].getChoiceElement())
writer.write("\t}\n");
-
+
+ //Chinthana: end if
+ if(attribs[i].getAllElement())
+ {
+ if(attribs[i].getMinOccurs() == 0)
+ writer.write("\t}\n");
+ }
+ //13/05/2005.........................................
}
if (extensionBaseAttrib != null && extensionBaseAttrib.getTypeName() != null)
1.10 +59 -0 ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/AttributeInfo.java
Index: AttributeInfo.java
===================================================================
RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/AttributeInfo.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- AttributeInfo.java 4 May 2005 10:36:59 -0000 1.9
+++ AttributeInfo.java 16 May 2005 05:14:44 -0000 1.10
@@ -30,15 +30,25 @@
private boolean isSimpleType = true;
private boolean isAttribute = false;
private boolean isOptional = false;
+ //Chinthana:To get Max and Min occures
+ private int maxOccurs = 1;
+ private int minOccurs = 1;
+ //12/05/2005...........................
private String typeName;
private String typeNamespace;
private String className;
private String attribNameAsMember;
+
//Dushshantha:
//this variable states whether the attribute is an xsd:choice
private boolean choiceElement = false;
+ //Chinthana:
+ //this variable states whether the attribute is an xsd:all
+ private boolean allElement = false;
+ //04/05/2005...............................................
+
/**
* @param type
* @param attribName
@@ -172,4 +182,53 @@
this.choiceElement=newChoiceElement;
}
//.................................................
+
+ //Chinthana:
+ //getter and setter for allElement
+
+ public boolean getAllElement()
+ {
+ return this.allElement;
+ }
+
+ public void setAllElement(boolean newAllElement)
+ {
+ this.allElement=newAllElement;
+ }
+ //04/05/2005.................................................
+ //Chinthana: Changes to do modification for handle Min and Max occures
+ /**
+ * @return int
+ */
+ public int getMaxOccurs()
+ {
+ return this.maxOccurs;
+ }
+
+ /**
+ * @return int
+ */
+ public int getMinOccurs()
+ {
+ return this.minOccurs;
+ }
+ /**
+ * Sets the maxOccurs.
+ * @param maxOccurs The maxOccurs to set
+ */
+ public void setMaxOccurs(int maxOccurs)
+ {
+ this.maxOccurs = maxOccurs;
+ }
+
+ /**
+ * Sets the minOccurs.
+ * @param minOccurs The minOccurs to set
+ */
+ public void setMinOccurs(int minOccurs)
+ {
+ this.minOccurs = minOccurs;
+ }
+ //12/05/2005
+
}
1.8 +21 -0 ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/ElementInfo.java
Index: ElementInfo.java
===================================================================
RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/ElementInfo.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ElementInfo.java 4 May 2005 10:36:59 -0000 1.7
+++ ElementInfo.java 16 May 2005 05:14:44 -0000 1.8
@@ -35,6 +35,12 @@
//this variable states whether this element is an xsd:choice or not
private boolean choiceElement = false;
//............................................
+
+ //Chinthana:
+ //this variable states whether this element is an xsd:all or not
+ private boolean allElement = false;
+ //............................................
+
public ElementInfo(QName name, Type type)
{
this.name = name;
@@ -161,5 +167,20 @@
this.choiceElement = newChoiceElement;
}
//.................................................
+
+ //Chinthana:
+ //getter and setter for the attribute allElement
+
+ public boolean getAllElement()
+ {
+ return this.allElement;
+ }
+
+ public void setAllElement( boolean newAllElement)
+ {
+ this.allElement = newAllElement;
+ }
+ //04/05/2005.................................................
+
}