axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sanj...@apache.org
Subject cvs commit: ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp WrapWriter.java ParamWriter.java ClientStubWriter.java BeanParamWriter.java ArrayParamWriter.java
Date Tue, 16 Dec 2003 10:37:16 GMT
sanjaya     2003/12/16 02:37:16

  Modified:    c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp Tag:
                        CWrapperSupport WrapWriter.java ParamWriter.java
                        ClientStubWriter.java BeanParamWriter.java
                        ArrayParamWriter.java
  Log:
  modified to reflect the structural changes
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.10.4.4  +2 -2      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapWriter.java
  
  Index: WrapWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapWriter.java,v
  retrieving revision 1.10.4.3
  retrieving revision 1.10.4.4
  diff -u -r1.10.4.3 -r1.10.4.4
  --- WrapWriter.java	21 Nov 2003 12:48:12 -0000	1.10.4.3
  +++ WrapWriter.java	16 Dec 2003 10:37:16 -0000	1.10.4.4
  @@ -246,7 +246,7 @@
   				//for simple types	
   				writer.write("\t"+paraTypeName+" v"+i+" = pIWSDZ->"+CPPUtils.getParameterGetValueMethodName(paraTypeName)+";\n");
   			}else if((type = this.wscontext.getTypemap().getType(((ParameterInfo)paramsB.get(i)).getSchemaName()))
!= null && type.isArray()){
  -				QName qname = type.getTypNameForAttribName("item");
  +				QName qname = WrapperUtils.getArrayType(type).getName();
   				String containedType = null;
   				if (CPPUtils.isSimpleType(qname)){
   					containedType = CPPUtils.getclass4qname(qname);
  @@ -284,7 +284,7 @@
   			if (returntypeissimple){
   				writer.write("\treturn pIWSSZ->AddOutputParam(\""+methodName+"Return\", ret, "+CPPUtils.getXSDTypeForBasicType(outparamType)+");\n");
   			}else if(returntypeisarray){
  -				QName qname = retType.getTypNameForAttribName("item");
  +				QName qname = WrapperUtils.getArrayType(retType).getName();
   				String containedType = null;
   				if (CPPUtils.isSimpleType(qname)){
   					containedType = CPPUtils.getclass4qname(qname);
  
  
  
  1.3.4.2   +58 -23    ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParamWriter.java
  
  Index: ParamWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParamWriter.java,v
  retrieving revision 1.3.4.1
  retrieving revision 1.3.4.2
  diff -u -r1.3.4.1 -r1.3.4.2
  --- ParamWriter.java	14 Nov 2003 12:04:23 -0000	1.3.4.1
  +++ ParamWriter.java	16 Dec 2003 10:37:16 -0000	1.3.4.2
  @@ -109,35 +109,70 @@
       }
      
    	/* genarate the arrtibs array */
  -    public String[][] getAttribList(String Qualifiedname) throws WrapperFault {
  -        String[][] attribs;
  -        ArrayList feilds = new ArrayList();
  +	public String[][] getAttribList(String Qualifiedname) throws WrapperFault {
  +		String[][] attribs;
  +		ArrayList attribfeilds = new ArrayList();
  +		ArrayList elementfeilds = new ArrayList();
   
  -        Enumeration names = type.getAttribNames();
  -        while (names.hasMoreElements()){
  -            feilds.add(names.nextElement());
  -
  -        }
  -        //get all the fields
  +		Enumeration names = type.getAttributeNames();
  +		while (names.hasMoreElements()){
  +			attribfeilds.add(names.nextElement());
  +		}
  +        
  +		names = type.getElementnames();
  +				while (names.hasMoreElements()){
  +					elementfeilds.add(names.nextElement());
  +		}
  +        
  +        
  +		//get all the fields
     
  -        attribs = new String[feilds.size()][];
  -        for (int i = 0; i < feilds.size(); i++) {
  -            attribs[i] = new String[4];
  -            attribs[i][0] = ((String) feilds.get(i));
  +		attribs = new String[attribfeilds.size()+elementfeilds.size()][];
  +		for (int i = 0; i < attribfeilds.size(); i++) {
  +			//[variablename,typename,typeQNameURI,typeQNamelocalpart,attributeTypeURI,attributeTypeLocalpart]
  +			attribs[i] = new String[6];
  +			attribs[i][0] = ((String) attribfeilds.get(i));
  +   
  +			Type attribType = type.getTypForAttribName(attribs[i][0]);
  +            
  +			if(CPPUtils.isSimpleType(attribType.getName()))
  +				attribs[i][1] = CPPUtils.getclass4qname(attribType.getName());
  +			else
  +				attribs[i][1] = attribType.getLanguageSpecificName();
  +
  +			attribs[i][2] = attribType.getName().getNamespaceURI();
  +			attribs[i][3] = attribType.getName().getLocalPart();
  +
  +			attribs[i][4] = null;
  +			attribs[i][5] = null;
  +		}
  +        
  +		for (int i = attribfeilds.size(); i < elementfeilds.size()+attribfeilds.size(); i++)
{
  +			attribs[i] = new String[6];
  +			attribs[i][0] = ((String) elementfeilds.get(i));
      
  -            QName name = type.getTypNameForAttribName(attribs[i][0]);
  +			Type elementType = type.getElementForElementName(attribs[i][0]).getType();
               
  -            if(CPPUtils.isSimpleType(name))
  -                attribs[i][1] = CPPUtils.getclass4qname(name);
  -            else
  -           		attribs[i][1] = this.wscontext.getTypemap().getType(name).getLanguageSpecificName();
  +			if(CPPUtils.isSimpleType(elementType.getName()))
  +				attribs[i][1] = CPPUtils.getclass4qname(elementType.getName());
  +			else
  +				attribs[i][1] = elementType.getLanguageSpecificName();
   
  -		   attribs[i][2] = name.getNamespaceURI();
  -		   attribs[i][3] = name.getLocalPart();
  +		   attribs[i][2] = elementType.getName().getNamespaceURI();
  +		   attribs[i][3] = elementType.getName().getLocalPart();
  +		   if(elementType.isArray()){
  +				Type arrayType = WrapperUtils.getArrayType(elementType);
  +				attribs[i][4] = arrayType.getName().getNamespaceURI();
  +				attribs[i][5] = arrayType.getName().getLocalPart();
  +		   }else{
  +				attribs[i][4] = null;
  +				attribs[i][5] = null;
  +		   }
  +		}
   
  -        }
  -        return attribs;
  -    }
  +        
  +		return attribs;
  +	}
       
    	protected String getCorrectParmNameConsideringArraysAndComplexTypes(QName name,String
classname)throws WrapperFault{
   		//System.out.println(name);
  
  
  
  1.15.4.3  +2 -2      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java
  
  Index: ClientStubWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java,v
  retrieving revision 1.15.4.2
  retrieving revision 1.15.4.3
  diff -u -r1.15.4.2 -r1.15.4.3
  --- ClientStubWriter.java	21 Nov 2003 12:48:12 -0000	1.15.4.2
  +++ ClientStubWriter.java	16 Dec 2003 10:37:16 -0000	1.15.4.3
  @@ -277,7 +277,7 @@
   			writer.write("\tm_pCall->AddParameter(");			
   			if(typeisarray){
   				//arrays
  -				QName qname = type.getTypNameForAttribName("item");
  +				QName qname = WrapperUtils.getArrayType(type).getName();
   				String containedType = null;
   				if (CPPUtils.isSimpleType(qname)){
   					containedType = CPPUtils.getclass4qname(qname);
  @@ -303,7 +303,7 @@
   			writer.write("\tm_pCall->UnInitialize();\n");
   		}
   		else if (returntypeisarray){
  -			QName qname = retType.getTypNameForAttribName("item");
  +			QName qname = WrapperUtils.getArrayType(retType).getName();
   			String containedType = null;
   			if (CPPUtils.isSimpleType(qname)){
   				containedType = CPPUtils.getclass4qname(qname);
  
  
  
  1.9.4.4   +22 -18    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.9.4.3
  retrieving revision 1.9.4.4
  diff -u -r1.9.4.3 -r1.9.4.4
  --- BeanParamWriter.java	21 Nov 2003 12:48:12 -0000	1.9.4.3
  +++ BeanParamWriter.java	16 Dec 2003 10:37:16 -0000	1.9.4.4
  @@ -67,6 +67,7 @@
   import javax.xml.namespace.QName;
   
   import org.apache.axis.wsdl.wsdl2ws.WrapperFault;
  +import org.apache.axis.wsdl.wsdl2ws.WrapperUtils;
   import org.apache.axis.wsdl.wsdl2ws.info.Type;
   import org.apache.axis.wsdl.wsdl2ws.info.WebServiceContext;
   
  @@ -88,9 +89,10 @@
   		String typeName;
   		for(int i = 0; i< attribs.length;i++){
   			if(!CPPUtils.isSimpleType(attribs[i][1])){
  -				Type memtype = wscontext.getTypemap().getType(type.getTypNameForAttribName(attribs[i][0]));
  -				if (memtype.isArray()){
  -					QName qname = memtype.getTypNameForAttribName("item");
  +				//to understand what happens here please refer to where the 
  +				//attribs[][] is created. (ParamWriter) 		
  +				if (attribs[i][5] != null){
  +					QName qname = new QName(attribs[i][4],attribs[i][5]);
   					if (CPPUtils.isSimpleType(qname)) continue; //no wrapper methods for basic types
   					typeName = qname.getLocalPart();
   				}else{
  @@ -124,7 +126,7 @@
   		writer.write(" */\n");
   		writer.write("int Axis_GetSize_"+classname+"()\n{\n\treturn sizeof("+classname+");\n}\n");
   	}
  -	private void writeSerializeGlobalMethod()throws IOException{
  +	private void writeSerializeGlobalMethod()throws IOException,WrapperFault{
   		Type t;
   		writer.write("/*\n");
   		writer.write(" * This static method serialize a "+classname+" type of object\n");
  @@ -153,7 +155,7 @@
   				writer.write("\tpSZ->Serialize(pSZ->SerializeBasicType(\""+attribs[i][0]+"\",
param->"+attribs[i][0]+", "+ CPPUtils.getXSDTypeForBasicType(attribs[i][1])+"), NULL);\n");
   			}else if((t = wscontext.getTypemap().getType(new QName(attribs[i][2],attribs[i][3])))!=
null && t.isArray()){
   				//if Array
  -				QName qname = t.getTypNameForAttribName("item");
  +				QName qname = WrapperUtils.getArrayType(t).getName();
   				String arrayType = null;
   				if (CPPUtils.isSimpleType(qname)){
   					arrayType = CPPUtils.getclass4qname(qname);
  @@ -175,7 +177,7 @@
   		writer.write("}\n\n");
   	
   	}
  -	private void writeDeSerializeGlobalMethod()throws IOException{	
  +	private void writeDeSerializeGlobalMethod()throws IOException,WrapperFault{	
   		Type t;
   		writer.write("/*\n");
   		writer.write(" * This static method deserialize a "+classname+" type of object\n");
  @@ -193,7 +195,7 @@
   				writer.write("\tparam->"+attribs[i][0]+" = pIWSDZ->"+CPPUtils.getParameterGetValueMethodName(attribs[i][1])+";\n");
   			}else if((t = wscontext.getTypemap().getType(new QName(attribs[i][2],attribs[i][3])))!=
null && t.isArray()){
   				//if Array
  -				QName qname = t.getTypNameForAttribName("item");
  +				QName qname = WrapperUtils.getArrayType(t).getName();
   				String arrayType = null;
   				if (CPPUtils.isSimpleType(qname)){
   					arrayType = CPPUtils.getclass4qname(qname);
  @@ -247,9 +249,10 @@
   			writer.write("\t\t{\n");
   			for(int i = 0; i< attribs.length;i++){
   				if(!CPPUtils.isSimpleType(attribs[i][1])){ //this can be either an array or complex
type
  -					Type memtype = wscontext.getTypemap().getType(type.getTypNameForAttribName(attribs[i][0]));
  -					if (memtype.isArray()){
  -						QName qname = memtype.getTypNameForAttribName("item");
  +					//to understand what happens here please refer to where the 
  +					//attribs[][] is created. (ParamWriter) 		
  +					if (attribs[i][5] != null){
  +						QName qname = new QName(attribs[i][4],attribs[i][5]);
   						String containedType = null;
   						if (CPPUtils.isSimpleType(qname)){
   							containedType = CPPUtils.getclass4qname(qname);
  @@ -274,14 +277,15 @@
   		writer.write("\t\t/*delete any pointer members or array members of this struct here*/\n");
   		for(int i = 1; i< attribs.length;i++){
   			if(!CPPUtils.isSimpleType(attribs[i][1])){
  -				Type memtype = wscontext.getTypemap().getType(type.getTypNameForAttribName(attribs[i][0]));
  -				if (memtype.isArray()){
  -					QName qname = memtype.getTypNameForAttribName("item");
  -					String containedType = null;
  -					if (CPPUtils.isSimpleType(qname)){
  -						containedType = CPPUtils.getclass4qname(qname);
  -						writer.write("\t\tdelete [] (("+containedType+"*)param->"+attribs[i][0]+".m_Array);\n");
  -					}
  +				//to understand what happens here please refer to where the 
  +					//attribs[][] is created. (ParamWriter) 		
  +					if (attribs[i][5] != null){
  +						QName qname = new QName(attribs[i][4],attribs[i][5]);
  +						String containedType = null;
  +						if (CPPUtils.isSimpleType(qname)){
  +							containedType = CPPUtils.getclass4qname(qname);
  +							writer.write("\t\tdelete [] (("+containedType+"*)param->"+attribs[i][0]+".m_Array);\n");
  +						}
   					else{
   						containedType = qname.getLocalPart();
   						writer.write("\t\tAxis_Delete_"+containedType+"(param->"+attribs[i][0]+".m_Array,
true, param->"+attribs[i][0]+".m_Size);\n");
  
  
  
  1.5.4.2   +3 -1      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamWriter.java
  
  Index: ArrayParamWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamWriter.java,v
  retrieving revision 1.5.4.1
  retrieving revision 1.5.4.2
  diff -u -r1.5.4.1 -r1.5.4.2
  --- ArrayParamWriter.java	14 Nov 2003 12:04:23 -0000	1.5.4.1
  +++ ArrayParamWriter.java	16 Dec 2003 10:37:16 -0000	1.5.4.2
  @@ -69,6 +69,7 @@
   import javax.xml.namespace.QName;
   
   import org.apache.axis.wsdl.wsdl2ws.WrapperFault;
  +import org.apache.axis.wsdl.wsdl2ws.WrapperUtils;
   import org.apache.axis.wsdl.wsdl2ws.info.Type;
   import org.apache.axis.wsdl.wsdl2ws.info.WebServiceContext;
   
  @@ -88,7 +89,8 @@
   				throw new WrapperFault("Array type "+classname+" contain unexpected no of types");
   			}
   			//include header file for the contained type
  -			QName qname = type.getTypNameForAttribName("item");
  +			QName qname = WrapperUtils.getArrayType(type).getName(); 
  +			
   			if (!CPPUtils.isSimpleType(qname)){
   				writer.write("#include \""+attribs[0][1]+".h\"\n\n");
   			}
  
  
  

Mime
View raw message