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/cpp/literal AllParamWriter.java ArrayParamWriter.java ServiceHeaderWriter.java ServiceWriter.java WrapHeaderWriter.java WrapWriter.java
Date Tue, 06 Jul 2004 07:16:04 GMT
susantha    2004/07/06 00:16:03

  Modified:    c/src/wsdl/org/apache/axis/wsdl/wsdl2ws WrapperUtils.java
               c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp
                        AllParamWriter.java ServiceHeaderWriter.java
                        ServiceWriter.java WrapHeaderWriter.java
                        WrapWriter.java
               c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal
                        AllParamWriter.java ArrayParamWriter.java
                        ServiceHeaderWriter.java ServiceWriter.java
                        WrapHeaderWriter.java WrapWriter.java
  Log:
  Fixing the bug that attempts to generate arrays for simple types
  adding init() fini() and onFault() methods and their comments to skeletons.
  
  Revision  Changes    Path
  1.11      +0 -3      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WrapperUtils.java
  
  Index: WrapperUtils.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WrapperUtils.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- WrapperUtils.java	4 Jul 2004 12:49:17 -0000	1.10
  +++ WrapperUtils.java	6 Jul 2004 07:16:03 -0000	1.11
  @@ -83,9 +83,6 @@
       	if (type.isArray()){
   			QName qname = getArrayType(type).getName(); 
   			//this can never be a simple type
  -			if (CUtils.isSimpleType(qname) && !CUtils.isDefinedSimpleType(qname)){
  -				throw new WrapperFault("No need to create an Array for simple type "+qname+"\n" +
				"It seems that some thing wrong with symbolTable population - Susantha");
  -			}
   			return CUtils.getCmplxArrayNameforType(qname);
       	}
       	else{
  
  
  
  1.6       +9 -1      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllParamWriter.java
  
  Index: AllParamWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllParamWriter.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AllParamWriter.java	9 Apr 2004 08:49:33 -0000	1.5
  +++ AllParamWriter.java	6 Jul 2004 07:16:03 -0000	1.6
  @@ -23,6 +23,9 @@
   package org.apache.axis.wsdl.wsdl2ws.cpp;
   import java.util.Iterator;
   
  +import javax.xml.namespace.QName;
  +
  +import org.apache.axis.wsdl.wsdl2ws.CUtils;
   import org.apache.axis.wsdl.wsdl2ws.SourceWriter;
   import org.apache.axis.wsdl.wsdl2ws.WrapperConstants;
   import org.apache.axis.wsdl.wsdl2ws.WrapperFault;
  @@ -48,8 +51,13 @@
   		try{	
   			type = (Type)enu.next();
   			if(wscontext.getWrapInfo().getImplStyle().equals(WrapperConstants.IMPL_STYLE_STRUCT)){
  -				if(type.isArray()){
  +				if(type.isArray()){					
   					System.out.println("Array writer called ......");
  +					QName qname = type.getName();
  +					if (CUtils.isSimpleType(qname) && !CUtils.isDefinedSimpleType(qname)){
  +						throw new WrapperFault("No need to create an Array for simple type "+qname+"\n" +
  +							"It seems that some thing wrong with symbolTable population - Susantha");
  +					}
   					ArrayParamWriter writer = (new ArrayParamWriter(wscontext,type));	
   					if (!writer.isSimpleTypeArray()) writer.writeSource();
   				}	
  
  
  
  1.21      +4 -1      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceHeaderWriter.java
  
  Index: ServiceHeaderWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceHeaderWriter.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- ServiceHeaderWriter.java	15 Jun 2004 10:38:56 -0000	1.20
  +++ ServiceHeaderWriter.java	6 Jul 2004 07:16:03 -0000	1.21
  @@ -104,6 +104,9 @@
   		boolean isSimpleType;
   		try{
   		  	writer.write("\tpublic: \n");	
  +			writer.write("\t\tvoid onFault();\n");
  +			writer.write("\t\tvoid init();\n");
  +			writer.write("\t\tvoid fini();\n");
   		  	for(int i = 0; i < methods.size(); i++){
   			  	minfo = (MethodInfo)this.methods.get(i);
   				boolean isAllTreatedAsOutParams = false;
  @@ -195,8 +198,8 @@
   							faultInfoName =info.getFaultInfo();	     
   							writer.write("#include \"Axis"+faultInfoName.toString()+"Exception.h\"\n");
   					}
  -					writer.write("\n");
   				}			
  +				writer.write("\n");
   			}catch(IOException e){
   				throw new WrapperFault(e);
   			}
  
  
  
  1.14      +6 -0      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceWriter.java
  
  Index: ServiceWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceWriter.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ServiceWriter.java	12 Jun 2004 03:57:12 -0000	1.13
  +++ ServiceWriter.java	6 Jul 2004 07:16:03 -0000	1.14
  @@ -94,6 +94,12 @@
   		MethodInfo minfo;
   		boolean isSimpleType;
   		try{
  +			writer.write("\n/* This function is called by the AxisEngine when something went wrong"
+
				"\n with the current web service request processing. Appropriate actions should" +
			"\n be taken here.*/");
  +			writer.write("\nvoid "+classname+"::onFault()\n{\n}");
  +			writer.write("\n/* This function is called by the AxisEngine when this web service"
+
				"\n library is first loaded. So here we can initialize any global/static" +
				"\n
data structures of this web service or open database connections */");
  +			writer.write("\nvoid "+classname+"::init()\n{\n}");
  +			writer.write("\n/* This function is called by the AxisEngine when this web service"
+
				"\n library is unloaded. So we can deallocate any global/static data structures" +
			"\n and close database connections etc here. */");
  +			writer.write("\nvoid "+classname+"::fini()\n{\n}");
   		  	writer.write("\n");	
   		  	for(int i = 0; i < methods.size(); i++){
   				minfo = (MethodInfo)this.methods.get(i);
  
  
  
  1.15      +1 -1      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapHeaderWriter.java
  
  Index: WrapHeaderWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapHeaderWriter.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- WrapHeaderWriter.java	15 Jun 2004 10:15:29 -0000	1.14
  +++ WrapHeaderWriter.java	6 Jul 2004 07:16:03 -0000	1.15
  @@ -140,8 +140,8 @@
   						faultInfoName =info.getFaultInfo();	     
   						writer.write("#include \"Axis"+faultInfoName.toString()+"Exception.h\"\n");
   				}
  -				writer.write("\n");
   			}			
  +			writer.write("\n");
   		}catch(IOException e){
   			throw new WrapperFault(e);
   		}
  
  
  
  1.30      +6 -3      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.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- WrapWriter.java	15 Jun 2004 12:52:37 -0000	1.29
  +++ WrapWriter.java	6 Jul 2004 07:16:03 -0000	1.30
  @@ -99,9 +99,12 @@
   		try{
   			writer.write("/*implementation of WrapperClassHandler interface*/\n");
   			
  -			writer.write("void "+classname+"::onFault(void *pMsg)\n{\n}\n\n");
  -			writer.write("int "+classname+"::init()\n{\n\treturn AXIS_SUCCESS;\n}\n\n");
  -			writer.write("int "+classname+"::fini()\n{\n\treturn AXIS_SUCCESS;\n}\n\n");
  +			writer.write("void "+classname+"::onFault(void *pMsg)\n{" +
  +				"\n\tpWs->onFault();\n}\n\n");
  +			writer.write("int "+classname+"::init()\n{\n" +
  +				"\tpWs->init();\n\treturn AXIS_SUCCESS;\n}\n\n");
  +			writer.write("int "+classname+"::fini()\n{\n" +
  +				"\tpWs->fini();\n\treturn AXIS_SUCCESS;\n}\n\n");
   			writeInvoke();
   			writer.write("\n/*Methods corresponding to the web service methods*/\n");
   			MethodInfo minfo;
  
  
  
  1.6       +11 -2     ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/AllParamWriter.java
  
  Index: AllParamWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/AllParamWriter.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AllParamWriter.java	9 Apr 2004 08:49:34 -0000	1.5
  +++ AllParamWriter.java	6 Jul 2004 07:16:03 -0000	1.6
  @@ -24,6 +24,9 @@
   package org.apache.axis.wsdl.wsdl2ws.cpp.literal;
   import java.util.Iterator;
   
  +import javax.xml.namespace.QName;
  +
  +import org.apache.axis.wsdl.wsdl2ws.CUtils;
   import org.apache.axis.wsdl.wsdl2ws.SourceWriter;
   import org.apache.axis.wsdl.wsdl2ws.WrapperConstants;
   import org.apache.axis.wsdl.wsdl2ws.WrapperFault;
  @@ -36,7 +39,7 @@
   	public AllParamWriter(WebServiceContext wscontext){
   		this.wscontext =wscontext;
   	}
  -
  +	
   	/**
   	 * genarate all the wrappets for custom complex types.
   	 * @see org.apache.axis.wsdl.wsdl2ws.SourceWriter#writeSource()
  @@ -51,7 +54,13 @@
   			if(wscontext.getWrapInfo().getImplStyle().equals(WrapperConstants.IMPL_STYLE_STRUCT)){
   				if(type.isArray()){
   					System.out.println("Array writer called ......");
  -					(new ArrayParamWriter(wscontext,type)).writeSource();	
  +					QName qname = type.getName();
  +					if (CUtils.isSimpleType(qname) && !CUtils.isDefinedSimpleType(qname)){
  +						throw new WrapperFault("No need to create an Array for simple type "+qname+"\n" +
  +							"It seems that some thing wrong with symbolTable population - Susantha");
  +					}
  +					ArrayParamWriter writer = (new ArrayParamWriter(wscontext,type));	
  +					if (!writer.isSimpleTypeArray()) writer.writeSource();
   				}	
   				else{
   					/* TODO check whether this type is referenced or not. Synthesize only if  reference
  
  
  
  1.7       +5 -0      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ArrayParamWriter.java
  
  Index: ArrayParamWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ArrayParamWriter.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ArrayParamWriter.java	9 Apr 2004 08:49:34 -0000	1.6
  +++ ArrayParamWriter.java	6 Jul 2004 07:16:03 -0000	1.7
  @@ -101,6 +101,11 @@
   		}
   	}
   		
  +	public boolean isSimpleTypeArray()throws WrapperFault{
  +		QName qname = WrapperUtils.getArrayType(type).getName(); 
  +		return CUtils.isSimpleType(qname);
  +	}
  +	
   	protected void writeConstructors()throws WrapperFault{}
   	   
   	protected void writeDistructors() throws WrapperFault {}
  
  
  
  1.11      +4 -1      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ServiceHeaderWriter.java
  
  Index: ServiceHeaderWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ServiceHeaderWriter.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ServiceHeaderWriter.java	15 Jun 2004 10:18:01 -0000	1.10
  +++ ServiceHeaderWriter.java	6 Jul 2004 07:16:03 -0000	1.11
  @@ -103,6 +103,9 @@
   		boolean isSimpleType;
   		try{
   		  	writer.write("\tpublic: \n");	
  +			writer.write("\t\tvoid onFault();\n");
  +			writer.write("\t\tvoid init();\n");
  +			writer.write("\t\tvoid fini();\n");
   		  	for(int i = 0; i < methods.size(); i++){
   			  	minfo = (MethodInfo)this.methods.get(i);
   				boolean isAllTreatedAsOutParams = false;
  @@ -192,8 +195,8 @@
   						faultInfoName =info.getFaultInfo();	     
   						writer.write("#include \"Axis"+faultInfoName.toString()+"Exception.h\"\n");
   				}
  -				writer.write("\n");
   			}			
  +			writer.write("\n");
   		}catch(IOException e){
   			throw new WrapperFault(e);
   		}
  
  
  
  1.8       +12 -0     ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ServiceWriter.java
  
  Index: ServiceWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ServiceWriter.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ServiceWriter.java	12 Jun 2004 03:57:12 -0000	1.7
  +++ ServiceWriter.java	6 Jul 2004 07:16:03 -0000	1.8
  @@ -94,6 +94,18 @@
   		MethodInfo minfo;
   		boolean isSimpleType;
   		try{
  +			writer.write("\n/* This function is called by the AxisEngine when something went wrong"
+
  +				"\n with the current web service request processing. Appropriate actions should" +
  +				"\n be taken here.*/");
  +			writer.write("\nvoid "+classname+"::onFault()\n{\n}");
  +			writer.write("\n/* This function is called by the AxisEngine when this web service"
+
  +				"\n library is first loaded. So here we can initialize any global/static" +
  +				"\n data structures of this web service or open database connections */");
  +			writer.write("\nvoid "+classname+"::init()\n{\n}");
  +			writer.write("\n/* This function is called by the AxisEngine when this web service"
+
  +				"\n library is unloaded. So we can deallocate any global/static data structures" +
  +				"\n and close database connections etc here. */");
  +			writer.write("\nvoid "+classname+"::fini()\n{\n}");
   		  	writer.write("\n");	
   		  	for(int i = 0; i < methods.size(); i++){
   				minfo = (MethodInfo)this.methods.get(i);
  
  
  
  1.11      +1 -1      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapHeaderWriter.java
  
  Index: WrapHeaderWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapHeaderWriter.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- WrapHeaderWriter.java	15 Jun 2004 10:17:30 -0000	1.10
  +++ WrapHeaderWriter.java	6 Jul 2004 07:16:03 -0000	1.11
  @@ -141,8 +141,8 @@
   							faultInfoName =info.getFaultInfo();	     
   							writer.write("#include \"Axis"+faultInfoName.toString()+"Exception.h\"\n");
   					}
  -					writer.write("\n");
   				}			
  +				writer.write("\n");
   			}catch(IOException e){
   				throw new WrapperFault(e);
   			}
  
  
  
  1.21      +3 -3      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapWriter.java
  
  Index: WrapWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapWriter.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- WrapWriter.java	15 Jun 2004 12:52:20 -0000	1.20
  +++ WrapWriter.java	6 Jul 2004 07:16:03 -0000	1.21
  @@ -99,9 +99,9 @@
   		try{
   			writer.write("/*implementation of WrapperClassHandler interface*/\n");
   			
  -			writer.write("void "+classname+"::onFault(void *pMsg)\n{\n}\n\n");
  -			writer.write("int "+classname+"::init()\n{\n\treturn AXIS_SUCCESS;\n}\n\n");
  -			writer.write("int "+classname+"::fini()\n{\n\treturn AXIS_SUCCESS;\n}\n\n");
  +			writer.write("void "+classname+"::onFault(void *pMsg)\n{" +
				"\n\tpWs->onFault();\n}\n\n");
  +			writer.write("int "+classname+"::init()\n{\n" +
				"\tpWs->init();\n\treturn AXIS_SUCCESS;\n}\n\n");
  +			writer.write("int "+classname+"::fini()\n{\n" +
				"\tpWs->fini();\n\treturn AXIS_SUCCESS;\n}\n\n");
   			writeInvoke();
   			writer.write("\n/*Methods corresponding to the web service methods*/\n");
   			MethodInfo minfo;
  
  
  

Mime
View raw message