axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nadira...@apache.org
Subject svn commit: r688130 [2/7] - in /webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws: ./ c/ c/literal/ cpp/ cpp/literal/
Date Fri, 22 Aug 2008 17:37:40 GMT
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ClientStubWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ClientStubWriter.java?rev=688130&r1=688129&r2=688130&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ClientStubWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ClientStubWriter.java Fri Aug 22 10:37:39 2008
@@ -59,10 +59,10 @@
     {
         try
         {
-            writer.write("/*\n");
-            writer.write(" * This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)\n");
-            writer.write(" * This file contains Client Stub implementation for remote web service.\n");
-            writer.write(" */\n\n");
+            c_writer.write("/*\n");
+            c_writer.write(" * This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)\n");
+            c_writer.write(" * This file contains Client Stub implementation for remote web service.\n");
+            c_writer.write(" */\n\n");
         }
         catch (IOException e)
         {
@@ -78,36 +78,36 @@
         try
           {            
             // get_xxx_stub() routine
-            CUtils.printMethodComment(writer, "Function to get new object representing a Web service stub.");
+            CUtils.printMethodComment(c_writer, "Function to get new object representing a Web service stub.");
             
-            writer.write("AXISCHANDLE get_" + classname + "_stub(const char* pchEndPointUri)\n{\n");
-            writer.write("\tif(pchEndPointUri)\n");
-            writer.write("\t\treturn axiscStubCreate(pchEndPointUri, AXISC_APTHTTP1_1);\n");
-            writer.write("\telse\n");
-            writer.write("\t\treturn axiscStubCreate(\"" 
+            c_writer.write("AXISCHANDLE get_" + c_classname + "_stub(const char* pchEndPointUri)\n{\n");
+            c_writer.write("\tif(pchEndPointUri)\n");
+            c_writer.write("\t\treturn axiscStubCreate(pchEndPointUri, AXISC_APTHTTP1_1);\n");
+            c_writer.write("\telse\n");
+            c_writer.write("\t\treturn axiscStubCreate(\"" 
                     + wscontext.getServiceInfo().getTargetEndpointURI() 
                     + "\", AXISC_APTHTTP1_1);\n");
-            writer.write("}\n\n");
+            c_writer.write("}\n\n");
             
             // destroy_xxxx_stub()
-            CUtils.printMethodComment(writer, "Function to destroy an object representing a Web service stub.");
+            CUtils.printMethodComment(c_writer, "Function to destroy an object representing a Web service stub.");
             
-            writer.write("void destroy_" + classname + "_stub(AXISCHANDLE p)\n{\n");
-            writer.write("\taxiscStubDestroy(p);\n}\n\n");
+            c_writer.write("void destroy_" + c_classname + "_stub(AXISCHANDLE p)\n{\n");
+            c_writer.write("\taxiscStubDestroy(p);\n}\n\n");
 
             // get_xxxx_Status() routine
-            CUtils.printMethodComment(writer, "Function to get the status of last Web service method invocation.");
+            CUtils.printMethodComment(c_writer, "Function to get the status of last Web service method invocation.");
             
-            writer.write("int get_" + classname + "_Status(AXISCHANDLE stub)\n{\n");
-            writer.write("\tAXISCHANDLE call = axiscStubGetCall(stub);\n");
-            writer.write("\treturn axiscCallGetStatus(call);\n");
-            writer.write("}\n\n");
+            c_writer.write("int get_" + c_classname + "_Status(AXISCHANDLE stub)\n{\n");
+            c_writer.write("\tAXISCHANDLE call = axiscStubGetCall(stub);\n");
+            c_writer.write("\treturn axiscCallGetStatus(call);\n");
+            c_writer.write("}\n\n");
 
-            CUtils.printMethodComment(writer, "Function to set a Web service stub's exception handler.");
-            writer.write("void set_" + classname 
+            CUtils.printMethodComment(c_writer, "Function to set a Web service stub's exception handler.");
+            c_writer.write("void set_" + c_classname 
                     + "_ExceptionHandler(AXISCHANDLE stub, AXIS_EXCEPTION_HANDLER_FUNCT fp)\n{\n");          
-            writer.write("\taxiscStubSetCExceptionHandler(stub, (void *)fp);\n");          
-            writer.write("}\n");
+            c_writer.write("\taxiscStubSetCExceptionHandler(stub, (void *)fp);\n");          
+            c_writer.write("}\n");
             
             MethodInfo minfo;
             for (int i = 0; i < methods.size(); i++)
@@ -130,18 +130,18 @@
         try
         {
             //writer.write("#include <stdlib.h>\n");
-            writer.write("#include <stdio.h>\n");
-            writer.write("#include <string.h>\n");
-            writer.write("\n");
-            
-            writer.write("#include \"" + classname + CUtils.getHeaderFileExtension() + "\"\n");
-            writer.write("\n");
-            writer.write("#include <axis/client/Stub.h>\n");
-            writer.write("#include <axis/client/Call.h>\n");
-            writer.write("#include <axis/IWrapperSoapSerializer.h>\n");
-            writer.write("#include <axis/IWrapperSoapDeSerializer.h>\n");
+            c_writer.write("#include <stdio.h>\n");
+            c_writer.write("#include <string.h>\n");
+            c_writer.write("\n");
+            
+            c_writer.write("#include \"" + c_classname + CUtils.getHeaderFileExtension() + "\"\n");
+            c_writer.write("\n");
+            c_writer.write("#include <axis/client/Stub.h>\n");
+            c_writer.write("#include <axis/client/Call.h>\n");
+            c_writer.write("#include <axis/IWrapperSoapSerializer.h>\n");
+            c_writer.write("#include <axis/IWrapperSoapDeSerializer.h>\n");
             
-            writer.write("\n");
+            c_writer.write("\n");
         }
         catch (IOException e)
         {
@@ -190,7 +190,7 @@
             }
         }
 
-        CUtils.printMethodComment(writer, "This function wraps the service method " + methodName + ".");
+        CUtils.printMethodComment(c_writer, "This function wraps the service method " + methodName + ".");
         
         //method signature
         String paramTypeName;
@@ -198,25 +198,25 @@
         boolean typeissimple = false;
         Type type;
         if (returntype == null)
-            writer.write("void");
+            c_writer.write("void");
         else
         {
             if (returntypeissimple
                     && (!(returntype.isNillable() || returntype.isOptional()) 
                             || CUtils.isPointerType(outparamTypeName)))
-                writer.write (outparamTypeName);
+                c_writer.write (outparamTypeName);
             else if (outparamTypeName.lastIndexOf ("*") > 0)
-                writer.write (outparamTypeName);
+                c_writer.write (outparamTypeName);
             else
-                writer.write (outparamTypeName + "*");
+                c_writer.write (outparamTypeName + "*");
 
         }
         
-        writer.write(" " + methodName + "(AXISCHANDLE stub");
+        c_writer.write(" " + methodName + "(AXISCHANDLE stub");
         ArrayList paramsB = (ArrayList) params;
         for (int i = 0; i < paramsB.size(); i++)
         {
-            writer.write(", ");
+            c_writer.write(", ");
             
             paramTypeName = 
                 CUtils.getClassNameFromParamInfoConsideringArrays((ParameterInfo) paramsB.get(i), wscontext);
@@ -226,11 +226,11 @@
                     && (!(((ParameterInfo) paramsB.get (0)).isNillable () 
                             || ((ParameterInfo) paramsB.get (0)).isOptional())
                     || CUtils.isPointerType(paramTypeName)))
-                writer.write (paramTypeName + " Value" + i);
+                c_writer.write (paramTypeName + " Value" + i);
             else if (paramTypeName.lastIndexOf ("*") > 0)
-                writer.write (paramTypeName + " Value" + i);
+                c_writer.write (paramTypeName + " Value" + i);
             else
-                writer.write (paramTypeName + "* Value" + i);
+                c_writer.write (paramTypeName + "* Value" + i);
         }
         
         // Multiples parameters so fill the methods prototype
@@ -241,19 +241,19 @@
             {
                 type = wscontext.getTypemap().getType(
                         ((ParameterInfo) paramsC.get(i)).getSchemaName());
-                writer.write(", AXISC_OUT_PARAM  "
+                c_writer.write(", AXISC_OUT_PARAM  "
                     + CUtils.getClassNameFromParamInfoConsideringArrays(
                                 (ParameterInfo) paramsC.get(i),wscontext) + " *OutValue" + i);
             }
         }
         
-        writer.write(")\n{\n");
+        c_writer.write(")\n{\n");
         
-        writer.write("\tAXISCHANDLE call = axiscStubGetCall(stub);\n");
+        c_writer.write("\tAXISCHANDLE call = axiscStubGetCall(stub);\n");
         
         if (returntype != null)
         {
-            writer.write("\t");
+            c_writer.write("\t");
             if (returntypeisarray)
             {
                 QName qname = null;
@@ -262,73 +262,73 @@
                 else
                     qname = retType.getName ();
                 if (CUtils.isSimpleType (qname))               
-                    writer.write(outparamTypeName + " *RetArray = (" + outparamTypeName + " *)axiscAxisNew(XSDC_ARRAY, 0);\n");
+                    c_writer.write(outparamTypeName + " *RetArray = (" + outparamTypeName + " *)axiscAxisNew(XSDC_ARRAY, 0);\n");
                 else
-                    writer.write(outparamTypeName + " *RetArray = (" + outparamTypeName + " *)Axis_Create_" + outparamTypeName + "(0);\n");
+                    c_writer.write(outparamTypeName + " *RetArray = (" + outparamTypeName + " *)Axis_Create_" + outparamTypeName + "(0);\n");
             }
             else if (!returntypeissimple)
-                writer.write(outparamTypeName + "\tpReturn = NULL;\n");
+                c_writer.write(outparamTypeName + "\tpReturn = NULL;\n");
             else if (returntype.isNillable() || returntype.isOptional()
                         || CUtils.isPointerType(outparamTypeName))
             {
-                writer.write(outparamTypeName);
+                c_writer.write(outparamTypeName);
                 if (!CUtils.isPointerType(outparamTypeName))
-                    writer.write(" *");
+                    c_writer.write(" *");
 
-                writer.write("\tRet = NULL;\n");
+                c_writer.write("\tRet = NULL;\n");
             }
             else
             {
                 String initValue = CUtils.getInitValueForType(outparamTypeName);
                 if (initValue != null)
-                    writer.write(outparamTypeName + " Ret = " + initValue + ";\n");
+                    c_writer.write(outparamTypeName + " Ret = " + initValue + ";\n");
                 else if (outparamTypeName.equals("xsdc__dateTime")
                         || outparamTypeName.equals("xsdc__date")
                         || outparamTypeName.equals("xsdc__time"))
                 {
-                    writer.write(outparamTypeName + " Ret;\n");
-                    writer.write("\tmemset(&Ret,0,sizeof(" + outparamTypeName + "));\n");
+                    c_writer.write(outparamTypeName + " Ret;\n");
+                    c_writer.write("\tmemset(&Ret,0,sizeof(" + outparamTypeName + "));\n");
                 }
                 else
-                    writer.write(outparamTypeName + " Ret;\n");
+                    c_writer.write(outparamTypeName + " Ret;\n");
             }
         }
 
         //writer.write("\tchar* cFaultcode;\n");
         //writer.write("\tchar* cFaultstring;\n");
         //writer.write("\tchar* cFaultactor;\n");
-        writer.write("\tconst char *\tpcCmplxFaultName = NULL;\n\n");
+        c_writer.write("\tconst char *\tpcCmplxFaultName = NULL;\n\n");
 
-        writer.write("\n\tif( AXISC_SUCCESS != axiscCallInitialize(call, CPP_RPC_PROVIDER"
+        c_writer.write("\n\tif( AXISC_SUCCESS != axiscCallInitialize(call, CPP_RPC_PROVIDER"
                         + "))\n\t\treturn ");
 
         if (returntype != null)
         {
             if (returntypeisarray)
-                writer.write("RetArray;\n");
+                c_writer.write("RetArray;\n");
             else if (CUtils.isPointerType(outparamTypeName) || 
                        (returntypeissimple && !(returntype.isNillable() || returntype.isOptional())))
-                writer.write("Ret;\n");
+                c_writer.write("Ret;\n");
             else if (returntypeissimple)
-                writer.write("*Ret;\n");
+                c_writer.write("*Ret;\n");
             else
-                writer.write("pReturn;\n");
+                c_writer.write("pReturn;\n");
         }
         else
-            writer.write(";\n");
+            c_writer.write(";\n");
 
-        writer.write("\n");
+        c_writer.write("\n");
 
-        writer.write("\tif( NULL == axiscCallGetTransportProperty(call, \"SOAPAction\", 0))\n");
-        writer.write("\t\taxiscCallSetTransportProperty(call, AXISC_SOAPACTION_HEADER,\""
+        c_writer.write("\tif( NULL == axiscCallGetTransportProperty(call, \"SOAPAction\", 0))\n");
+        c_writer.write("\t\taxiscCallSetTransportProperty(call, AXISC_SOAPACTION_HEADER,\""
                 + minfo.getSoapAction() + "\");\n");
 
-        writer.write("\taxiscCallSetSOAPVersion(call, SOAP_VER_1_1);\n");
+        c_writer.write("\taxiscCallSetSOAPVersion(call, SOAP_VER_1_1);\n");
         //TODO check which version is it really.
-        writer.write("\taxiscCallSetOperation(call, \"" + minfo.getMethodname()
+        c_writer.write("\taxiscCallSetOperation(call, \"" + minfo.getMethodname()
                 + "\", \"" + wscontext.getWrapperInfo().getTargetNameSpaceOfWSDL()
                 + "\");\n");
-        writer.write ("\taxiscStubApplyUserPreferences(stub);\n");        
+        c_writer.write ("\taxiscStubApplyUserPreferences(stub);\n");        
         
         for (int i = 0; i < paramsB.size(); i++)
         {
@@ -355,8 +355,8 @@
                 if (CUtils.isSimpleType(qname))
                 {
                     containedType = CUtils.getSimpleType(qname);
-                    writer.write("\taxiscCallAddBasicArrayParameter(call, ");
-                    writer.write("(Axisc_Array *)Value" + i + ", "
+                    c_writer.write("\taxiscCallAddBasicArrayParameter(call, ");
+                    c_writer.write("(Axisc_Array *)Value" + i + ", "
                             + CUtils.getXSDEnumeratorForType(containedType)
                             + ", \""
                             + ((ParameterInfo) paramsB.get(i)).getParamNameAsSOAPString()
@@ -365,8 +365,8 @@
                 else
                 {
                     containedType = qname.getLocalPart();
-                    writer.write("\taxiscCallAddCmplxArrayParameter(call, ");
-                    writer.write("(Axisc_Array *)Value" + i
+                    c_writer.write("\taxiscCallAddCmplxArrayParameter(call, ");
+                    c_writer.write("(Axisc_Array *)Value" + i
                             + ",(void *) Axis_Serialize_" + containedType
                             + ",(void *) Axis_Delete_" + containedType
                             + ",\"" + ((ParameterInfo) paramsB.get(i)).getParamNameAsSOAPString() + "\""
@@ -380,8 +380,8 @@
                 if (((ParameterInfo) paramsB.get(i)).isNillable()
                         || CUtils.isPointerType(paramTypeName))
                 {
-                    writer.write("\taxiscCallAddParameter(call, ");
-                    writer.write("(void *) Value"
+                    c_writer.write("\taxiscCallAddParameter(call, ");
+                    c_writer.write("(void *) Value"
                             + i
                             + ", \""
                             + ((ParameterInfo) paramsB.get(i))
@@ -390,8 +390,8 @@
                 }
                 else
                 {
-                    writer.write("\taxiscCallAddParameter(call, ");
-                    writer.write("(void *) &Value"
+                    c_writer.write("\taxiscCallAddParameter(call, ");
+                    c_writer.write("(void *) &Value"
                             + i
                             + ", \""
                             + ((ParameterInfo) paramsB.get(i))
@@ -402,17 +402,17 @@
             else
             {
                 //for complex types
-                writer.write("\taxiscCallAddCmplxParameter(call, ");
-                writer.write("Value" + i + ",(void *) Axis_Serialize_"
+                c_writer.write("\taxiscCallAddCmplxParameter(call, ");
+                c_writer.write("Value" + i + ",(void *) Axis_Serialize_"
                         + paramTypeName + ",(void *) Axis_Delete_"
                         + paramTypeName + ",\""
                         + ((ParameterInfo) paramsB.get(i)).getParamNameAsSOAPString()
                         + "\",Axis_URI_" + paramTypeName);
             }
-            writer.write(");\n");
+            c_writer.write(");\n");
         }
-        writer.write("\n\tif( AXISC_SUCCESS == axiscCallSendAndReceive(call))\n\t{\n");
-        writer.write("\t\tif( AXISC_SUCCESS == axiscCallCheckMessage(call, \""
+        c_writer.write("\n\tif( AXISC_SUCCESS == axiscCallSendAndReceive(call))\n\t{\n");
+        c_writer.write("\t\tif( AXISC_SUCCESS == axiscCallCheckMessage(call, \""
                 + minfo.getOutputMessage().getLocalPart() + "\",\""
                 + wscontext.getWrapperInfo().getTargetNameSpaceOfWSDL()
                 + "\"))\n\t\t{\n");
@@ -455,47 +455,47 @@
                     if (CUtils.isSimpleType(qname))
                     {
                         containedType = CUtils.getSimpleType(qname);
-                        writer.write("\n\t\tAxisc_Array * pReturn" + i 
+                        c_writer.write("\n\t\tAxisc_Array * pReturn" + i 
                                 + " = axiscCallGetBasicArray(call, " 
                                 + CUtils.getXSDEnumeratorForType (containedType) 
                                 + ",\"" + currentType.getParamNameAsSOAPString() + "\",0);\n\n");
-                        writer.write("\t\tif( OutValue" + i + " != NULL)\n");
-                        writer.write("\t\t{\n");
-                        writer.write("\t\t\tif( *OutValue" + i + " != NULL)\n");
-                        writer.write("\t\t\t\taxiscAxisDelete(*OutValue" + i + ", XSDC_ARRAY);\n");                        
-                        writer.write("\t\t\t\t*OutValue" + i + " = pReturn;\n");
-                        writer.write("\t\t}\n\n");
-                        writer.write("\t\telse\n");                        
-                        writer.write("\t\t\taxiscAxisDelete(pReturn" + i + ", XSDC_ARRAY);\n");
+                        c_writer.write("\t\tif( OutValue" + i + " != NULL)\n");
+                        c_writer.write("\t\t{\n");
+                        c_writer.write("\t\t\tif( *OutValue" + i + " != NULL)\n");
+                        c_writer.write("\t\t\t\taxiscAxisDelete(*OutValue" + i + ", XSDC_ARRAY);\n");                        
+                        c_writer.write("\t\t\t\t*OutValue" + i + " = pReturn;\n");
+                        c_writer.write("\t\t}\n\n");
+                        c_writer.write("\t\telse\n");                        
+                        c_writer.write("\t\t\taxiscAxisDelete(pReturn" + i + ", XSDC_ARRAY);\n");
                     }
                     else
                     {
                         containedType = qname.getLocalPart();
-                        writer.write("\n\t\tif( OutValue" + i + " != NULL)\n" );
-                        writer.write("\t\t{\n");
-                        writer.write("\t\t\tif( " + currentParamName + " != NULL)\n");
-                        writer.write("\t\t\t\tAxis_Delete_" + containedType + "_Array(" + currentParamName + ", 0);\n");
-                        writer.write("\t\t\t" + currentParamName + " = (" + containedType + " *)Axis_Create_" + containedType + "_Array(0);\n");
+                        c_writer.write("\n\t\tif( OutValue" + i + " != NULL)\n" );
+                        c_writer.write("\t\t{\n");
+                        c_writer.write("\t\t\tif( " + currentParamName + " != NULL)\n");
+                        c_writer.write("\t\t\t\tAxis_Delete_" + containedType + "_Array(" + currentParamName + ", 0);\n");
+                        c_writer.write("\t\t\t" + currentParamName + " = (" + containedType + " *)Axis_Create_" + containedType + "_Array(0);\n");
 
-                        writer.write("\t\t\taxiscCallGetCmplxArray(call, " + currentParamName 
+                        c_writer.write("\t\t\taxiscCallGetCmplxArray(call, " + currentParamName 
                                 + ",(void *) Axis_DeSerialize_" + containedType
                                 + ",(void *) Axis_Create_" + containedType
                                 + ",(void *) Axis_Delete_" + containedType
                                 + ",\"" +currentType.getElementNameAsSOAPString() 
                                 + "\",Axis_URI_" + containedType + ");\n");
-                        writer.write("\t\t}\n");
-                        writer.write("\t\telse\n");
-                        writer.write("\t\t{\n");
-                        writer.write("\t\t\t// Unable to return value, but will deserialize to ensure subsequent elements can be correctly processed.\n");
-                        writer.write("\t\t\t" + containedType + "_Array * pTemp" + i + " = (" + containedType + " *)Axis_Create_" + containedType + "_Array(0);\n");
-                        writer.write("\t\t\taxiscCallGetCmplxArray(call, pTemp" + i 
+                        c_writer.write("\t\t}\n");
+                        c_writer.write("\t\telse\n");
+                        c_writer.write("\t\t{\n");
+                        c_writer.write("\t\t\t// Unable to return value, but will deserialize to ensure subsequent elements can be correctly processed.\n");
+                        c_writer.write("\t\t\t" + containedType + "_Array * pTemp" + i + " = (" + containedType + " *)Axis_Create_" + containedType + "_Array(0);\n");
+                        c_writer.write("\t\t\taxiscCallGetCmplxArray(call, pTemp" + i 
                                 + ",(void *) Axis_DeSerialize_" + containedType
                                 + ",(void *) Axis_Create_" + containedType
                                 + ",(void *) Axis_Delete_" + containedType
                                 + ",\"" + currentType.getElementNameAsSOAPString() 
                                 + "\",Axis_URI_" + containedType + ");\n");
-                        writer.write("\t\t\t\tAxis_Delete_" + containedType + "_Array(pTemp" + i + ", 0);\n");
-                        writer.write("\t\t}\n");
+                        c_writer.write("\t\t\t\tAxis_Delete_" + containedType + "_Array(pTemp" + i + ", 0);\n");
+                        c_writer.write("\t\t}\n");
                     }
                 }
                 else
@@ -503,7 +503,7 @@
                     if (typeissimple)
                     {
                         if( i > 0)
-                            writer.write( "\n");
+                            c_writer.write( "\n");
                         
                         if (CUtils.isPointerType(currentParaType))
                         {
@@ -512,47 +512,47 @@
                             if( !CUtils.isPointerType(xsdType))
                                 xsdType += " *";
                             
-                            writer.write( "\n");
-                            writer.write( "\t\t\tif( pReturn" + i + " != NULL && OutValue" + i + " != NULL)\n");
-                            writer.write( "\t\t\t{\n");
-                            writer.write( "\t\t\t\tif( *OutValue" + i + " != NULL)\n");
-                            writer.write( "\t\t\t\t{\n");
-                            writer.write( "\t\t\t\t\tint\tiStringSize" + i + " = strlen( (char *) *OutValue" + i + ");\n");
-                            writer.write( "\t\t\t\t\tint\tiStrLenValue" + i + " = strlen( pReturn" + i + ");\n");
-                            writer.write( "\n");
-                            writer.write( "\t\t\t\t\tif( iStrLenValue" + i + " > iStringSize" + i + ")\n");
-                            writer.write( "\t\t\t\t\t{\n");
-                            writer.write( "\t\t\t\t\t\t*OutValue" + i + " =(" + xsdType + ") axiscAxisNew(XSDC_STRING, iStrLenValue" + i + " + 1);\n");
-                            writer.write( "\t\t\t\t\t\tstrcpy( (char *) *OutValue" + i + ", pReturn" + i + ");\n");
-                            writer.write( "\t\t\t\t\t}\n");
-                            writer.write( "\t\t\t\t\telse\n");
-                            writer.write( "\t\t\t\t\t\tstrcpy( (char *) *OutValue" + i + ", pReturn" + i + ");\n");
-                            writer.write( "\t\t\t\t}\n");
-                            writer.write( "\t\t\t\telse\n");
-                            writer.write( "\t\t\t\t{\n");
-                            writer.write( "\t\t\t\t\t*OutValue" + i + " = (" + xsdType + ") axiscAxisNew(XSDC_STRING,strlen( pReturn" + i + ") + 1);\n");
-                            writer.write( "\t\t\t\t\tstrcpy( (char *) *OutValue" + i + ", pReturn" + i + ");\n");
-                            writer.write( "\t\t\t\t}\n");
-                            writer.write( "\t\t\t}\n");
-                            writer.write( "\n");
-                            writer.write( "\t\t\taxiscAxisDelete( (void *) pReturn" + i + ", " + CUtils.getXSDEnumeratorForType( currentParaType) + ");\n");
+                            c_writer.write( "\n");
+                            c_writer.write( "\t\t\tif( pReturn" + i + " != NULL && OutValue" + i + " != NULL)\n");
+                            c_writer.write( "\t\t\t{\n");
+                            c_writer.write( "\t\t\t\tif( *OutValue" + i + " != NULL)\n");
+                            c_writer.write( "\t\t\t\t{\n");
+                            c_writer.write( "\t\t\t\t\tint\tiStringSize" + i + " = strlen( (char *) *OutValue" + i + ");\n");
+                            c_writer.write( "\t\t\t\t\tint\tiStrLenValue" + i + " = strlen( pReturn" + i + ");\n");
+                            c_writer.write( "\n");
+                            c_writer.write( "\t\t\t\t\tif( iStrLenValue" + i + " > iStringSize" + i + ")\n");
+                            c_writer.write( "\t\t\t\t\t{\n");
+                            c_writer.write( "\t\t\t\t\t\t*OutValue" + i + " =(" + xsdType + ") axiscAxisNew(XSDC_STRING, iStrLenValue" + i + " + 1);\n");
+                            c_writer.write( "\t\t\t\t\t\tstrcpy( (char *) *OutValue" + i + ", pReturn" + i + ");\n");
+                            c_writer.write( "\t\t\t\t\t}\n");
+                            c_writer.write( "\t\t\t\t\telse\n");
+                            c_writer.write( "\t\t\t\t\t\tstrcpy( (char *) *OutValue" + i + ", pReturn" + i + ");\n");
+                            c_writer.write( "\t\t\t\t}\n");
+                            c_writer.write( "\t\t\t\telse\n");
+                            c_writer.write( "\t\t\t\t{\n");
+                            c_writer.write( "\t\t\t\t\t*OutValue" + i + " = (" + xsdType + ") axiscAxisNew(XSDC_STRING,strlen( pReturn" + i + ") + 1);\n");
+                            c_writer.write( "\t\t\t\t\tstrcpy( (char *) *OutValue" + i + ", pReturn" + i + ");\n");
+                            c_writer.write( "\t\t\t\t}\n");
+                            c_writer.write( "\t\t\t}\n");
+                            c_writer.write( "\n");
+                            c_writer.write( "\t\t\taxiscAxisDelete( (void *) pReturn" + i + ", " + CUtils.getXSDEnumeratorForType( currentParaType) + ");\n");
                         }
                         else 
                         {
-                            writer.write( "\t\t" + currentParaType + " * pReturn" + i + " = axiscCall" + CUtils.getDeserializerMethodName( currentParaType, false) + "(call, \"" + currentType.getParamNameAsSOAPString() + "\", 0);\n");
-                            writer.write( "\n");
-                            writer.write( "\t\tif( pReturn" + i + " != NULL && OutValue" + i + " != NULL)\n");
-                            writer.write( "\t\t{\n");
-                            writer.write( "\t\t\t// OutValue" + i + " is not nillable.\n");
-                            writer.write( "\t\t\t*OutValue" + i + " = *pReturn" + i + ";\n");
-                            writer.write( "\t\t}\n");
-                            writer.write( "\n");
-                            writer.write( "\t\taxiscAxisDelete(pReturn" + i + ", " + CUtils.getXSDEnumeratorForType( currentParaType) + ");\n");
+                            c_writer.write( "\t\t" + currentParaType + " * pReturn" + i + " = axiscCall" + CUtils.getDeserializerMethodName( currentParaType, false) + "(call, \"" + currentType.getParamNameAsSOAPString() + "\", 0);\n");
+                            c_writer.write( "\n");
+                            c_writer.write( "\t\tif( pReturn" + i + " != NULL && OutValue" + i + " != NULL)\n");
+                            c_writer.write( "\t\t{\n");
+                            c_writer.write( "\t\t\t// OutValue" + i + " is not nillable.\n");
+                            c_writer.write( "\t\t\t*OutValue" + i + " = *pReturn" + i + ";\n");
+                            c_writer.write( "\t\t}\n");
+                            c_writer.write( "\n");
+                            c_writer.write( "\t\taxiscAxisDelete(pReturn" + i + ", " + CUtils.getXSDEnumeratorForType( currentParaType) + ");\n");
                         }
                     }
                     else
                     {
-                        writer.write("\t\t\t"
+                        c_writer.write("\t\t\t"
                                         + currentParamName
                                         + " = ("
                                         + currentParaType
@@ -564,15 +564,15 @@
                     }
                 }
             }
-            writer.write("\t\t}\n");
-            writer.write("\t}\n\n");
-            writer.write("\taxiscCallUnInitialize(call);\n");
+            c_writer.write("\t\t}\n");
+            c_writer.write("\t}\n\n");
+            c_writer.write("\taxiscCallUnInitialize(call);\n");
         }
         else if (returntype == null)
         {
-            writer.write("\t\t\t/*not successful*/\n\t\t\t}\n");
-            writer.write("\t}\n\n");
-            writer.write("\taxiscCallUnInitialize(call);\n");
+            c_writer.write("\t\t\t/*not successful*/\n\t\t\t}\n");
+            c_writer.write("\t}\n\n");
+            c_writer.write("\taxiscCallUnInitialize(call);\n");
         }
         else if (returntypeisarray)
         {
@@ -581,73 +581,73 @@
             if (CUtils.isSimpleType(qname))
             {
                 containedType = CUtils.getSimpleType(qname);
-                writer.write("\t\t\tRetArray = (" + containedType + "_Array *)axiscCallGetBasicArray(call, "
+                c_writer.write("\t\t\tRetArray = (" + containedType + "_Array *)axiscCallGetBasicArray(call, "
                         + CUtils.getXSDEnumeratorForType(containedType) + ",\""
                         + paramTagName + "\",0);\n");
             }
             else
             {
                 containedType = qname.getLocalPart();
-                writer.write("\t\t\tRetArray = (" + containedType 
+                c_writer.write("\t\t\tRetArray = (" + containedType 
                         + "_Array *) axiscCallGetCmplxArray(call, (Axisc_Array *)RetArray,(void *) Axis_DeSerialize_"
                         + containedType);
                 //damitha
-                writer.write(",(void *) Axis_Create_" + containedType
+                c_writer.write(",(void *) Axis_Create_" + containedType
                         + ",(void *) Axis_Delete_" + containedType
                         + ",\"" + paramTagName
                         + "\",Axis_URI_" + containedType + ");\n");            
             }
-            writer.write("\t\t}\n\t}\n\n");
-            writer.write("\taxiscCallUnInitialize(call);\n\n");
+            c_writer.write("\t\t}\n\t}\n\n");
+            c_writer.write("\taxiscCallUnInitialize(call);\n\n");
 
-            writer.write("\treturn RetArray;\n");
+            c_writer.write("\treturn RetArray;\n");
         }
         else if (returntypeissimple)
         {
-            writer.write("\t\t\t" + outparamTypeName);
+            c_writer.write("\t\t\t" + outparamTypeName);
             if (!CUtils.isPointerType(outparamTypeName))
-                writer.write(" *");
+                c_writer.write(" *");
             
-            writer.write(" pReturn = axiscCall"
+            c_writer.write(" pReturn = axiscCall"
                     + CUtils.getDeserializerMethodName(outparamTypeName,
                             false) + "(call, \"" + paramTagName + "\", 0);\n\n");
-            writer.write("\t\t\tif( pReturn)\n");
-            writer.write("\t\t\t{\n");
+            c_writer.write("\t\t\tif( pReturn)\n");
+            c_writer.write("\t\t\t{\n");
             if (CUtils.isPointerType(outparamTypeName))
             {
-                writer.write("\t\t\t\tRet = pReturn;\n");
+                c_writer.write("\t\t\t\tRet = pReturn;\n");
             }
             else if (returntype.isOptional() || returntype.isNillable())
-                writer.write("\t\t\t\tRet = pReturn;\n");
+                c_writer.write("\t\t\t\tRet = pReturn;\n");
             else
             {
-                writer.write("\t\t\t\tRet = *pReturn;\n");
-                writer.write("\t\t\t\taxiscAxisDelete(pReturn, " + CUtils.getXSDEnumeratorForType(outparamTypeName) + ");\n");                
+                c_writer.write("\t\t\t\tRet = *pReturn;\n");
+                c_writer.write("\t\t\t\taxiscAxisDelete(pReturn, " + CUtils.getXSDEnumeratorForType(outparamTypeName) + ");\n");                
             }
 
-            writer.write("\t\t\t}\n");
-            writer.write("\t\t}\n");
-            writer.write("\t}\n\n");
-            writer.write("\taxiscCallUnInitialize(call);\n");
-            writer.write("\treturn Ret;\n");
+            c_writer.write("\t\t\t}\n");
+            c_writer.write("\t\t}\n");
+            c_writer.write("\t}\n\n");
+            c_writer.write("\taxiscCallUnInitialize(call);\n");
+            c_writer.write("\treturn Ret;\n");
         }
         else
         {
             outparamTypeName = returntype.getLangName();
             //need to have complex type name without *
-            writer.write("\t\t\tpReturn = (" + outparamTypeName
+            c_writer.write("\t\t\tpReturn = (" + outparamTypeName
                     + " *) axiscCallGetCmplxObject(call, (void *) Axis_DeSerialize_"
                     + outparamTypeName + ",(void *) Axis_Create_"
                     + outparamTypeName + ",(void *) Axis_Delete_"
                     + outparamTypeName + ",\"" + paramTagName
                     + "\",0);\n\t\t\t}\n");
-            writer.write("\t}\n\n");
-            writer.write("\taxiscCallUnInitialize(call);\n\n");
-            writer.write("\treturn pReturn;\n");
+            c_writer.write("\t}\n\n");
+            c_writer.write("\taxiscCallUnInitialize(call);\n\n");
+            c_writer.write("\treturn pReturn;\n");
 
         }
 
-        writer.write("}\n");        
+        c_writer.write("}\n");        
     }
 
 
@@ -656,7 +656,7 @@
      */
     protected void writeFaultHandlingCode(MethodInfo minfo) throws WrapperFault, IOException
     {  
-        writer.write ("\taxiscCallSetSoapFaultNamespace(call, \"" 
+        c_writer.write ("\taxiscCallSetSoapFaultNamespace(call, \"" 
                 + wscontext.getServiceInfo().getTargetEndpointURI () + "\");\n");
         
         //to get fault info             
@@ -693,7 +693,7 @@
                 ParameterInfo par = (ParameterInfo) paramInfo.get (i);
                 langName = par.getLangName ();
 
-                writer.write ("\taxiscCallAddSoapFaultToList(call, \"" 
+                c_writer.write ("\taxiscCallAddSoapFaultToList(call, \"" 
                         + faultInfoName + "\", "
                         + "(void*) Axis_Create_" + langName + ", "
                         + "(void*) Axis_Delete_" + langName + ", "                    

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/HeaderFileWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/HeaderFileWriter.java?rev=688130&r1=688129&r2=688130&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/HeaderFileWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/HeaderFileWriter.java Fri Aug 22 10:37:39 2008
@@ -53,30 +53,30 @@
     {
         try
         {
-            this.writer = new BufferedWriter(new FileWriter(getFilePath(), false));
+            c_writer = new BufferedWriter(new FileWriter(getFilePath(), false));
             
             writeClassComment();
             
             // if this headerfile not defined define it 
-            this.writer.write("#if !defined(__" + classname.toUpperCase() + "_H__INCLUDED_)\n");
-            this.writer.write("#define __" + classname.toUpperCase() + "_H__INCLUDED_\n\n");
+            c_writer.write("#if !defined(__" + c_classname.toUpperCase() + "_H__INCLUDED_)\n");
+            c_writer.write("#define __" + c_classname.toUpperCase() + "_H__INCLUDED_\n\n");
             
             //includes
             writePreprocessorStatements();
             
-            this.writer.write("\n#ifdef __cplusplus\n extern \"C\" {\n#endif\n\n");
+            c_writer.write("\n#ifdef __cplusplus\n extern \"C\" {\n#endif\n\n");
 
             //class
             writeAttributes();
             writeMethods();
             
-            this.writer.write("\n");
-            this.writer.write("#ifdef __cplusplus\n }\n#endif\n\n");
-            this.writer.write("#endif /* !defined(__" + classname.toUpperCase() + "_H__INCLUDED_) */\n");
+            c_writer.write("\n");
+            c_writer.write("#ifdef __cplusplus\n }\n#endif\n\n");
+            c_writer.write("#endif /* !defined(__" + c_classname.toUpperCase() + "_H__INCLUDED_) */\n");
             
             //cleanup
-            writer.flush();
-            writer.close();
+            c_writer.flush();
+            c_writer.close();
             if (WSDL2Ws.c_verbose)
                 System.out.println(getFilePath().getAbsolutePath() + " created.....");
         }
@@ -95,10 +95,10 @@
         String targetOutputLocation = this.wscontext.getWrapperInfo().getTargetOutputLocation();
         new File(targetOutputLocation).mkdirs();
 
-        String fileName = targetOutputLocation + "/" + classname + ".h";
+        String fileName = targetOutputLocation + "/" + c_classname + ".h";
 
         if (useServiceName)
-            fileName = targetOutputLocation + "/" + this.getServiceName() + "_" + classname + ".h";
+            fileName = targetOutputLocation + "/" + this.getServiceName() + "_" + c_classname + ".h";
 
         return new File(fileName);
     }

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParamCFileWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParamCFileWriter.java?rev=688130&r1=688129&r2=688130&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParamCFileWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParamCFileWriter.java Fri Aug 22 10:37:39 2008
@@ -59,7 +59,7 @@
     {
         try
         {
-            this.writer = new BufferedWriter(new FileWriter(getFilePath(), false));
+            c_writer = new BufferedWriter(new FileWriter(getFilePath(), false));
             writeClassComment();
             writePreprocessorStatements();
             if (type.isSimpleType())
@@ -71,8 +71,8 @@
                 writeMethods();
             }
             //cleanup
-            writer.flush();
-            writer.close();
+            c_writer.flush();
+            c_writer.close();
             if (WSDL2Ws.c_verbose)
                 System.out.println(getFilePath().getAbsolutePath() + " created.....");
         }
@@ -100,8 +100,8 @@
     {
         String targetOutputLocation = this.wscontext.getWrapperInfo().getTargetOutputLocation();
         new File(targetOutputLocation).mkdirs();
-        String fileName = targetOutputLocation + "/" + this.classname + CUtils.getImplFileExtension();
-        this.wscontext.addGeneratedFile(classname + CUtils.getImplFileExtension());
+        String fileName = targetOutputLocation + "/" + this.c_classname + CUtils.getImplFileExtension();
+        this.wscontext.addGeneratedFile(c_classname + CUtils.getImplFileExtension());
         return new File(fileName);
     }
 
@@ -112,19 +112,19 @@
     {
         try
         {
-            writer.write("#include <stdlib.h>\n");
-            writer.write("#include <string.h>\n");
-            writer.write("\n");
+            c_writer.write("#include <stdlib.h>\n");
+            c_writer.write("#include <string.h>\n");
+            c_writer.write("\n");
             
-            writer.write("#include \"" + this.classname + CUtils.getHeaderFileExtension() + "\"\n");
-            writer.write("\n");
+            c_writer.write("#include \"" + this.c_classname + CUtils.getHeaderFileExtension() + "\"\n");
+            c_writer.write("\n");
 
-            writer.write("#include <axis/client/Stub.h>\n");
-            writer.write("#include <axis/client/Call.h>\n");
-            writer.write("#include <axis/AxisWrapperAPI.h>\n");
-            writer.write("#include <axis/IWrapperSoapSerializer.h>\n");
-            writer.write("#include <axis/IWrapperSoapDeSerializer.h>\n");
-            writer.write("\n");
+            c_writer.write("#include <axis/client/Stub.h>\n");
+            c_writer.write("#include <axis/client/Call.h>\n");
+            c_writer.write("#include <axis/AxisWrapperAPI.h>\n");
+            c_writer.write("#include <axis/IWrapperSoapSerializer.h>\n");
+            c_writer.write("#include <axis/IWrapperSoapDeSerializer.h>\n");
+            c_writer.write("\n");
         }
         catch (IOException e)
         {

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java?rev=688130&r1=688129&r2=688130&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java Fri Aug 22 10:37:39 2008
@@ -52,12 +52,12 @@
     {
         try
         {
-            this.writer = new BufferedWriter(new FileWriter(getFilePath(), false));
+            c_writer = new BufferedWriter(new FileWriter(getFilePath(), false));
             writeClassComment();
 
             // if this headerfile not defined define it 
-            this.writer.write("#if !defined(__" + classname.toUpperCase() + "_H__INCLUDED_)\n");
-            this.writer.write("#define __" + classname.toUpperCase() + "_H__INCLUDED_\n\n");
+            c_writer.write("#if !defined(__" + c_classname.toUpperCase() + "_H__INCLUDED_)\n");
+            c_writer.write("#define __" + c_classname.toUpperCase() + "_H__INCLUDED_\n\n");
             
             if (type.isSimpleType())
                 writeSimpleTypeWithRestrictions();
@@ -65,27 +65,27 @@
             {
                 writePreprocessorStatements();
 
-                this.writer.write("\n#ifdef __cplusplus\n extern \"C\" {\n#endif\n\n");
+                c_writer.write("\n#ifdef __cplusplus\n extern \"C\" {\n#endif\n\n");
 
-                writer.write("\n");
-                writer.write("/* ********************************************************************* */\n");
-                writer.write("/* --- Custom type                                                   --- */\n");
-                writer.write("/* ********************************************************************* */\n");
-                writer.write("\n");                
+                c_writer.write("\n");
+                c_writer.write("/* ********************************************************************* */\n");
+                c_writer.write("/* --- Custom type                                                   --- */\n");
+                c_writer.write("/* ********************************************************************* */\n");
+                c_writer.write("\n");                
                 
-                this.writer.write("typedef struct " + classname + "Tag {\n");
+                c_writer.write("typedef struct " + c_classname + "Tag {\n");
                 writeAttributes();
-                this.writer.write("} " + classname + ";\n\n");
+                c_writer.write("} " + c_classname + ";\n\n");
                 
                 writeFunctionPrototypes();
-                this.writer.write("\n#ifdef __cplusplus\n }\n#endif\n");
+                c_writer.write("\n#ifdef __cplusplus\n }\n#endif\n");
             }
             
-            writer.write("\n");
-            this.writer.write("#endif /* !defined(__" + classname.toUpperCase() + "_H__INCLUDED_)*/\n");
+            c_writer.write("\n");
+            c_writer.write("#endif /* !defined(__" + c_classname.toUpperCase() + "_H__INCLUDED_)*/\n");
             
-            writer.flush();
-            writer.close();
+            c_writer.flush();
+            c_writer.close();
             
             if (WSDL2Ws.c_verbose)
                 System.out.println(getFilePath().getAbsolutePath() + " created.....");
@@ -104,7 +104,7 @@
     {
         try
         {
-            writer.write("#include <axis/AxisUserAPI.h>\n");
+            c_writer.write("#include <axis/AxisUserAPI.h>\n");
 
             Vector restrictionData = type.getEnumerationdata();
             if (restrictionData == null)
@@ -123,18 +123,18 @@
             if (null != restrictionBaseType )
             {  
                 langTypeName = CUtils.sanitizeString(restrictionBaseType);               
-                writer.write( "#include \"" + langTypeName + ".hpp\"\n\n");
+                c_writer.write( "#include \"" + langTypeName + ".hpp\"\n\n");
             }
             else
                 langTypeName = baseTypeName;
             
 
 
-            writer.write("\n");
-            writer.write("/* ********************************************************************* */\n");
-            writer.write("/* --- Simple types and restrictions                                 --- */\n");
-            writer.write("/* ********************************************************************* */\n");
-            writer.write("\n");  
+            c_writer.write("\n");
+            c_writer.write("/* ********************************************************************* */\n");
+            c_writer.write("/* --- Simple types and restrictions                                 --- */\n");
+            c_writer.write("/* ********************************************************************* */\n");
+            c_writer.write("\n");  
             
             // Need to determine what to use for enumeration identifiers.  That is, if a string
             // enumeration value is "foobar", then we can generate an enumerator identifer of 
@@ -151,43 +151,43 @@
                     break;
             }
             
-            writer.write("typedef ");
+            c_writer.write("typedef ");
             if (CUtils.isPointerType(baseTypeName) 
                     || "xsdc__base64Binary".equals(baseTypeName) 
                     || "xsdc__hexBinary".equals(baseTypeName))
             {
-                writer.write(langTypeName + " " + classname + ";\n");
-                writer.write("typedef " + langTypeName + "_Array " + classname + "_Array;\n");
-                writer.write("\n");
+                c_writer.write(langTypeName + " " + c_classname + ";\n");
+                c_writer.write("typedef " + langTypeName + "_Array " + c_classname + "_Array;\n");
+                c_writer.write("\n");
                 
                 for (int i = 1; i < restrictionData.size(); i++)
                 {
                     QName value = (QName) restrictionData.elementAt(i);
                     if ("enumeration".equals(value.getLocalPart()))
                     {
-                        writer.write("static const " + classname + " " + classname + "_");
+                        c_writer.write("static const " + c_classname + " " + c_classname + "_");
                         if (validEnumIdentifier)
-                            writer.write(value.getNamespaceURI());
+                            c_writer.write(value.getNamespaceURI());
                         else
-                            writer.write("ENUM" + i);
-                        writer.write(" = \"" + value.getNamespaceURI() + "\";\n");
+                            c_writer.write("ENUM" + i);
+                        c_writer.write(" = \"" + value.getNamespaceURI() + "\";\n");
                     } 
                     else if ("maxLength".equals(value.getLocalPart()))
                     {
-                        writer.write("static const int " + classname
+                        c_writer.write("static const int " + c_classname
                                 + "_MaxLength = " + value.getNamespaceURI() + ";\n");
                     } 
                     else if ("minLength".equals(value.getLocalPart()))
                     {
-                        writer.write("static const int " + classname
+                        c_writer.write("static const int " + c_classname
                                 + "_MinLength = " + value.getNamespaceURI() + ";\n");
                     }
                 }
             } 
             else if ("int".equals(baseType.getLocalPart()))
             {
-                writer.write(langTypeName + " " + classname + ";\n");
-                writer.write("typedef " + langTypeName + "_Array " + classname + "_Array;\n");
+                c_writer.write(langTypeName + " " + c_classname + ";\n");
+                c_writer.write("typedef " + langTypeName + "_Array " + c_classname + "_Array;\n");
             
                 if (restrictionData.size() > 1)
                 {
@@ -201,46 +201,46 @@
                         {
                             isEnum = true;
                             if (i > 1)
-                                writer.write(", ");
+                                c_writer.write(", ");
                             else
-                                writer.write("typedef enum { ");
+                                c_writer.write("typedef enum { ");
 
-                            writer.write("ENUM" + classname.toUpperCase() + "_"
+                            c_writer.write("ENUM" + c_classname.toUpperCase() + "_"
                                     + value.getNamespaceURI() + "="
                                     + value.getNamespaceURI());
                         } 
                         else if ("minInclusive".equals(value.getLocalPart()))
                         {
-                            writer.write("static const int " + classname
+                            c_writer.write("static const int " + c_classname
                                     + "_MinInclusive = " + value.getNamespaceURI() + ";\n");
                         } 
                         else if ("maxInclusive".equals(value.getLocalPart()))
                         {
-                            writer.write("static const int " + classname
+                            c_writer.write("static const int " + c_classname
                                     + "_MaxInclusive = " + value.getNamespaceURI() + ";\n");
                         }
                     }
                     
                     if (isEnum)
-                        writer.write("} " + classname + "_Enum;\n");
+                        c_writer.write("} " + c_classname + "_Enum;\n");
                 } 
             } 
             else
             {
-                writer.write(langTypeName + " " + classname + ";\n");
-                writer.write("typedef " + langTypeName + "_Array " + classname + "_Array;\n");
+                c_writer.write(langTypeName + " " + c_classname + ";\n");
+                c_writer.write("typedef " + langTypeName + "_Array " + c_classname + "_Array;\n");
                 
                 for (int i = 1; i < restrictionData.size(); i++)
                 {
                     QName value = (QName) restrictionData.elementAt(i);
                     if ("enumeration".equals(value.getLocalPart()))
                     {
-                        writer.write("static const " + classname + " " + classname + "_");
+                        c_writer.write("static const " + c_classname + " " + c_classname + "_");
                         if (validEnumIdentifier)
-                            writer.write(value.getNamespaceURI());
+                            c_writer.write(value.getNamespaceURI());
                         else
-                            writer.write("ENUM" + i);
-                        writer.write(" = \"" + value.getNamespaceURI() + "\";\n");
+                            c_writer.write("ENUM" + i);
+                        c_writer.write(" = \"" + value.getNamespaceURI() + "\";\n");
                     }
                 }
             }
@@ -285,13 +285,13 @@
                 }
 
                 // Print out field.
-                writer.write("\t" + paramType + " " + paramName + ";\n");
+                c_writer.write("\t" + paramType + " " + paramName + ";\n");
             }
             
             if (extensionBaseAttrib != null &&
                 getCorrectParmNameConsideringArraysAndComplexTypes(extensionBaseAttrib) != null)
             {
-                writer.write("\t"
+                c_writer.write("\t"
                              + getCorrectParmNameConsideringArraysAndComplexTypes(extensionBaseAttrib)
                              + "  "
                              + extensionBaseAttrib.getParamNameAsMember() + ";\n");
@@ -329,13 +329,13 @@
         String targetOutputLocation = this.wscontext.getWrapperInfo().getTargetOutputLocation();
         new File(targetOutputLocation).mkdirs();
 
-        String fileName = targetOutputLocation + "/" + classname + CUtils.getHeaderFileExtension();
+        String fileName = targetOutputLocation + "/" + c_classname + CUtils.getHeaderFileExtension();
 
         if (useServiceName)
         {
             fileName = targetOutputLocation + "/"
                     + this.wscontext.getServiceInfo().getServicename() + "_"
-                    + classname + CUtils.getHeaderFileExtension();
+                    + c_classname + CUtils.getHeaderFileExtension();
         }
 
         return new File(fileName);
@@ -361,7 +361,7 @@
                 
                 typeName = type.getLanguageSpecificName();
                 if ((type.isAnonymous() && !type.isExternalized())
-                        || !typeName.equals(classname))
+                        || !typeName.equals(c_classname))
                     continue;
                 
                 typeSet.add(typeName);
@@ -371,22 +371,22 @@
             
             if (itr.hasNext())
             {
-                writer.write("\n");
-                writer.write("/* ********************************************************************* */\n");
-                writer.write("/* --- Functions to create/delete, serialize/deserialize custom type --- */\n");
-                writer.write("/* ********************************************************************* */\n");
-                writer.write("\n");                
+                c_writer.write("\n");
+                c_writer.write("/* ********************************************************************* */\n");
+                c_writer.write("/* --- Functions to create/delete, serialize/deserialize custom type --- */\n");
+                c_writer.write("/* ********************************************************************* */\n");
+                c_writer.write("\n");                
             }
             
             while (itr.hasNext())
             {
                 typeName = itr.next().toString();
-                this.writer.write("extern int Axis_DeSerialize_" + typeName
+                c_writer.write("extern int Axis_DeSerialize_" + typeName
                              + "(" + typeName + "* param, AXISCHANDLE pDZ);\n");
-                this.writer.write("extern void* Axis_Create_" + typeName + "(int nSize);\n");
-                this.writer.write("extern void Axis_Delete_" + typeName
+                c_writer.write("extern void* Axis_Create_" + typeName + "(int nSize);\n");
+                c_writer.write("extern void Axis_Delete_" + typeName
                              + "(" + typeName + "* param, int nSize);\n");
-                this.writer.write("extern int Axis_Serialize_" + typeName
+                c_writer.write("extern int Axis_Serialize_" + typeName
                              + "(" + typeName + "* param, AXISCHANDLE pSZ, AxiscBool bArray);\n\n");
             }
         }
@@ -404,15 +404,15 @@
     {
         try
         {
-            writer.write("#include <axis/Axis.h>\n");
-            writer.write("#include <axis/GDefine.h>\n");
-            writer.write("#include <axis/AxisUserAPI.h>\n");
-            writer.write("#include <axis/SoapEnvVersions.h>\n");
-            writer.write("#include <axis/WSDDDefines.h>\n");
-            writer.write("#include <axis/TypeMapping.h>\n");
+            c_writer.write("#include <axis/Axis.h>\n");
+            c_writer.write("#include <axis/GDefine.h>\n");
+            c_writer.write("#include <axis/AxisUserAPI.h>\n");
+            c_writer.write("#include <axis/SoapEnvVersions.h>\n");
+            c_writer.write("#include <axis/WSDDDefines.h>\n");
+            c_writer.write("#include <axis/TypeMapping.h>\n");
 
             if (this.type.isFault())
-                writer.write("#include <axis/SoapFaultException.h>\n");
+                c_writer.write("#include <axis/SoapFaultException.h>\n");
             
             HashSet typeSet = new HashSet();
             for (int i = 0; i < attribs.length; i++)
@@ -448,22 +448,22 @@
             
             Iterator itr = typeSet.iterator();
             if (itr.hasNext())
-                writer.write("\n");    
+                c_writer.write("\n");    
             
             while (itr.hasNext())
             {
                 // Do not want to include the header file we are generating!
                 String includeFile = itr.next().toString();
-                if (!includeFile.equals(classname))
-                   writer.write("#include \"" + includeFile + CUtils.getHeaderFileExtension() + "\"\n");
+                if (!includeFile.equals(c_classname))
+                   c_writer.write("#include \"" + includeFile + CUtils.getHeaderFileExtension() + "\"\n");
             }
 
-            writer.write("\n");
+            c_writer.write("\n");
             //Local name and the URI for the type
-            writer.write("/* Local name and the URI for the type */\n");
-            writer.write("static const char Axis_URI_" + classname + "[] = \""
+            c_writer.write("/* Local name and the URI for the type */\n");
+            c_writer.write("static const char Axis_URI_" + c_classname + "[] = \""
                     + type.getName().getNamespaceURI() + "\";\n");
-            writer.write("static const char Axis_TypeName_" + classname
+            c_writer.write("static const char Axis_TypeName_" + c_classname
                     + "[] = \"" + type.getName().getLocalPart() + "\";\n\n");
         }
         catch (IOException e)

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubHeaderWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubHeaderWriter.java?rev=688130&r1=688129&r2=688130&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubHeaderWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubHeaderWriter.java Fri Aug 22 10:37:39 2008
@@ -49,20 +49,20 @@
         MethodInfo minfo;
         try
         {
-            writer.write("\n");
-            writer.write("/* ********************************************************************* */\n");
-            writer.write("/* --- Functions relating to web service client proxy                --- */\n");
-            writer.write("/* ********************************************************************* */\n");
-            writer.write("\n");
-            writer.write("extern AXISCHANDLE get_" + classname + "_stub(const char* pchEndPointUri);\n");
-            writer.write("extern void destroy_" + classname + "_stub(AXISCHANDLE pStub);\n");
-            writer.write("extern int get_" + classname + "_Status(AXISCHANDLE pStub);\n");
-            writer.write("extern void set_" + classname + "_ExceptionHandler(AXISCHANDLE pStub, AXIS_EXCEPTION_HANDLER_FUNCT fp);\n");
-            writer.write("\n");
-            writer.write("/* ********************************************************************* */\n");
-            writer.write("/* --- Functions relating to web service methods                     --- */\n");
-            writer.write("/* ********************************************************************* */\n");
-            writer.write("\n");
+            c_writer.write("\n");
+            c_writer.write("/* ********************************************************************* */\n");
+            c_writer.write("/* --- Functions relating to web service client proxy                --- */\n");
+            c_writer.write("/* ********************************************************************* */\n");
+            c_writer.write("\n");
+            c_writer.write("extern AXISCHANDLE get_" + c_classname + "_stub(const char* pchEndPointUri);\n");
+            c_writer.write("extern void destroy_" + c_classname + "_stub(AXISCHANDLE pStub);\n");
+            c_writer.write("extern int get_" + c_classname + "_Status(AXISCHANDLE pStub);\n");
+            c_writer.write("extern void set_" + c_classname + "_ExceptionHandler(AXISCHANDLE pStub, AXIS_EXCEPTION_HANDLER_FUNCT fp);\n");
+            c_writer.write("\n");
+            c_writer.write("/* ********************************************************************* */\n");
+            c_writer.write("/* --- Functions relating to web service methods                     --- */\n");
+            c_writer.write("/* ********************************************************************* */\n");
+            c_writer.write("\n");
 
             for (int i = 0; i < methods.size(); i++)
             {
@@ -72,7 +72,7 @@
                 
                 //write return type
                 if (0 == noOfOutParams)
-                    writer.write("extern void ");
+                    c_writer.write("extern void ");
                 else if (1 == noOfOutParams)
                 {
                     ParameterInfo returnParam =
@@ -82,24 +82,24 @@
                             || (CUtils.isSimpleType(outParamTypeName)
                             && (returnParam.isNillable() || returnParam.isOptional())
                             && !(CUtils.isPointerType(outParamTypeName))))
-                        writer.write("extern " + outParamTypeName + " * ");
+                        c_writer.write("extern " + outParamTypeName + " * ");
                     else
-                        writer.write("extern " + outParamTypeName + " ");
+                        c_writer.write("extern " + outParamTypeName + " ");
                 }
                 else
                 {
                     isAllTreatedAsOutParams = true;
-                    writer.write("extern void ");
+                    c_writer.write("extern void ");
                 }
                 
                 //write return type
-                writer.write(minfo.getMethodname() + "(AXISCHANDLE pStub");                
+                c_writer.write(minfo.getMethodname() + "(AXISCHANDLE pStub");                
 
                 //write parameter names 
                 Iterator params = minfo.getInputParameterTypes().iterator();
                 for (int j = 0; params.hasNext(); j++)
                 {
-                    writer.write(", ");
+                    c_writer.write(", ");
                     ParameterInfo nparam = (ParameterInfo) params.next();
                     String paramTypeName = CUtils.getClassNameFromParamInfoConsideringArrays(nparam, wscontext);
                     Type type = nparam.getType();
@@ -111,14 +111,14 @@
                         baseTypeName = paramTypeName;
                     
                     if (nparam.getType().isAttachment())
-                        writer.write("AXISCHANDLE *Value" + j);
+                        c_writer.write("AXISCHANDLE *Value" + j);
                     else if ((paramTypeName.lastIndexOf ("_Array") > 0)
                                 || (CUtils.isSimpleType(baseTypeName)
                                         && (nparam.isNillable() || nparam.isOptional())
                                         && !(CUtils.isPointerType(baseTypeName))))
-                        writer.write(paramTypeName + " * Value" + j);
+                        c_writer.write(paramTypeName + " * Value" + j);
                     else
-                        writer.write(paramTypeName + " Value" + j);
+                        c_writer.write(paramTypeName + " Value" + j);
                 }
 
                 if (isAllTreatedAsOutParams)
@@ -139,9 +139,9 @@
                         boolean bTypeHasStar = paramType.endsWith( "*");
                         
 
-                        writer.write(", ");
+                        c_writer.write(", ");
                         
-                        writer.write("AXISC_OUT_PARAM " + paramType);
+                        c_writer.write("AXISC_OUT_PARAM " + paramType);
                         if (CUtils.isSimpleType(baseTypeName))
                         {
                             if ((nparam.isOptional() 
@@ -149,22 +149,22 @@
                                     && !CUtils.isPointerType(baseTypeName))
                             {
                                 if (bTypeHasStar)
-                                    writer.write(" *");
+                                    c_writer.write(" *");
                                 else
-                                    writer.write(" **");
+                                    c_writer.write(" **");
                             }
                             else if (CUtils.isPointerType(baseTypeName) || !bTypeHasStar)
-                                writer.write(" *");
+                                c_writer.write(" *");
                         }
                         else if(bTypeHasStar)
-                            writer.write(" *");
+                            c_writer.write(" *");
                         else
-                            writer.write(" **");
+                            c_writer.write(" **");
                         
-                        writer.write(" OutValue" + j);
+                        c_writer.write(" OutValue" + j);
                     } // for loop
                 }
-                writer.write(");\n");
+                c_writer.write(");\n");
             }
         }
         catch (Exception e)
@@ -180,16 +180,16 @@
     {
         try
         {
-            writer.write("#include <axis/Axis.h>\n");
-            writer.write("#include <axis/GDefine.h>\n");
-            writer.write("#include <axis/AxisUserAPI.h>\n");
-            writer.write("#include <axis/SoapEnvVersions.h>\n");
-            writer.write("#include <axis/WSDDDefines.h>\n");
-            writer.write("#include <axis/TypeMapping.h>\n");
-            writer.write("#include <axis/ISoapFault.h>\n");
-            writer.write("#include <axis/client/Stub.h>\n");
-            writer.write("#include <axis/client/Call.h>\n");
-            writer.write("\n");
+            c_writer.write("#include <axis/Axis.h>\n");
+            c_writer.write("#include <axis/GDefine.h>\n");
+            c_writer.write("#include <axis/AxisUserAPI.h>\n");
+            c_writer.write("#include <axis/SoapEnvVersions.h>\n");
+            c_writer.write("#include <axis/WSDDDefines.h>\n");
+            c_writer.write("#include <axis/TypeMapping.h>\n");
+            c_writer.write("#include <axis/ISoapFault.h>\n");
+            c_writer.write("#include <axis/client/Stub.h>\n");
+            c_writer.write("#include <axis/client/Call.h>\n");
+            c_writer.write("\n");
             
             Type atype;
             Iterator types = this.wscontext.getTypemap().getTypes().iterator();
@@ -224,9 +224,9 @@
             Iterator itr = typeSet.iterator();
             while (itr.hasNext())
             {
-                writer.write("#include \"" + itr.next().toString() + CUtils.getHeaderFileExtension() + "\"\n");
+                c_writer.write("#include \"" + itr.next().toString() + CUtils.getHeaderFileExtension() + "\"\n");
             }
-            writer.write("\n");
+            c_writer.write("\n");
         }
         catch (IOException e)
         {



Mime
View raw message