axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject cvs commit: ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/rpc RPCWebServiceGenarator.java
Date Thu, 08 Jul 2004 09:23:35 GMT
damitha     2004/07/08 02:23:35

  Modified:    c/src/wsdl/org/apache/axis/wsdl/wsdl2ws Tag:
                        Release1-2-branch SourceWriterFactory.java
                        WrapperConstants.java
               c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp Tag:
                        Release1-2-branch AllExceptionWriter.java
                        BeanParamWriter.java ClientStubHeaderWriter.java
                        ClientStubWriter.java ExceptionHeaderWriter.java
                        ExceptionWriter.java
               c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/doclit Tag:
                        Release1-2-branch DocLitWebServiceGenarator.java
               c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/rpc Tag:
                        Release1-2-branch RPCWebServiceGenarator.java
  Log:
  Now rpc style for client side should generate fine
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.10.2.1  +6 -2      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/SourceWriterFactory.java
  
  Index: SourceWriterFactory.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/SourceWriterFactory.java,v
  retrieving revision 1.10
  retrieving revision 1.10.2.1
  diff -u -r1.10 -r1.10.2.1
  --- SourceWriterFactory.java	12 Jun 2004 03:57:11 -0000	1.10
  +++ SourceWriterFactory.java	8 Jul 2004 09:23:34 -0000	1.10.2.1
  @@ -52,8 +52,10 @@
   				return new org.apache.axis.wsdl.wsdl2ws.cpp.ClientStubHeaderWriter(wscontext);
   			else if(genaratorType == WrapperConstants.GENERATOR_CLIENT_STUB_CPP)
   				return new org.apache.axis.wsdl.wsdl2ws.cpp.ClientStubWriter(wscontext);			
  -			else if(genaratorType == WrapperConstants.GENERATOR_EXCEPTION_ALL) // nithya
  +			else if(genaratorType == WrapperConstants.GENERATOR_CLIENT_EXCEPTION)
   						return new org.apache.axis.wsdl.wsdl2ws.cpp.AllExceptionWriter(wscontext);	
  +			//else if(genaratorType == WrapperConstants.GENERATOR_SERVER_EXCEPTION)
  +						//			return new org.apache.axis.wsdl.wsdl2ws.cpp.AllExceptionWriter(wscontext);	
   			//C
   			else if(genaratorType == WrapperConstants.GENERATOR_PARAM_C_ALL)
   				return new org.apache.axis.wsdl.wsdl2ws.c.AllParamWriter(wscontext);
  @@ -88,8 +90,10 @@
   				return new org.apache.axis.wsdl.wsdl2ws.cpp.literal.ClientStubHeaderWriter(wscontext);
   			else if(genaratorType == WrapperConstants.GENERATOR_CLIENT_STUB_CPP)
   				return new org.apache.axis.wsdl.wsdl2ws.cpp.literal.ClientStubWriter(wscontext);	
  -			else if(genaratorType == WrapperConstants.GENERATOR_EXCEPTION_ALL) // nithya
  +			else if(genaratorType == WrapperConstants.GENERATOR_CLIENT_EXCEPTION) // nithya
   				return new org.apache.axis.wsdl.wsdl2ws.cpp.AllExceptionWriter(wscontext);
  +			//else if(genaratorType == WrapperConstants.GENERATOR_SERVER_EXCEPTION) // nithya
  +				//			return new org.apache.axis.wsdl.wsdl2ws.cpp.AllExceptionWriter(wscontext,"Server");
   			
   			//C
   			else if(genaratorType == WrapperConstants.GENERATOR_PARAM_C_ALL)
  
  
  
  1.10.2.1  +2 -1      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WrapperConstants.java
  
  Index: WrapperConstants.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WrapperConstants.java,v
  retrieving revision 1.10
  retrieving revision 1.10.2.1
  diff -u -r1.10 -r1.10.2.1
  --- WrapperConstants.java	12 Jun 2004 03:57:11 -0000	1.10
  +++ WrapperConstants.java	8 Jul 2004 09:23:34 -0000	1.10.2.1
  @@ -67,7 +67,8 @@
   	public static final int GENERATOR_CLIENT_STUB_HPP = 19;
   	public static final int GENERATOR_PARAM_CPP_ALL = 20 ;
   	public static final int GENERATOR_SERVICE_HPP = 21 ;
  -	public static final int GENERATOR_EXCEPTION_ALL = 50;
  +	public static final int GENERATOR_CLIENT_EXCEPTION = 50;
  +	public static final int GENERATOR_SERVER_EXCEPTION = 51;
   	//c constants 
   	public static final int GENERATOR_CLASSLOADER_C = 22 ;
   	public static final int GENERATOR_WRAPPER_C = 23;
  
  
  
  No                   revision
  No                   revision
  1.2.2.1   +28 -44    ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllExceptionWriter.java
  
  Index: AllExceptionWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllExceptionWriter.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- AllExceptionWriter.java	8 Jun 2004 07:06:29 -0000	1.2
  +++ AllExceptionWriter.java	8 Jul 2004 09:23:34 -0000	1.2.2.1
  @@ -5,20 +5,10 @@
    * Window>Preferences>Java>Code Generation>Code and Comments
    */
   package org.apache.axis.wsdl.wsdl2ws.cpp;
  -import java.util.Iterator;
  -import java.util.ArrayList; 
   import org.apache.axis.wsdl.wsdl2ws.SourceWriter;
  -import org.apache.axis.wsdl.wsdl2ws.WrapperUtils;
   import org.apache.axis.wsdl.wsdl2ws.WrapperFault;
  -//import org.apache.axis.wsdl.wsdl2ws.info.Type;
  -import org.apache.axis.wsdl.wsdl2ws.info.ParameterInfo;
   import org.apache.axis.wsdl.wsdl2ws.info.WebServiceContext;
   
  -import org.apache.axis.wsdl.wsdl2ws.info.MethodInfo;
  -
  -//import org.apache.axis.wsdl.wsdl2ws.info.Type;
  -import org.apache.axis.wsdl.wsdl2ws.info.FaultInfo; 
  -
   /**
    * @author nithya
    *
  @@ -27,46 +17,40 @@
    */
   public class AllExceptionWriter implements SourceWriter{
   private WebServiceContext wscontext;
  +private String strFlag;
   	
  -public AllExceptionWriter(WebServiceContext wscontext){
  -	this.wscontext =wscontext;
  -}
  +  public AllExceptionWriter(WebServiceContext wscontext){
  +	  this.wscontext =wscontext;
  +	 // this.strFlag =strFlag;
  +   }
       /**
   	 * genarate all the Exceptions.
   	 * @see org.apache.axis.wsdl.wsdl2ws.SourceWriter#writeSource()
   	 */
  -	public void writeSource() throws WrapperFault {		
  -    ArrayList methods;
  -	methods = wscontext.getSerInfo().getMethods();
  -	MethodInfo minfo;
  -	FaultInfo faultinfo;
  -	try{
  -				for (int i = 0; i < methods.size(); i++) {
  -					minfo = (MethodInfo)methods.get(i);
  -					Iterator paramsFault = minfo.getFaultType().iterator();
  -							String faultInfoName =null;
  -							String faultType =null;	 
  -							String langName =null;
  -							String paramName =null;
  -							while (paramsFault.hasNext()){
  -								FaultInfo info = (FaultInfo)paramsFault.next();
  -								faultInfoName =info.getFaultInfo();
  -								ArrayList paramInfo =info.getParams();
  -								for (int j= 0; j < paramInfo.size(); j++) {
  -									ParameterInfo par =(ParameterInfo)paramInfo.get(j);                          
                                                                                         
                                      
  -									paramName  = par.getParamName();
  -									langName =par.getLangName();
  -									faultType = WrapperUtils.getClassNameFromParamInfoConsideringArrays(par,wscontext);
  -														(new ExceptionHeaderWriter(wscontext,faultInfoName,langName,faultType)).writeSource();
  -														(new ExceptionWriter(wscontext,faultInfoName,langName,faultType)).writeSource();

  -									}
  -								}
  -				}
  -			
  -			}catch(Exception e){
  +	public void writeSource() throws WrapperFault 
  +	{		    
  +	     try
  +	     {
  +//	          if (strFlag.equals("Client"))
  +//	          {
  +//			       (new ExceptionHeaderWriter(wscontext,"Client")).writeSource();
  +//				   (new ExceptionWriter(wscontext,"Client")).writeSource();
  +//	          }
  +//	     	  else if  (strFlag.equals("Client"))
  +//	     	  {	
  +//				  (new ExceptionHeaderWriter(wscontext,"Server")).writeSource();
  +//				  (new ExceptionWriter(wscontext,"Server")).writeSource();
  +//	     	  }		
  +
  +			(new ExceptionHeaderWriter(wscontext,"Client")).writeSource();
  +  		    (new ExceptionWriter(wscontext,"Client")).writeSource();
  +				
  +		 }			
  +		 catch(Exception e)
  +		{
   				System.out.println("Error occured yet we continue to genarate other classes ... you
should check the error");
   				e.printStackTrace();
  -			}	
  -	}
  +		}	
  +     }
   }
   
  
  
  
  1.21.2.1  +1 -1      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.21
  retrieving revision 1.21.2.1
  diff -u -r1.21 -r1.21.2.1
  --- BeanParamWriter.java	11 Jun 2004 05:01:28 -0000	1.21
  +++ BeanParamWriter.java	8 Jul 2004 09:23:34 -0000	1.21.2.1
  @@ -182,7 +182,7 @@
   					elm = attribs[i].getTypeName();					
   				writer.write("\tparam->"+attribs[i].getParamName()+" = ("+attribs[i].getTypeName()+"*)pIWSDZ->getCmplxObject((void*)Axis_DeSerialize_"+attribs[i].getTypeName()+
   					"\n\t\t, (void*)Axis_Create_"+attribs[i].getTypeName()+", (void*)Axis_Delete_"+attribs[i].getTypeName()+
  -					"\n\t\t, \""+elm+"\", Axis_URI_"+attribs[i].getTypeName()+");\n");				
  +					"\n\t\t, \""+attribs[i].getTypeName()+"\", Axis_URI_"+attribs[i].getTypeName()+");\n");
			
   			}		
   		}
   		writer.write("\treturn pIWSDZ->getStatus();\n");
  
  
  
  1.22.2.1  +3 -3      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubHeaderWriter.java
  
  Index: ClientStubHeaderWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubHeaderWriter.java,v
  retrieving revision 1.22
  retrieving revision 1.22.2.1
  diff -u -r1.22 -r1.22.2.1
  --- ClientStubHeaderWriter.java	25 Jun 2004 08:57:17 -0000	1.22
  +++ ClientStubHeaderWriter.java	8 Jul 2004 09:23:34 -0000	1.22.2.1
  @@ -161,8 +161,8 @@
   	protected void writePreprocssorStatements() throws WrapperFault {
   		try{
   			writer.write("#include <axis/client/Stub.h>\n");
  -			writer.write("#include <axis/AxisGenException.h>\n");
  -			writer.write("/*include Exception header files here*/\n");//damitha
  +			writer.write("#include \"AxisClientException.h\"\n");
  +			writer.write("#include <axis/ISoapFault.h>\n");
   			Type atype;
   			Iterator types = this.wscontext.getTypemap().getTypes().iterator();
   			HashSet typeSet = new HashSet();
  @@ -179,7 +179,7 @@
   				writer.write("#include \""+itr.next().toString()+".h\"\n");
   			}			
   			//Method to print the Fault Exception headers
  -			writeFaultHeaders();
  +			//writeFaultHeaders();
   			writer.write("\n");
   		}catch (IOException e) {
   			e.printStackTrace();
  
  
  
  1.48.2.1  +29 -28    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.48
  retrieving revision 1.48.2.1
  diff -u -r1.48 -r1.48.2.1
  --- ClientStubWriter.java	25 Jun 2004 08:57:17 -0000	1.48
  +++ ClientStubWriter.java	8 Jul 2004 09:23:34 -0000	1.48.2.1
  @@ -216,10 +216,10 @@
   		String channelSecurityType = (WrapperConstants.CHANNEL_SECURITY_SSL.equals(wscontext.getWrapInfo().getChannelSecurity()))?
   										"SSL_CHANNEL" : "NORMAL_CHANNEL";
   
  -		writer.write("\tchar* cFaultcode;\n");
  -		writer.write("\tchar* cFaultstring;\n");
  -		writer.write("\tchar* cFaultactor;\n");
  -		writer.write("\tchar* cFaultdetail;\n");
  +		//writer.write("\tchar* cFaultcode;\n");
  +		//writer.write("\tchar* cFaultstring;\n");
  +		//writer.write("\tchar* cFaultactor;\n");
  +		writer.write("\tconst char* pcCmplxFaultName;\n");
   		writer.write("\ttry\n\t{");				
   		writer.write("\n\t\tif (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER, "+channelSecurityType
+")) \n\t\t\treturn ");//damitha
   		if (returntype != null){
  @@ -349,14 +349,16 @@
   		writer.write("\t\tint iExceptionCode = e.getExceptionCode();\n");
   		writer.write("\t\tif(AXISC_NODE_VALUE_MISMATCH_EXCEPTION != iExceptionCode)\n");
           writer.write("\t\t{\n");
  +        writer.write("\t\t\tm_pCall->unInitialize();\n");
           writer.write("\t\t\tthrow;\n");
           writer.write("\t\t}\n");
  -		writer.write("\t\telse if (AXIS_SUCCESS == m_pCall->checkFault(\"Fault\",\""+wscontext.getWrapInfo().getTargetEndpointURI()+"\"
))");
  -		writer.write("//Exception handling code goes here\n");
  -		writer.write("\t\t{\n");
  -		writer.write("\t\t\tcFaultcode = m_pCall->getElementAsString(\"faultcode\", 0);\n");
  -        writer.write("\t\t\tcFaultstring = m_pCall->getElementAsString(\"faultstring\",
0);\n");
  -		writer.write("\t\t\tcFaultactor = m_pCall->getElementAsString(\"faultactor\", 0);\n");
       	
  +//ISoapFault* pSoapFault = (ISoapFault*) m_pCall->checkFault("Fault", "http://localhost/axis/MathOps");
  +
  +
  +		writer.write("\t\tISoapFault* pSoapFault = (ISoapFault*) m_pCall->checkFault(\"Fault\",\""+wscontext.getWrapInfo().getTargetEndpointURI()+"\"
);\n");
  +		writer.write("\t\tif(pSoapFault)\n");
  +                writer.write("\t\t{\n");
  +                //writer.write("\t\t\tpcCmplxFaultName = pSoapFault->getCmplxFaultObjectName().c_str();\n");
          //to get fault info  		    
   		Iterator paramsFault = minfo.getFaultType().iterator();
   		String faultInfoName =null;
  @@ -367,12 +369,13 @@
   		int j =0;
   	    if (!paramsFault.hasNext())
   	    {
  -			writer.write("\t\t\tcFaultdetail = m_pCall->getElementAsString(\"faultdetail\", 0);\n");
  -			writer.write("\t\t\tthrow AxisGenException(cFaultdetail);\n");		
  +			writer.write("\t\t\tm_pCall->unInitialize();\n");
  +			writer.write("\t\t\tthrow AxisClientException(pSoapFault);\n");		
   	    }
   		else
   		{
   			flag =true;			
  +                        writer.write("\t\t\tpcCmplxFaultName = pSoapFault->getCmplxFaultObjectName().c_str();\n");
   		}	    
   		while (paramsFault.hasNext()){
   			j =j+1;
  @@ -400,8 +403,8 @@
   		    if (flag ==true)
   		    {		    	    
   			        writer.write("\t\t\telse\n\t\t\t{\n");
  -					writer.write("\t\t\t\t  cFaultdetail = m_pCall->getElementAsString(\"faultdetail\",
0);\n");
  -					writer.write("\t\t\t\t  throw AxisGenException(cFaultdetail);\n");
  +				writer.write("\t\t\t\t  m_pCall->unInitialize();\n");
  +				writer.write("\t\t\t\t  throw AxisClientException(pSoapFault);\n");
   			        writer.write("\t\t\t}\n");		
   		    }	    
   		
  @@ -412,21 +415,19 @@
   	}	
   	private void writeExceptions(String faulttype,String faultInfoName,String paramName,String
langName) throws WrapperFault{
   		try{		  
  -			   writer.write("(0 == strcmp(\""+langName+"\", cFaultstring))\n");     
  -		       // writer.write("\t\t\tif(0 == strcmp(\""+langName+"\", cFaultstring))\n");
  +			   writer.write("(0 == strcmp(\""+langName+"\", pcCmplxFaultName))\n");     
  +		       // writer.write("\t\t\tif(0 == strcmp(\""+langName+"\", pcCmplxFaultName))\n");
   		        writer.write("\t\t\t{\n");
  -		        writer.write("\t\t\t\tif (AXIS_SUCCESS == m_pCall->checkFault(\"faultdetail\",\""+wscontext.getWrapInfo().getTargetEndpointURI()+"\"))\n");
  -                writer.write("\t\t\t\t{\n");
  -			    writer.write("\t\t\t\t\t"+faulttype+" pFaultDetail = NULL;\n");
  -		    	writer.write("\t\t\t\t\tpFaultDetail = ("+faulttype+")m_pCall->\n");
  -                writer.write("\t\t\t\t\t\tgetCmplxObject((void*) Axis_DeSerialize_"+langName+",\n");
  -                writer.write("\t\t\t\t\t\t(void*) Axis_Create_"+langName+",\n");
  -                writer.write("\t\t\t\t\t\t(void*) Axis_Delete_"+langName+",\""+paramName+"\",
0);\n");
  -                writer.write("\t\t\t\t\t/*User code to handle the struct can be inserted
here*/\n");
  -			    writer.write("\t\t\t\t\tm_pCall->unInitialize();\n");
  -			    writer.write("\t\t\t\t\tthrow Axis"+faultInfoName+"Exception(pFaultDetail);\n");
  -			    writer.write("\t\t\t\t}\n");
  -			    writer.write("\t\t\t}\n");
  +			writer.write("\t\t\t\t\t"+faulttype+" pFaultDetail = NULL;\n");
  +		    	writer.write("\t\t\t\t\tpFaultDetail = ("+faulttype+")pSoapFault->\n");
  +                        writer.write("\t\t\t\t\t\tgetCmplxFaultObject((void*) Axis_DeSerialize_"+langName+",\n");
  +                        writer.write("\t\t\t\t\t\t(void*) Axis_Create_"+langName+",\n");
  +                        writer.write("\t\t\t\t\t\t(void*) Axis_Delete_"+langName+",\""+langName+"\",
0);\n");
  +                        writer.write("\t\t\t\t\tpSoapFault->setCmplxFaultObject(pFaultDetail);\n");
  +			writer.write("\t\t\t\t\tm_pCall->unInitialize();\n");
  +                        writer.write("\t\t\t\t\tthrow AxisClientException(pSoapFault);\n");
  +			//writer.write("\t\t\t\t}\n");
  +			writer.write("\t\t\t}\n");
   		}		
   		catch (IOException e) {
   					throw new WrapperFault(e);
  
  
  
  1.2.2.1   +62 -35    ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionHeaderWriter.java
  
  Index: ExceptionHeaderWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionHeaderWriter.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- ExceptionHeaderWriter.java	11 Jun 2004 05:01:28 -0000	1.2
  +++ ExceptionHeaderWriter.java	8 Jul 2004 09:23:34 -0000	1.2.2.1
  @@ -17,9 +17,14 @@
   import java.io.File;
   import java.io.IOException;
   import java.util.ArrayList;
  +import java.util.Iterator;
  +
   import org.apache.axis.wsdl.wsdl2ws.WrapperFault;
  -import org.apache.axis.wsdl.wsdl2ws.WrapperUtils;
   import org.apache.axis.wsdl.wsdl2ws.info.WebServiceContext;
  +
  +import org.apache.axis.wsdl.wsdl2ws.info.ParameterInfo;
  +import org.apache.axis.wsdl.wsdl2ws.info.MethodInfo;
  +import org.apache.axis.wsdl.wsdl2ws.info.FaultInfo; 
   /**
    * @author nithya
    *
  @@ -28,20 +33,15 @@
   	
   	private WebServiceContext wscontext;
   	private ArrayList methods;		
  -
   	String faultInfoName;
  -	String langName;
  -	String faultType;
  -	   
  -	public ExceptionHeaderWriter(WebServiceContext wscontext,String faultInfoName,String langName,String
faultType)throws WrapperFault{
  +	
  +	public ExceptionHeaderWriter(WebServiceContext wscontext,String faultInfoName)throws WrapperFault{
   	    //super(WrapperUtils.getClassNameFromFullyQualifiedName(wscontext.getSerInfo().getQualifiedServiceName()));
   	    super("Axis"+faultInfoName+"Exception");//damitha
  -            System.out.println("faultInfoName is:"+faultInfoName);
  +        System.out.println("faultInfoName is:"+faultInfoName);
   	    this.wscontext = wscontext;
   	    this.methods = wscontext.getSerInfo().getMethods();
  -	    this.faultInfoName ="Axis"+faultInfoName+"Exception";
  -		this.langName =langName;
  -		this.faultType =faultType;
  +	    this.faultInfoName ="Axis"+faultInfoName+"Exception" ;	
       }
   
        protected File getFilePath() throws WrapperFault {
  @@ -53,18 +53,17 @@
   	    return new File(fileName);
       }
   
  -	/* (non-Javadoc)
  +     	/* (non-Javadoc)
   		 * @see org.apache.axis.wsdl.wsdl2ws.cpp.HeaderFileWriter#writePreprocssorStatements()
   		 */
   		protected void writePreprocssorStatements() throws WrapperFault {
  -			try{
  -				//writer.write("#include \""+faultInfoName+".h\"\n\n");//damitha
  -				//writer.write("#include <axis/server/AxisException.h>\n\n");//damitha
  -				writer.write("#include <string>\n");
  -				writer.write("#include <exception>\n");
  -				writer.write("#include <axis/server/AxisException.h>\n");
  -				writer.write("#include \""+langName+".h\"\n\n");
  -				writer.write("using namespace std;\n");				
  +			try{				
  +				    writer.write("#include <string>\n");
  +				    writer.write("#include <exception>\n");
  +				    writer.write("#include <axis/server/AxisException.h>\n");
  +				    writer.write("#include <axis/ISoapFault.h>\n");
  +				    getLangName();				
  +				    writer.write("using namespace std;\n");				
   			}catch(IOException e){
   				throw new WrapperFault(e);
   			}
  @@ -85,18 +84,16 @@
   			}
   		}
   		
  -	/* (non-Javadoc)
  +	    /* (non-Javadoc)
   		 * @see org.apache.axis.wsdl.wsdl2ws.cpp.HeaderFileWriter#writeConstructors()
   		 */
   		protected void writeConstructors() throws WrapperFault {
   			try{
   			writer.write("public:\n\t"+faultInfoName+"();\n");
  -			writer.write("\t"+faultInfoName+"("+faultType+" pFault);\n");
  +			writer.write("\t"+faultInfoName+"(ISoapFault* pFault);\n");
   			writer.write("\t"+faultInfoName+"(int iExceptionCode);\n");
   			writer.write("\t"+faultInfoName+"(exception* e);\n");
  -			writer.write("\t"+faultInfoName+"(exception* e, int iExceptionCode);\n");
  -			
  -			
  +			writer.write("\t"+faultInfoName+"(exception* e, int iExceptionCode);\n");				
   			}catch(IOException e){
   				throw new WrapperFault(e);
   			}
  @@ -122,25 +119,55 @@
   				writer.write("\t const string getMessage(exception* e);\n");
   				writer.write("\t const string getMessage(int iExceptionCode);\n");
   				writer.write("private:\n\t void processException(exception* e);\n");
  -				writer.write("\t void processException("+faultType+" pFault);\n");
  +				writer.write("\t void processException(ISoapFault* pFault);\n");
   				writer.write("\t void processException(exception* e, int iExceptionCode);\n");
  -				writer.write("\t void processException(int iExceptionCode);\n");//damitha
  -				writer.write("\t string m_sMessage;\n");
				writer.write("\t int m_iExceptionCode;\n\n");
							
  +				writer.write("\t void processException(int iExceptionCode);\n");
  +				writer.write("\t string m_sMessage;\n");				writer.write("\t int m_iExceptionCode;\n\n");
							
   			}catch (Exception e) {
   			  e.printStackTrace();
   			  throw new WrapperFault(e);
   	    	}
   		}
   		
  -	protected String getFileType()
  +	    protected String getFileType()
   		{
   			return "Exception";	// must change accordingly
   		}
  -        protected String getExtendsPart(){return ": public AxisException";}//damitha
  -
  -}//end of main
  - 
  - 
  -//class AxisDivByZeroException : public AxisException
  -//{
  +        protected String getExtendsPart(){return ": public AxisException";}
  +        
  +	   public void getLangName() throws WrapperFault
  +	   {		
  +	       ArrayList methods;
  +   	       methods = wscontext.getSerInfo().getMethods();
  +	       MethodInfo minfo;
  +	       FaultInfo faultinfo;
  +  	       try
  +  	       {
  +				for (int i = 0; i < methods.size(); i++) 
  +				{
  +				    minfo = (MethodInfo)methods.get(i);
  +					Iterator paramsFault = minfo.getFaultType().iterator();
  +					String langName =null;
  +					String paramName =null;
  +					while (paramsFault.hasNext())
  +					{
  +					     FaultInfo info = (FaultInfo)paramsFault.next();			
  +						 ArrayList paramInfo =info.getParams();
  +						 for (int j= 0; j < paramInfo.size(); j++)
  +						 {
  +						     ParameterInfo par =(ParameterInfo)paramInfo.get(j);                        
                                                                                         
                                        
  +							 paramName  = par.getParamName();
  +							 langName =par.getLangName();								 
  +							 writer.write("#include \""+langName+".h\"\n\n");					 								
  +						  }
  +					  }
  +				   }			
  +			  }
  +			  catch(Exception e)
  +			  {
  +			 	   System.out.println("Error occured yet we continue to genarate other classes ...
you should check the error");
  +				   e.printStackTrace();
  +			  }	
  +	    }      
  +}
   
  
  
  
  1.3.2.1   +20 -24    ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionWriter.java
  
  Index: ExceptionWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionWriter.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- ExceptionWriter.java	12 Jun 2004 03:57:12 -0000	1.3
  +++ ExceptionWriter.java	8 Jul 2004 09:23:34 -0000	1.3.2.1
  @@ -31,21 +31,18 @@
    */
   public class ExceptionWriter extends CPPExceptionClassWriter{
   	   private WebServiceContext wscontext;
  -	   private ArrayList methods;		
  -	  // String  classname = "AxisDivByZeroException";	
  +	   private ArrayList methods;		  
   	   String faultInfoName;
   	   String langName;
   	   String faultType;
   	   
  -		public ExceptionWriter(WebServiceContext wscontext,String faultInfoName,String langName,String
faultType)throws WrapperFault{
  +		public ExceptionWriter(WebServiceContext wscontext,String faultInfoName)throws WrapperFault{
   			super(WrapperUtils.getClassNameFromFullyQualifiedName(wscontext.getSerInfo().getQualifiedServiceName()));
   			this.wscontext = wscontext;
   			this.methods = wscontext.getSerInfo().getMethods();
   			this.faultInfoName ="Axis"+faultInfoName+"Exception";
  -			this.langName =langName;
  -			this.faultType =faultType;
  -	
  -			
  +			//this.langName =langName;
  +			//this.faultType =faultType;			
   		}
   	
   	    protected File getFilePath() throws WrapperFault {
  @@ -98,26 +95,26 @@
   		writer.write("\tprocessException(m_iExceptionCode); \n");
   		writer.write("}\n\n");
   		
  -		writer.write(faultInfoName+"::"+faultInfoName+"("+faultType +"pFault)\n");
  +		writer.write(faultInfoName+"::"+faultInfoName+"(ISoapFault* pFault)\n");
   		writer.write("{\n");
  -		writer.write("\tm_iExceptionCode = AXISC_SERVICE_THROWN_EXCEPTION;\n");//damitha
  -		writer.write("\tprocessException(pFault);");//damitha
  +		writer.write("\tm_iExceptionCode = AXISC_SERVICE_THROWN_EXCEPTION;\n");
  +		writer.write("\tprocessException(pFault);");
   		writer.write("}\n\n");
   		
   		writer.write(faultInfoName+"::"+faultInfoName+"(int iExceptionCode)\n");
   		writer.write("{\n\n");
  -		writer.write("\tm_iExceptionCode = iExceptionCode;\n");//damitha
  -		writer.write("\tprocessException (iExceptionCode);\n");//damitha
  +		writer.write("\tm_iExceptionCode = iExceptionCode;\n");
  +		writer.write("\tprocessException (iExceptionCode);\n");
   		writer.write("}\n\n");
   		
   		writer.write(faultInfoName+"::"+faultInfoName+"(exception* e)\n");
   		writer.write("{\n");
  -		writer.write("\tprocessException (e);\n");//damitha
  +		writer.write("\tprocessException (e);\n");
   		writer.write("}\n\n");
   		
   		writer.write(faultInfoName+"::"+faultInfoName+"(exception* e,int iExceptionCode)\n");
   		writer.write("{\n\n");
  -		writer.write("\tprocessException (e, iExceptionCode);\n");//damitha
  +		writer.write("\tprocessException (e, iExceptionCode);\n");
   		writer.write("}\n\n");	
   	    }catch(IOException e){
   			throw new WrapperFault(e);
  @@ -135,33 +132,32 @@
   			}
   		}
   		
  -	   protected void writeMethods() throws WrapperFault {
  -	
  +	   protected void writeMethods() throws WrapperFault {	
   	   try{	
   	       writer.write("void "+faultInfoName+":: processException(exception* e, int iExceptionCode)\n");
   	       writer.write("{\n");
  -	       writer.write("\tm_sMessage = getMessage (e) + getMessage (iExceptionCode);\n");//damitha
  +	       writer.write("\tm_sMessage = getMessage (e) + getMessage (iExceptionCode);\n");
   	       writer.write("}\n\n");
   
  -	       writer.write("void "+faultInfoName+"::processException ("+faultType+" pFault)\n");
  +	       writer.write("void "+faultInfoName+"::processException (ISoapFault* pFault)\n");
   		   writer.write("{\n");
  -                   writer.write("\t/*User can do something like deserializing the struct
into a string*/");//damitha
  +           writer.write("\t/*User can do something like deserializing the struct into a
string*/\n");
   		   writer.write("}\n\n");
   
   		   writer.write("void "+faultInfoName+"::processException(exception* e)\n");
   		   writer.write("{\n");
  -		   writer.write("\tm_sMessage = getMessage (e);\n");//damitha
  +		   writer.write("\tm_sMessage = getMessage (e);\n");
   		   writer.write("}\n\n");
   
  -		    writer.write("void "+faultInfoName+"::processException(int iExceptionCode)\n");//damitha
  +		    writer.write("void "+faultInfoName+"::processException(int iExceptionCode)\n");
   		    writer.write("{\n");
  -		    writer.write("\tm_sMessage = getMessage (iExceptionCode);\n");//damitha
  +		    writer.write("\tm_sMessage = getMessage (iExceptionCode);\n");
   		    writer.write("}\n\n");
   		
   	       writer.write("const string "+faultInfoName+"::getMessage (exception* objException)\n");
   	       writer.write("{\n");
  -	       writer.write("\tstring sMessage = objException->what();\n");//damitha
  -	       writer.write("\treturn sMessage;\n");//damitha
  +	       writer.write("\tstring sMessage = objException->what();\n");
  +	       writer.write("\treturn sMessage;\n");
   	       writer.write("}\n\n");
   
   		   writer.write("const string "+faultInfoName+"::getMessage (int iExceptionCode)\n");
  
  
  
  No                   revision
  No                   revision
  1.6.2.1   +2 -2      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/doclit/DocLitWebServiceGenarator.java
  
  Index: DocLitWebServiceGenarator.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/doclit/DocLitWebServiceGenarator.java,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  --- DocLitWebServiceGenarator.java	12 Jun 2004 03:57:12 -0000	1.6
  +++ DocLitWebServiceGenarator.java	8 Jul 2004 09:23:35 -0000	1.6.2.1
  @@ -55,13 +55,13 @@
   				(new Genarator(WrapperConstants.GENERATOR_CLASSLOADER_CPP, wscontext)).genarate();
			 				 	
   				(new Genarator(WrapperConstants.GENERATOR_DEPLOYMENT, wscontext)).genarate();
   				(new Genarator(WrapperConstants.GENERATOR_UNDEPLOYMENT, wscontext)).genarate();
  -				(new Genarator(WrapperConstants.GENERATOR_EXCEPTION_ALL, wscontext)).genarate(); //nithya
  +				//(new Genarator(WrapperConstants.GENERATOR_SERVICE_EXCEPTION, wscontext)).genarate();
   				(new Genarator(WrapperConstants.GENERATOR_BUILDSCRIPT, wscontext)).genarate();
   			}else{
   				(new Genarator(WrapperConstants.GENERATOR_CLIENT_STUB_CPP, wscontext)).genarate();
   				(new Genarator(WrapperConstants.GENERATOR_CLIENT_STUB_HPP, wscontext)).genarate();
   				(new Genarator(WrapperConstants.GENERATOR_PARAM_CPP_ALL, wscontext)).genarate();
  -				(new Genarator(WrapperConstants.GENERATOR_EXCEPTION_ALL, wscontext)).genarate();//nithya
  +				(new Genarator(WrapperConstants.GENERATOR_CLIENT_EXCEPTION, wscontext)).genarate();//nithya
   				(new Genarator(WrapperConstants.GENERATOR_BUILDSCRIPT, wscontext)).genarate();
   			}
   		}else if(WrapperConstants.LANGUAGE_C.equalsIgnoreCase(language)){
  
  
  
  No                   revision
  No                   revision
  1.9.2.1   +2 -2      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/rpc/RPCWebServiceGenarator.java
  
  Index: RPCWebServiceGenarator.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/rpc/RPCWebServiceGenarator.java,v
  retrieving revision 1.9
  retrieving revision 1.9.2.1
  diff -u -r1.9 -r1.9.2.1
  --- RPCWebServiceGenarator.java	12 Jun 2004 03:57:12 -0000	1.9
  +++ RPCWebServiceGenarator.java	8 Jul 2004 09:23:35 -0000	1.9.2.1
  @@ -57,7 +57,7 @@
   				(new Genarator(WrapperConstants.GENERATOR_PARAM_CPP_ALL, wscontext)).genarate();	
   				(new Genarator(WrapperConstants.GENERATOR_CLASSLOADER_CPP, wscontext)).genarate();
   				(new Genarator(WrapperConstants.GENERATOR_DEPLOYMENT, wscontext)).genarate();
  -				(new Genarator(WrapperConstants.GENERATOR_EXCEPTION_ALL, wscontext)).genarate();
  +				//(new Genarator(WrapperConstants.GENERATOR_SERVER_EXCEPTION, wscontext)).genarate();
   				(new Genarator(WrapperConstants.GENERATOR_UNDEPLOYMENT, wscontext)).genarate();
   				/*
   				 * make sure the BuildScript generator is called at last. If you call earlier not all
files will be added
  @@ -67,7 +67,7 @@
   			}else{
   				(new Genarator(WrapperConstants.GENERATOR_CLIENT_STUB_CPP, wscontext)).genarate();
   				(new Genarator(WrapperConstants.GENERATOR_CLIENT_STUB_HPP, wscontext)).genarate();
  -				(new Genarator(WrapperConstants.GENERATOR_EXCEPTION_ALL, wscontext)).genarate();
  +				(new Genarator(WrapperConstants.GENERATOR_CLIENT_EXCEPTION, wscontext)).genarate();
   				(new Genarator(WrapperConstants.GENERATOR_PARAM_CPP_ALL, wscontext)).genarate();	
   				/*
   				 * make sure the BuildScript generator is called at last. If you call earlier not all
files will be added
  
  
  

Mime
View raw message