axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From susan...@apache.org
Subject cvs commit: ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c AllParamWriter.java BasicFileWriter.java ParamWriter.java ParmHeaderFileWriter.java ServiceWriter.java ArrayParamWriter.java BeanParamWriter.java ParamCPPFileWriter.java
Date Mon, 13 Oct 2003 11:08:36 GMT
susantha    2003/10/13 04:08:36

  Modified:    c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c
                        AllParamWriter.java BasicFileWriter.java
                        ParamWriter.java ParmHeaderFileWriter.java
                        ServiceWriter.java
  Removed:     c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c
                        ArrayParamWriter.java BeanParamWriter.java
                        ParamCPPFileWriter.java
  Log:
  Fixed few bugs in generating C wrappers/skeletons and Stubs. Removed few files which are
no longer needed.
  
  Revision  Changes    Path
  1.2       +3 -3      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/AllParamWriter.java
  
  Index: AllParamWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/AllParamWriter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AllParamWriter.java	19 Sep 2003 14:25:50 -0000	1.1
  +++ AllParamWriter.java	13 Oct 2003 11:08:36 -0000	1.2
  @@ -90,12 +90,12 @@
   			type = (Type)enu.next();
   			if(wscontext.getWrapInfo().getImplStyle().equals(WrapperConstants.IMPL_STYLE_STRUCT)){
   					if(type.isArray()){
  -						System.out.println("Array writer called ......not yet suuported");
  -						//(new ArrayParamWriter(wscontext,type)).writeSource();
  +						System.out.println("Array writer called ......");
  +						(new org.apache.axis.wsdl.wsdl2ws.cpp.ArrayParamWriter(wscontext,type)).writeSource();

   					}	
   					else{	
   						System.out.println("struct writer called ......");
  -						(new BeanParamWriter(wscontext,type)).writeSource();
  +						(new org.apache.axis.wsdl.wsdl2ws.cpp.BeanParamWriter(wscontext,type)).writeSource();
   						(new ParmHeaderFileWriter(wscontext,type)).writeSource();	
   					}	
   				}	
  
  
  
  1.2       +2 -2      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BasicFileWriter.java
  
  Index: BasicFileWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BasicFileWriter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BasicFileWriter.java	19 Sep 2003 14:25:50 -0000	1.1
  +++ BasicFileWriter.java	13 Oct 2003 11:08:36 -0000	1.2
  @@ -76,8 +76,8 @@
   	protected void writeClassComment()throws WrapperFault{}
   	protected void writePreprocssorStatements()throws WrapperFault{}
   	protected void writeAttributes()throws WrapperFault{}
  -	protected abstract void writeConstructors()throws WrapperFault;
  -	protected abstract void writeDistructors()throws WrapperFault;
  +	protected void writeConstructors()throws WrapperFault{};
  +	protected void writeDistructors()throws WrapperFault{};
   	protected abstract void writeMethods()throws WrapperFault;
   	protected abstract File getFilePath()throws WrapperFault;
   }
  
  
  
  1.2       +10 -21    ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParamWriter.java
  
  Index: ParamWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParamWriter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ParamWriter.java	19 Sep 2003 14:25:50 -0000	1.1
  +++ ParamWriter.java	13 Oct 2003 11:08:36 -0000	1.2
  @@ -75,7 +75,7 @@
   import org.apache.axis.wsdl.wsdl2ws.info.Type;
   import org.apache.axis.wsdl.wsdl2ws.info.WebServiceContext;
   
  -public abstract class ParamWriter extends BasicFileWriter{	
  +public abstract class ParamWriter extends BasicFileWriter{
       protected static final int INPUT_PARM = 0;
       protected static final int RETURN_PARM = 1;
       protected static final int COMMAN_PARM = 2;
  @@ -89,7 +89,7 @@
       protected Type type;
   
       public ParamWriter(WebServiceContext wscontext,Type type) throws WrapperFault {
  -            super(WrapperUtils.getClassNameFromFullyQualifiedName(type.getLanguageSpecificName()));
  +            super(WrapperUtils.getWrapperClassName4QualifiedName(type.getLanguageSpecificName()));
               this.wscontext = wscontext;
               this.type = type;
               this.attribs = this.getAttribList(wscontext.getSerInfo().getQualifiedServiceName());
  @@ -139,29 +139,18 @@
           return attribs;
       }
       
  - 	protected String getCrroectParmNameConsideringArrays(QName name,String classname)throws
WrapperFault{
  -		System.out.println(name);
  + 	protected String getCorrectParmNameConsideringArraysAndComplexTypes(QName name,String
classname)throws WrapperFault{
  +		//System.out.println(name);
   		Type t = wscontext.getTypemap().getType(name);
  -		if(t !=null && t.isArray()){
  -		Enumeration e = t.getAttribNames();
  -		String contentTypeName;
  -		if(e.hasMoreElements()){	
  -			QName elementQname = t.getTypNameForAttribName((String)e.nextElement());
  -			Type type = this.wscontext.getTypemap().getType(elementQname);
  -			
  -			
  -			if(type != null)
  -				contentTypeName = type.getLanguageSpecificName();
  +		if(t !=null){ //array or complex types
  +			if (t.isArray()){
  +				return t.getLanguageSpecificName();
  +			}
   			else{
  -				contentTypeName = CUtils.getclass4qname(elementQname);
  -				if(contentTypeName == null)
  -				throw new WrapperFault("if not inbuild or not in type map what is this type "+elementQname);
  +				return classname+"*"; //All complex types will be pointers	
   			}
  -	    }else
  -			throw new WrapperFault("Array with no type ????");	
  -		return contentTypeName+"[]";
   		}else
  -		return classname;
  +			return classname;
   	}
   	
   }
  
  
  
  1.4       +1 -1      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java
  
  Index: ParmHeaderFileWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ParmHeaderFileWriter.java	13 Oct 2003 05:03:14 -0000	1.3
  +++ ParmHeaderFileWriter.java	13 Oct 2003 11:08:36 -0000	1.4
  @@ -102,7 +102,7 @@
   		  try{
   			  for(int i=0;i<attribs.length;i++){
   				  //if((t = wscontext.getTypemap().getType(new QName(attribs[i][2],attribs[i][3])))!=
null && t.isArray()) continue;
  -				  writer.write("\t"+getCrroectParmNameConsideringArrays(new QName(attribs[i][2],attribs[i][3]),attribs[i][1])+"
"+attribs[i][0]+";\n");
  +				  writer.write("\t"+getCorrectParmNameConsideringArraysAndComplexTypes(new QName(attribs[i][2],attribs[i][3]),attribs[i][1])+"
"+attribs[i][0]+";\n");
   			  }    
   		  } catch (IOException e) {
   			   throw new WrapperFault(e);
  
  
  
  1.3       +12 -18    ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ServiceWriter.java
  
  Index: ServiceWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ServiceWriter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ServiceWriter.java	26 Sep 2003 04:34:44 -0000	1.2
  +++ ServiceWriter.java	13 Oct 2003 11:08:36 -0000	1.3
  @@ -63,6 +63,7 @@
   import java.io.File;
   import java.io.IOException;
   import java.util.ArrayList;
  +import java.util.HashSet;
   import java.util.Iterator;
   
   import org.apache.axis.wsdl.wsdl2ws.WrapperFault;
  @@ -103,16 +104,6 @@
   	}
   
   	/* (non-Javadoc)
  -	 * @see org.apache.axis.wsdl.wsdl2ws.cpp.HeaderFileWriter#writeConstructors()
  -	 */
  -	protected void writeConstructors() throws WrapperFault {}
  -
  -	/* (non-Javadoc)
  -	 * @see org.apache.axis.wsdl.wsdl2ws.cpp.HeaderFileWriter#writeDistructors()
  -	 */
  -	protected void writeDistructors() throws WrapperFault {}
  -
  -	/* (non-Javadoc)
   	 * @see org.apache.axis.wsdl.wsdl2ws.cpp.HeaderFileWriter#writeMethods()
   	 */
   	protected void writeMethods() throws WrapperFault {
  @@ -127,8 +118,7 @@
   				  writer.write("void ");
   			  else {
   				String outparam = minfo.getReturnType().getLangName();
  -				isSimpleType = CUtils.isSimpleType(outparam);
  -				writer.write(WrapperUtils.getClassNameFromParamInfoConsideringArrays(minfo.getReturnType(),wscontext)+(isSimpleType?"
":" *"));
  +				writer.write(WrapperUtils.getClassNameFromParamInfoConsideringArrays(minfo.getReturnType(),wscontext)+"
");
   			  }
   			  writer.write(minfo.getMethodname()+"(");
   			  //write parameter names 
  @@ -136,13 +126,11 @@
   			Iterator params = minfo.getParameterTypes().iterator();
   			if(params.hasNext()){
   				ParameterInfo fparam = (ParameterInfo)params.next();
  -				isSimpleType = CUtils.isSimpleType(fparam.getLangName());
  -				writer.write(WrapperUtils.getClassNameFromParamInfoConsideringArrays(fparam,wscontext)+(isSimpleType?"
Value":" *pValue")+0);
  +				writer.write(WrapperUtils.getClassNameFromParamInfoConsideringArrays(fparam,wscontext)+"
Value"+0);
   			}
   			for(int j =1; params.hasNext();j++){
   				ParameterInfo nparam = (ParameterInfo)params.next();
  -				isSimpleType = CUtils.isSimpleType(nparam.getLangName());
  -				writer.write(","+WrapperUtils.getClassNameFromParamInfoConsideringArrays(nparam,wscontext)+(isSimpleType?"
Value":" *pValue")+j);
  +				writer.write(","+WrapperUtils.getClassNameFromParamInfoConsideringArrays(nparam,wscontext)+"
Value"+j);
   			}
   			writer.write(")\n{\n}\n");
   		  }
  @@ -158,10 +146,16 @@
   		try{
   			Type atype;
   			Iterator types = this.wscontext.getTypemap().getTypes().iterator();
  +			HashSet typeSet = new HashSet();
   			while(types.hasNext()){
   				atype = (Type)types.next();
  -				writer.write("#include \""+atype.getLanguageSpecificName()+".h\"\n");
  -			}
  +				typeSet.add(atype.getLanguageSpecificName());
  +			}		
  +			Iterator itr = typeSet.iterator();
  +			while(itr.hasNext())
  +			{
  +				writer.write("#include \""+itr.next().toString()+".h\"\n");
  +			}		
   			writer.write("\n");
   		}catch (IOException e) {
   			e.printStackTrace();
  
  
  

Mime
View raw message