axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dushshan...@apache.org
Subject cvs commit: ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal BeanParamWriter.java
Date Wed, 18 May 2005 05:39:45 GMT
dushshantha    2005/05/17 22:39:45

  Modified:    c/src/wsdl/org/apache/axis/wsdl/wsdl2ws ParamWriter.java
               c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp
                        BeanParamWriter.java
               c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal
                        BeanParamWriter.java
  Log:
  Done some modifications to support 'all' construct. And solution to the AXISCPP-652 - problem
in NilValuesTest.
  
  Revision  Changes    Path
  1.21      +4 -2      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.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- ParamWriter.java	16 May 2005 05:14:43 -0000	1.20
  +++ ParamWriter.java	18 May 2005 05:39:45 -0000	1.21
  @@ -232,9 +232,10 @@
                    * Dushshantha:
                    * if the element is a choice element,
                    * it should be defined as a pointer to an array.
  +                 * Chinthana: Same changes will need for the 'all' element
                    */
               	
  -            	if(attrib.getChoiceElement())
  +            	if(attrib.getChoiceElement() || attrib.getAllElement())
                   	return CUtils.getBasicArrayNameforType(attrib.getTypeName())+"*";
                   else
                   	return CUtils.getBasicArrayNameforType(attrib.getTypeName());
  @@ -256,8 +257,9 @@
                * Dushshantha:
                * If a simple type attribute is a choice element,
                * it should be defined as a pointer
  +             * Chinthana: Same changes will need for the 'all' element
                */
  -            	if(attrib.getChoiceElement())
  +            	if(attrib.getChoiceElement() || attrib.getAllElement())
               	{
               		String typename = attrib.getTypeName();
               		if (typename.equals("xsd__string")
  
  
  
  1.42      +54 -2     ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
  
  Index: BeanParamWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- BeanParamWriter.java	18 May 2005 03:50:53 -0000	1.41
  +++ BeanParamWriter.java	18 May 2005 05:39:45 -0000	1.42
  @@ -319,6 +319,19 @@
   				writer.write("(param->" + attribs[i].getParamNameAsMember()+ ")\n\t{\n\t");
   			}
   			//..............................................................................
  +			
  +			//Chinthana:
  +			//if the attribute is a 'all' following should do
  +			
  +			if(attribs[i].getAllElement())
  +			{
  +				if(attribs[i].getMinOccurs() == 0)
  +				{
  +					writer.write("\tif(param->" + attribs[i].getParamNameAsMember()+ ")\n\t{\n\t");
  +				}
  +			}
  +			//17/05/2005........................................................................
  +
   			if (attribs[i].isAnyType())
               {
                   writer.write("\tpSZ->serializeAnyObject(param->any);\n");
  @@ -443,7 +456,7 @@
                           		 * if the element is a choice element,
                           		 * it should be treated as a pointer
                           		 */
  -	                            if (attribs[i].getChoiceElement())
  +	                            if (attribs[i].getChoiceElement() || attribs[i].getAllElement())
   	                            	writer.write(
   	                            			"\tpSZ->serializeAsElement(\""
   	                            			+ attribs[i].getParamName()
  @@ -481,6 +494,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");
  +			}
  +			//17/05/2005.........................................
   
   			
   		}
  @@ -529,6 +550,7 @@
   		//const char* choiceName=pIWSDZ->peekNextElementName(); has been wriiten in the generated
cade.
   		boolean peekCalled = false;
           boolean firstIfWritten = false;
  +        boolean foundAll = false;
   
           for (int i = 0; i < attribs.length; i++)
           {
  @@ -559,6 +581,28 @@
               }
           	//.............................................
               
  +			//Chinthana:
  +			//if the attribute is a 'all' construct we have to check Min occures
  +			if(attribs[i].getAllElement())
  +			{
  +				if(attribs[i].getMinOccurs() == 0)
  +				{
  +					if(!foundAll)
  +					{
  +				        writer.write("\tconst char* allName = NULL;\n");
  +				        writer.write("\tbool peekCalled = false;\n");
  +				        foundAll = true;
  +					}
  +
  +					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");
  +				}
  +			}
  +			//17/05/2005...........................................................
               
           	if (attribs[i].isAnyType())
               {
  @@ -656,7 +700,7 @@
                       		 * it should be treated as a pointer.
                       		 */
                       		
  -                    		if(attribs[i].getChoiceElement())
  +                    		if(attribs[i].getChoiceElement() || attribs[i].getAllElement())
                       			writer.write(
                                           "\tparam->"
                                               + attribs[i].getParamNameAsMember() + " = (pIWSDZ->"
  @@ -712,6 +756,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");
  +			}
  +			//17/05/2005.........................................
   		}
           writer.write("\treturn pIWSDZ->getStatus();\n");
           writer.write("}\n");
  
  
  
  1.72      +31 -13    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.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- BeanParamWriter.java	16 May 2005 11:35:26 -0000	1.71
  +++ BeanParamWriter.java	18 May 2005 05:39:45 -0000	1.72
  @@ -286,10 +286,12 @@
   			
   			if(attribs[i].getAllElement())
   			{
  -				writer.write("\tif(param->" + attribs[i].getParamNameAsMember()+ ")\n\t{\n\t");
  -					
  +				if(attribs[i].getMinOccurs() == 0)
  +				{
  +					writer.write("\tif(param->" + attribs[i].getParamNameAsMember()+ ")\n\t{\n\t");
  +				}
   			}
  -			//12/05/2005........................................................................
  +			//17/05/2005........................................................................
   
   			if(attribs[i].isAnyType())
   			{
  @@ -306,9 +308,10 @@
   					 *Dushshantha:
   					 *If the element is a Choice,
   					 *It should be treated as a pointer to an array. 
  +					 *Chinthana: This is the same in 'all' element
   					 */
   					
  -					if(attribs[i].getChoiceElement())
  +					if(attribs[i].getChoiceElement() || attribs[i].getAllElement())
   						writer.write("\tpSZ->serializeBasicArray((Axis_Array*)(param->"+attribs[i].getParamName()+"),
Axis_URI_" + classname + ","+CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+", \""+attribs[i].getParamNameAsSOAPElement()+"\");\n");

   					else
   						writer.write("\tpSZ->serializeBasicArray((Axis_Array*)(&param->"+attribs[i].getParamName()+"),
Axis_URI_" + classname + ","+CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+", \""+attribs[i].getParamNameAsSOAPElement()+"\");\n");

  @@ -402,9 +405,10 @@
    				  * If the simple type is a choice 
    				  * it is handled as a pointer variable.
    				  * These variables should be defined as pointers in the header file.
  + 				  * Chinthana: This is the same in 'all' element
    				  */
    				 					
  - 					if(attribs[i].getChoiceElement())
  + 					if(attribs[i].getChoiceElement() || attribs[i].getAllElement())
    						writer.write("\tpSZ->serializeAsElement(\""+attribs[i].getSOAPElementNameAsString()+"\",
Axis_URI_" + classname + ", (void*)(param->"+attribs[i].getParamNameWithoutSymbols()+"),
"+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");
    					else
    						writer.write("\tpSZ->serializeAsElement(\""+attribs[i].getSOAPElementNameAsString()+"\",
Axis_URI_" + classname + ", (void*)&(param->"+attribs[i].getParamNameWithoutSymbols()+"),
"+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");	
  @@ -432,8 +436,11 @@
   			
   			//Chinthana: end if 
   			if(attribs[i].getAllElement())
  -				writer.write("\t}\n");
  -
  +			{
  +				if(attribs[i].getMinOccurs() == 0)
  +					writer.write("\t}\n");
  +			}
  +			//17/05/2005.........................................
   		
   		}
   		writer.write("\treturn AXIS_SUCCESS;\n");
  @@ -472,8 +479,7 @@
   		
   		boolean peekCalled=false;
           boolean firstIfWritten=false;
  -        writer.write("\tconst char* allName = NULL;\n");
  -        writer.write("\tbool peekCalled = false;\n");
  +        boolean foundAll = false;
   
   		for (int i = 0; i < attribs.length; i++)
   		{
  @@ -509,6 +515,13 @@
   			{
   				if(attribs[i].getMinOccurs() == 0)
   				{
  +					if(!foundAll)
  +					{
  +				        writer.write("\tconst char* allName = NULL;\n");
  +				        writer.write("\tbool peekCalled = false;\n");
  +				        foundAll = true;
  +					}
  +
   					writer.write("\n\tif(!peekCalled)\n\t{\n\t");
   					writer.write("\tallName=pIWSDZ->peekNextElementName();\n");
   					writer.write("\t\tpeekCalled = true;\n");
  @@ -550,9 +563,10 @@
   						 *Dushshantha:
   						 *If the element is a Choice,
   						 *It should be treated as a pointer to an array. 
  +						 *Chinthana: This is the same in 'all' element
   						 */
   						
  -						if(attribs[i].getChoiceElement())
  +						if(attribs[i].getChoiceElement() || attribs[i].getAllElement())
   							writer.write("\tparam->"+attribs[i].getParamNameAsMember()+"->m_Array = ("+attribs[i].getTypeName()+"**)new
"+attribs[i].getTypeName()+"*[array.m_Size];\n");
   						else
   							writer.write("\tparam->"+attribs[i].getParamNameAsMember()+".m_Array = ("+attribs[i].getTypeName()+"**)new
"+attribs[i].getTypeName()+"*[array.m_Size];\n");
  @@ -562,9 +576,11 @@
   					 *Dushshantha:
   					 *If the element is a Choice,
   					 *It should be treated as a pointer to an array. 
  +					 *Chinthana: This is the same in 'all' element
   					 */
   					
  -					if(attribs[i].getChoiceElement()){
  +					if(attribs[i].getChoiceElement() || attribs[i].getAllElement())
  +					{
   						writer.write("\tparam->"+attribs[i].getParamNameAsMember()+"->m_Size = array.m_Size;\n\n");
   						writer.write("\tmemcpy( param->"+attribs[i].getParamNameAsMember()+"->m_Array,
array.m_Array, sizeof( "+attribs[i].getTypeName()+") * array.m_Size);\n");
   					}
  @@ -647,8 +663,9 @@
   			      * If the simple type is a choice 
   			      * it is handled as a pointer variable.
   			      * These variables should be defined as pointers in the header file.
  +			      * Chinthana: This is the same in 'all' element
   			      */
  -					if(attribs[i].getChoiceElement())
  +					if(attribs[i].getChoiceElement() || attribs[i].getAllElement())
   						writer.write("\tparam->"+attribs[i].getParamNameAsMember()+" = pIWSDZ->"+CUtils.getParameterGetValueMethodName(attribs[i].getTypeName(),
attribs[i].isAttribute())+"( \""+ soapTagName +"\",0);\n");
   					else{	
   						writer.write("\t" + attribs[i].getTypeName() + " * " + attribs[i].getParamNameAsMember()+
" = NULL;\n");
  @@ -748,9 +765,10 @@
   				 * If the element is a Choice,
   				 * it sould be treated as a pointer to an array.
   				 * Memory should be allocated for that.
  +				 * Chinthana: This is the same in 'all' element
   				 */
   				
  -				if(attribs[i].getChoiceElement())
  +				if(attribs[i].getChoiceElement() || attribs[i].getAllElement())
   				{
   					writer.write("\t"+attribs[i].getParamNameAsMember()+" = new "+CUtils.getBasicArrayNameforType(attribs[i].getTypeName())+"();\n");
   					writer.write("\t"+attribs[i].getParamNameAsMember()+"->m_Array = 0;\n");
  
  
  

Mime
View raw message