You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by da...@apache.org on 2004/07/22 14:44:39 UTC
cvs commit: ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp BeanParamWriter.java ClientStubWriter.java ClientStubHeaderWriter.java ServiceHeaderWriter.java AllExceptionWriter.java ExceptionHeaderWriter.java ExceptionWriter.java WrapWriter.java WrapHeaderWriter.java
damitha 2004/07/22 05:44:39
Modified: c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp
BeanParamWriter.java ClientStubWriter.java
ClientStubHeaderWriter.java
ServiceHeaderWriter.java AllExceptionWriter.java
ExceptionHeaderWriter.java ExceptionWriter.java
WrapWriter.java WrapHeaderWriter.java
Log:
Revision Changes Path
1.22 +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.22
diff -u -r1.21 -r1.22
--- BeanParamWriter.java 11 Jun 2004 05:01:28 -0000 1.21
+++ BeanParamWriter.java 22 Jul 2004 12:44:38 -0000 1.22
@@ -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.49 +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.49
diff -u -r1.48 -r1.49
--- ClientStubWriter.java 25 Jun 2004 08:57:17 -0000 1.48
+++ ClientStubWriter.java 22 Jul 2004 12:44:38 -0000 1.49
@@ -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.23 +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.23
diff -u -r1.22 -r1.23
--- ClientStubHeaderWriter.java 25 Jun 2004 08:57:17 -0000 1.22
+++ ClientStubHeaderWriter.java 22 Jul 2004 12:44:39 -0000 1.23
@@ -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.22 +3 -2 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.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- ServiceHeaderWriter.java 6 Jul 2004 07:16:03 -0000 1.21
+++ ServiceHeaderWriter.java 22 Jul 2004 12:44:39 -0000 1.22
@@ -160,7 +160,8 @@
Type atype;
Iterator types = this.wscontext.getTypemap().getTypes().iterator();
HashSet typeSet = new HashSet();
- writer.write("#include <axis/server/AxisUserAPI.h>\n\n");
+ writer.write("#include <axis/server/AxisUserAPI.h>\n");
+ writer.write("#include \"AxisServiceException.h\" \n\n");
String typeName = null;
while(types.hasNext()){
atype = (Type)types.next();
@@ -174,7 +175,7 @@
{
writer.write("#include \""+itr.next().toString()+".h\"\n");
}
- writeFaultHeaders();
+ //writeFaultHeaders();
writer.write("\n");
}catch (IOException e) {
e.printStackTrace();
1.3 +24 -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.3
diff -u -r1.2 -r1.3
--- AllExceptionWriter.java 8 Jun 2004 07:06:29 -0000 1.2
+++ AllExceptionWriter.java 22 Jul 2004 12:44:39 -0000 1.3
@@ -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,36 @@
*/
public class AllExceptionWriter implements SourceWriter{
private WebServiceContext wscontext;
+private String strFlag="";
-public AllExceptionWriter(WebServiceContext wscontext){
- this.wscontext =wscontext;
-}
+ public AllExceptionWriter(WebServiceContext wscontext,String strFlag){
+ 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("Server"))
+ {
+ (new ExceptionHeaderWriter(wscontext,"Service")).writeSource();
+ (new ExceptionWriter(wscontext,"Service")).writeSource();
+ }
+ }
+ catch(Exception e)
+ {
System.out.println("Error occured yet we continue to genarate other classes ... you should check the error");
e.printStackTrace();
- }
- }
+ }
+ }
}
1.3 +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.3
diff -u -r1.2 -r1.3
--- ExceptionHeaderWriter.java 11 Jun 2004 05:01:28 -0000 1.2
+++ ExceptionHeaderWriter.java 22 Jul 2004 12:44:39 -0000 1.3
@@ -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.4 +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.4
diff -u -r1.3 -r1.4
--- ExceptionWriter.java 12 Jun 2004 03:57:12 -0000 1.3
+++ ExceptionWriter.java 22 Jul 2004 12:44:39 -0000 1.4
@@ -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");
1.31 +10 -9 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.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- WrapWriter.java 6 Jul 2004 07:16:03 -0000 1.30
+++ WrapWriter.java 22 Jul 2004 12:44:39 -0000 1.31
@@ -383,15 +383,16 @@
private void writeExceptions(String faulttype,String faultInfoName,String paramName,String langName) throws WrapperFault{
try{
- writer.write("\tcatch(Axis"+faultInfoName+"Exception& e)\n"); //nithya
- writer.write("\t{\n");
- writer.write("\t\tpIWSSZ->createSoapFault(\""+langName+"\", \""+wscontext.getWrapInfo().getTargetNameSpaceOfWSDL()+"\");\n");
- writer.write("\t\t"+faulttype+" pObjFault = new "+langName+"();\n");//damitha
- writer.write("\t\t/*User may write code here to fill the struct*/\n");
- writer.write("\t\tif (pObjFault)\n");
- writer.write("\t\t\tpIWSSZ->addFaultDetail(pObjFault, (void*) Axis_Serialize_"+langName+",\n");//damitha
- writer.write("\t\t\t(void*) Axis_Delete_"+langName+",\""+faultInfoName+"\", Axis_URI_"+langName+");\n");//damitha
- writer.write("\t\tthrow;\n");//damitha
+ writer.write("\tcatch("+faulttype+" pObjFault)\n");
+ writer.write("\t{\n");
+ writer.write("\t\tif (pObjFault)\n");
+ writer.write("\t\t{\n");
+ writer.write("\t\tpIWSSZ->createSoapFault(\""+langName+"\", \""+wscontext.getWrapInfo().getTargetNameSpaceOfWSDL()+"\",\"AxisC++ Faultcode\", \"Custom Out of bound exception\");\n");
+ // writer.write("\t\t"+faulttype+" pObjFault = new "+langName+"();\n");
+ writer.write("\t\t\tpIWSSZ->addFaultDetail(pObjFault, (void*) Axis_Serialize_"+langName+",\n");
+ writer.write("\t\t\t(void*) Axis_Delete_"+langName+",\""+langName+"\", Axis_URI_"+langName+");\n");
+ writer.write("\t\tthrow AxisServiceException();\n");
+ writer.write("\t\t}\n");
writer.write("\t}\n");
writer.write("\n");
}
1.16 +3 -2 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.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- WrapHeaderWriter.java 6 Jul 2004 07:16:03 -0000 1.15
+++ WrapHeaderWriter.java 22 Jul 2004 12:44:39 -0000 1.16
@@ -117,8 +117,9 @@
writer.write("#include <axis/server/WrapperClassHandler.h>\n");
writer.write("#include <axis/server/IMessageData.h>\n");
writer.write("#include <axis/server/GDefine.h>\n");
- writer.write("#include <axis/server/AxisWrapperAPI.h>\n\n");
- writeFaultHeaders();
+ writer.write("#include <axis/server/AxisWrapperAPI.h>\n");
+ writer.write("#include \"AxisServiceException.h\" \n\n");
+ //writeFaultHeaders();
}catch(IOException e){
throw new WrapperFault(e);