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 [5/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/cpp/ClientStubWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java?rev=688130&r1=688129&r2=688130&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java Fri Aug 22 10:37:39 2008
@@ -67,11 +67,11 @@
     {
         try
         {
-            writer.write("/*\n");
-            writer.write(" * This file was auto-generated by the Axis C++ Web Service "
+            c_writer.write("/*\n");
+            c_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(" * This file contains Client Stub implementation for remote web service.\n");
+            c_writer.write(" */\n\n");
         } 
         catch (IOException e)
         {
@@ -88,18 +88,18 @@
     {
         try
         {
-            CUtils.printMethodComment(writer, "Constructor for service " + classname + ".");
+            CUtils.printMethodComment(c_writer, "Constructor for service " + c_classname + ".");
             
-            writer.write(classname + "::\n" + classname
+            c_writer.write(c_classname + "::\n" + c_classname
                     + "(const char* pcEndpointUri, AXIS_PROTOCOL_TYPE eProtocol)\n:Stub(pcEndpointUri, eProtocol)\n{\n");
-            writer.write("}\n");
+            c_writer.write("}\n");
         
-            CUtils.printMethodComment(writer, "Constructor for service " + classname + ".");            
-            writer.write(classname + "::\n" + classname + "()\n:Stub(\" \", APTHTTP1_1)\n{\n");
+            CUtils.printMethodComment(c_writer, "Constructor for service " + c_classname + ".");            
+            c_writer.write(c_classname + "::\n" + c_classname + "()\n:Stub(\" \", APTHTTP1_1)\n{\n");
             //TODO get TransportURI from WrapInfo and check what the transport is and do the following line accordingly
-            writer.write("\tm_pCall->setEndpointURI(\""
+            c_writer.write("\tm_pCall->setEndpointURI(\""
                             + wscontext.getServiceInfo().getTargetEndpointURI() + "\");\n");
-            writer.write("}\n");
+            c_writer.write("}\n");
         } 
         catch (IOException e)
         {
@@ -116,9 +116,9 @@
     {
         try
         {
-            CUtils.printMethodComment(writer, "Destructor for service " + classname + ".");
+            CUtils.printMethodComment(c_writer, "Destructor for service " + c_classname + ".");
             
-            writer.write(classname + "::\n~" + classname + "()\n{\n}\n");
+            c_writer.write(c_classname + "::\n~" + c_classname + "()\n{\n}\n");
         } 
         catch (IOException e)
         {
@@ -156,16 +156,16 @@
     {
         try
         {
-            if ("AxisClientException".equals(classname))
+            if ("AxisClientException".equals(c_classname))
             {
-                writer.write("#include \"" + getServiceName() + "_" + classname
+                c_writer.write("#include \"" + getServiceName() + "_" + c_classname
                         + CUtils.getHeaderFileExtension() + "\"\n\n");
             }
             else
-                writer.write("#include \"" + classname + CUtils.getHeaderFileExtension() + "\"\n\n");
+                c_writer.write("#include \"" + c_classname + CUtils.getHeaderFileExtension() + "\"\n\n");
 
-            writer.write("#include <axis/AxisWrapperAPI.hpp>\n");
-            writer.write ("#include <axis/Axis.hpp>\n\n");
+            c_writer.write("#include <axis/AxisWrapperAPI.hpp>\n");
+            c_writer.write ("#include <axis/Axis.hpp>\n\n");
         } 
         catch (IOException e)
         {
@@ -237,7 +237,7 @@
         // Generate method prototype
         //=============================================================================        
 
-        CUtils.printMethodComment(writer, "This method wraps the service method " + methodName + ".");
+        CUtils.printMethodComment(c_writer, "This method wraps the service method " + methodName + ".");
 
         //method signature
         String paramTypeName;
@@ -246,17 +246,17 @@
         Type type;
 
         if (returntype == null)
-            writer.write("void");
+            c_writer.write("void");
         else if (returntypeissimple
                     && (!(returntype.isNillable() || returntype.isOptional()) 
                             || CUtils.isPointerType(outparamType)))
-                writer.write (outparamType);
+                c_writer.write (outparamType);
             else if (outparamType.lastIndexOf ("*") > 0)
-                writer.write (outparamType);
+                c_writer.write (outparamType);
             else
-                writer.write (outparamType + "*");
+                c_writer.write (outparamType + "*");
 
-        writer.write(" " + classname + "::\n" + methodName + "(");
+        c_writer.write(" " + c_classname + "::\n" + methodName + "(");
         ArrayList paramsB = (ArrayList) params;
         for (int i = 0; i < paramsB.size(); i++)
         {
@@ -264,18 +264,18 @@
                 CUtils.getClassNameFromParamInfoConsideringArrays((ParameterInfo) paramsB.get(i), wscontext);
             
             if (i > 0)
-                writer.write(", ");
+                c_writer.write(", ");
             
             typeissimple = CUtils.isSimpleType(paramTypeName);
             if (typeissimple
                     && (!(((ParameterInfo) paramsB.get (i)).isNillable () 
                             || ((ParameterInfo) paramsB.get (i)).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
@@ -285,13 +285,13 @@
             for (int i = 0; i < paramsC.size(); i++)
             {
                 type = wscontext.getTypemap().getType(((ParameterInfo) paramsC.get(i)).getSchemaName());
-                writer.write(", AXIS_OUT_PARAM  "
+                c_writer.write(", AXIS_OUT_PARAM  "
                     + CUtils.getClassNameFromParamInfoConsideringArrays(
                                 (ParameterInfo) paramsC.get(i),wscontext) + " *OutValue" + i);
             }
         }
         
-        writer.write(")\n{\n");
+        c_writer.write(")\n{\n");
         
         //=============================================================================
         // Generate global variables (outside of try block)
@@ -299,70 +299,70 @@
         
         if (returntype != null)
         {
-            writer.write("\t");
+            c_writer.write("\t");
             
             if (returntypeisarray)
-                writer.write(outparamType + " * RetArray = new " + outparamType + "();\n");
+                c_writer.write(outparamType + " * RetArray = new " + outparamType + "();\n");
             else if (!returntypeissimple)
-                writer.write(outparamType + "\tpReturn = NULL;\n");
+                c_writer.write(outparamType + "\tpReturn = NULL;\n");
             else if (returntype.isNillable() || returntype.isOptional()
                         || CUtils.isPointerType(outparamType))
             {
-                writer.write(outparamType);
+                c_writer.write(outparamType);
                 if (!CUtils.isPointerType(outparamType))
-                    writer.write(" *");
+                    c_writer.write(" *");
 
-                writer.write("\tRet = NULL;\n");
+                c_writer.write("\tRet = NULL;\n");
             }
             else
             {
                 String initValue = CUtils.getInitValueForType (outparamType);
                 if (initValue != null)
-                    writer.write (outparamType + " Ret = " + initValue + ";\n");
+                    c_writer.write (outparamType + " Ret = " + initValue + ";\n");
                 else if (CUtils.getXSDEnumeratorForType( outparamType).equals("XSD_DATETIME")
                         || CUtils.getXSDEnumeratorForType( outparamType).equals("XSD_DATE")
                         || CUtils.getXSDEnumeratorForType( outparamType).equals("XSD_TIME"))
                 {
-                    writer.write (outparamType + " Ret;\n");
-                    writer.write ("\tmemset(&Ret,0,sizeof(" + outparamType + "));\n");
+                    c_writer.write (outparamType + " Ret;\n");
+                    c_writer.write ("\tmemset(&Ret,0,sizeof(" + outparamType + "));\n");
                 }
                 else
-                    writer.write (outparamType + " Ret;\n");
+                    c_writer.write (outparamType + " Ret;\n");
             }
         }
 
-        writer.write("\tconst char* pcCmplxFaultName = NULL;\n\n");
+        c_writer.write("\tconst char* pcCmplxFaultName = NULL;\n\n");
         
         //=============================================================================
         // Generate try block and method logic
         //=============================================================================        
         
-        writer.write("\ttry\n\t{\n");
+        c_writer.write("\ttry\n\t{\n");
         
-        writer.write("\t\tif (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER" + "))\n");
-        writer.write("\t\t\treturn ");
+        c_writer.write("\t\tif (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER" + "))\n");
+        c_writer.write("\t\t\treturn ");
         if (returntype != null)
         {
             if (returntypeisarray)
-                writer.write("RetArray;\n");
+                c_writer.write("RetArray;\n");
             else if (CUtils.isPointerType(outparamType) || 
                        (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");
-        writer.write("\n");
+            c_writer.write(";\n");
+        c_writer.write("\n");
 
-        writer.write("\t\tif( NULL == m_pCall->getTransportProperty( \"SOAPAction\", false))\n");
-        writer.write("\t\t\tm_pCall->setTransportProperty( SOAPACTION_HEADER,\"" 
+        c_writer.write("\t\tif( NULL == m_pCall->getTransportProperty( \"SOAPAction\", false))\n");
+        c_writer.write("\t\t\tm_pCall->setTransportProperty( SOAPACTION_HEADER,\"" 
                + minfo.getSoapAction() + "\");\n");
-        writer.write("\n");
+        c_writer.write("\n");
         
-        writer.write("\t\tm_pCall->setSOAPVersion( SOAP_VER_1_1);\n");
+        c_writer.write("\t\tm_pCall->setSOAPVersion( SOAP_VER_1_1);\n");
         //TODO check which version is it really.
         
         // Use namespace specified in input binding if one exists
@@ -372,7 +372,7 @@
         if (namespaceURI == null)
             namespaceURI = wscontext.getWrapperInfo().getTargetNameSpaceOfWSDL();
         
-        writer.write("\t\tm_pCall->setOperation( \"" 
+        c_writer.write("\t\tm_pCall->setOperation( \"" 
                 + minfo.getMethodname() + "\", \"" 
                 + namespaceURI + "\");\n"); 
 
@@ -380,10 +380,10 @@
         // Apply user specified properties
         //=============================================================================        
         
-        writer.write("\n");
-        writer.write ("\t\tincludeSecure();\n");
-        writer.write ("\t\tapplyUserPreferences();\n");
-        writer.write("\n");        
+        c_writer.write("\n");
+        c_writer.write ("\t\tincludeSecure();\n");
+        c_writer.write ("\t\tapplyUserPreferences();\n");
+        c_writer.write("\n");        
 
         //=============================================================================
         // Process elements
@@ -414,8 +414,8 @@
                 if (CUtils.isSimpleType(qname))
                 {
                     containedType = CUtils.getSimpleType(qname);
-                    writer.write("\t\tm_pCall->addBasicArrayParameter( ");
-                    writer.write("Value" + i + ", "
+                    c_writer.write("\t\tm_pCall->addBasicArrayParameter( ");
+                    c_writer.write("Value" + i + ", "
                             + CUtils.getXSDEnumeratorForType(containedType)
                             + ", \""
                             + ((ParameterInfo) paramsB.get(i)).getParamNameAsSOAPString()
@@ -424,8 +424,8 @@
                 else
                 {
                     containedType = qname.getLocalPart();
-                    writer.write("\t\tm_pCall->addCmplxArrayParameter( ");
-                    writer.write("Value" + i
+                    c_writer.write("\t\tm_pCall->addCmplxArrayParameter( ");
+                    c_writer.write("Value" + i
                             + ",(void *) Axis_Serialize_" + containedType
                             + ",(void *) Axis_Delete_" + containedType
                             + ",\"" + ((ParameterInfo) paramsB.get(i)).getParamNameAsSOAPString() + "\""
@@ -437,15 +437,15 @@
                 if (((ParameterInfo) paramsB.get(i)).isNillable()
                         || CUtils.isPointerType(paramTypeName))
                 {
-                    writer.write("\t\tm_pCall->addParameter( ");
-                    writer.write("(void *) Value" + i + ", \""
+                    c_writer.write("\t\tm_pCall->addParameter( ");
+                    c_writer.write("(void *) Value" + i + ", \""
                             + ((ParameterInfo) paramsB.get(i)).getParamNameAsSOAPString() + "\", "
                             + CUtils.getXSDEnumeratorForType(paramTypeName));
                 }
                 else
                 {
-                    writer.write("\t\tm_pCall->addParameter( ");
-                    writer.write("(void *) &Value" + i + ", \""
+                    c_writer.write("\t\tm_pCall->addParameter( ");
+                    c_writer.write("(void *) &Value" + i + ", \""
                             + ((ParameterInfo) paramsB.get(i)).getParamNameAsSOAPString() + "\", "
                             + CUtils.getXSDEnumeratorForType(paramTypeName));
                 }
@@ -453,23 +453,23 @@
             else
             {
                 //for complex types
-                writer.write("\t\tm_pCall->addCmplxParameter( ");
-                writer.write("Value" + i 
+                c_writer.write("\t\tm_pCall->addCmplxParameter( ");
+                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");
         }
         
         //=============================================================================
         // Invoke web service - two-way message processing
         //=============================================================================        
         
-        writer.write("\n\t\tif( AXIS_SUCCESS == m_pCall->sendAndReceive())\n\t\t{\n");
-        writer.write("\t\t\tif( AXIS_SUCCESS == m_pCall->checkMessage( \""
+        c_writer.write("\n\t\tif( AXIS_SUCCESS == m_pCall->sendAndReceive())\n\t\t{\n");
+        c_writer.write("\t\t\tif( AXIS_SUCCESS == m_pCall->checkMessage( \""
                 + minfo.getOutputMessage().getLocalPart() + "\",\""
                 + namespaceURI
                 + "\"))\n\t\t\t{\n");
@@ -515,54 +515,54 @@
                     if (CUtils.isSimpleType(qname))
                     {
                         containedType = CUtils.getSimpleType(qname);
-                        writer.write("\n\t\t\tAxis_Array * pReturn" + i + " = m_pCall->getBasicArray( " + CUtils.getXSDEnumeratorForType (containedType) 
+                        c_writer.write("\n\t\t\tAxis_Array * pReturn" + i + " = m_pCall->getBasicArray( " + CUtils.getXSDEnumeratorForType (containedType) 
                                 + ",\"" + paramTagName
                                 + "\", 0);\n\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\t*OutValue" + i + " = new " + currentParaType + "();\n");
-                        writer.write("\t\t\t\telse\n");
-                        writer.write("\t\t\t\t\t(*OutValue" + i + ")->clear();\n");
-                        writer.write("\t\t\t\t(*OutValue" + i + ")->clone( *pReturn" + i + ");\n");
-                        writer.write("\t\t\t}\n\n");
-                        writer.write("\t\t\tAxis::AxisDelete( (void *) pReturn" + i + ", XSD_ARRAY);\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\t*OutValue" + i + " = new " + currentParaType + "();\n");
+                        c_writer.write("\t\t\t\telse\n");
+                        c_writer.write("\t\t\t\t\t(*OutValue" + i + ")->clear();\n");
+                        c_writer.write("\t\t\t\t(*OutValue" + i + ")->clone( *pReturn" + i + ");\n");
+                        c_writer.write("\t\t\t}\n\n");
+                        c_writer.write("\t\t\tAxis::AxisDelete( (void *) pReturn" + i + ", XSD_ARRAY);\n");
                     }
                     else
                     {
                         containedType = qname.getLocalPart();
-                        writer.write("\n\t\t\tif( OutValue" + i + " != NULL)\n" );
-                        writer.write("\t\t\t{\n");
-                        writer.write("\t\t\t\tif( " + currentParamName + " == NULL)\n");
-                        writer.write("\t\t\t\t\t" + currentParamName + " = new " + containedType + "_Array();\n");
-                        writer.write("\t\t\t\telse\n");
-                        writer.write("\t\t\t\t\t(" + currentParamName + ")->clear();\n");
-                        writer.write("\t\t\t\tm_pCall->getCmplxArray( " + currentParamName 
+                        c_writer.write("\n\t\t\tif( OutValue" + i + " != NULL)\n" );
+                        c_writer.write("\t\t\t{\n");
+                        c_writer.write("\t\t\t\tif( " + currentParamName + " == NULL)\n");
+                        c_writer.write("\t\t\t\t\t" + currentParamName + " = new " + containedType + "_Array();\n");
+                        c_writer.write("\t\t\t\telse\n");
+                        c_writer.write("\t\t\t\t\t(" + currentParamName + ")->clear();\n");
+                        c_writer.write("\t\t\t\tm_pCall->getCmplxArray( " + currentParamName 
                               + ",(void *) Axis_DeSerialize_" + containedType
                               + ",(void *) Axis_Create_" + containedType
                               + ",(void *) Axis_Delete_" + containedType
                               + ",\"" +currentType.getElementNameAsSOAPString() 
                               + "\",Axis_URI_" + containedType + ");\n");
-                        writer.write("\t\t\t}\n");
-                        writer.write("\t\t\telse\n");
-                        writer.write("\t\t\t{\n");
-                        writer.write("\t\t\t\t// Unable to return value, but will deserialize to ensure subsequent elements can be correctly processed.\n");
-                        writer.write("\t\t\t\t" + containedType + "_Array * pTemp" + i 
+                        c_writer.write("\t\t\t}\n");
+                        c_writer.write("\t\t\telse\n");
+                        c_writer.write("\t\t\t{\n");
+                        c_writer.write("\t\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\t" + containedType + "_Array * pTemp" + i 
                                 + " = new " + containedType + "_Array();\n");
-                        writer.write("\t\t\t\tm_pCall->getCmplxArray( pTemp" + i 
+                        c_writer.write("\t\t\t\tm_pCall->getCmplxArray( 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\tdelete pTemp" + i + ";\n");
-                        writer.write("\t\t\t}\n");
+                        c_writer.write("\t\t\t\tdelete pTemp" + i + ";\n");
+                        c_writer.write("\t\t\t}\n");
                     }
                 }
                 else if (typeissimple)
                 {
                     if( i > 0)
-                        writer.write( "\n");
+                        c_writer.write( "\n");
                     
                     if (CUtils.isPointerType(currentParaType))
                     {
@@ -571,56 +571,56 @@
                         if( !CUtils.isPointerType(xsdType))
                             xsdType += " *";
                         
-                        writer.write( "\t\t\t" + currentParaType + " pReturn" + i 
+                        c_writer.write( "\t\t\t" + currentParaType + " pReturn" + i 
                                 + " = m_pCall->" + CUtils.getDeserializerMethodName( currentParaType, false) 
                                 + "( \"" + paramTagName + "\", 0);\n");
-                        writer.write( "\n");
-                        writer.write( "\t\t\tif( pReturn" + i + " != NULL && OutValue" + i + " != NULL)\n");
-                        writer.write( "\t\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 + ") new char[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 + ") new char[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\tAxis::AxisDelete( (void *) pReturn" + i + ", " 
+                        c_writer.write( "\n");
+                        c_writer.write( "\t\t\tif( pReturn" + i + " != NULL && OutValue" + i + " != NULL)\n");
+                        c_writer.write( "\t\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 + ") new char[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 + ") new char[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\tAxis::AxisDelete( (void *) pReturn" + i + ", " 
                                 + CUtils.getXSDEnumeratorForType( currentParaType) + ");\n");
                     }
                     else 
                     {
-                        writer.write( "\t\t\t" + currentParaType + " * pReturn" + i + " = m_pCall->" 
+                        c_writer.write( "\t\t\t" + currentParaType + " * pReturn" + i + " = m_pCall->" 
                                + CUtils.getDeserializerMethodName( currentParaType, false) 
                                 + "( \"" + paramTagName + "\", 0);\n");
-                        writer.write( "\n");
-                        writer.write( "\t\t\tif( pReturn" + i + " != NULL && OutValue" + i + " != NULL)\n");
-                        writer.write( "\t\t\t{\n");
-                        writer.write( "// OutValue" + i + " is not nillable.\n");
-                        writer.write( "\t\t\t\tOutValue" + i + " = new " + currentParaType + "();\n");
-                        writer.write( "\n");
-                        writer.write( "\t\t\t\t*OutValue" + i + " = *pReturn" + i + ";\n");
-                        writer.write( "\t\t\t}\n");
-                        writer.write( "\n");
-                        writer.write( "\t\t\tAxis::AxisDelete( (void *) pReturn" + i + ", " 
+                        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( "// OutValue" + i + " is not nillable.\n");
+                        c_writer.write( "\t\t\t\tOutValue" + i + " = new " + currentParaType + "();\n");
+                        c_writer.write( "\n");
+                        c_writer.write( "\t\t\t\t*OutValue" + i + " = *pReturn" + i + ";\n");
+                        c_writer.write( "\t\t\t}\n");
+                        c_writer.write( "\n");
+                        c_writer.write( "\t\t\tAxis::AxisDelete( (void *) pReturn" + i + ", " 
                                 + CUtils.getXSDEnumeratorForType( currentParaType) + ");\n");
                     }
                 }
                 else
                 {
-                    writer.write("\t\t\t\t"
+                    c_writer.write("\t\t\t\t"
                                     + currentParamName + " = (" + currentParaType
                                     + " *) m_pCall->getCmplxObject( (void *) Axis_DeSerialize_" + currentParaType
                                     + ",(void *) Axis_Create_" + currentParaType
@@ -629,15 +629,15 @@
                 }
             } // end for-loop for paramsC
             
-            writer.write("\t\t\t}\n");
-            writer.write("\t\t}\n\n");
-            writer.write("\t\tm_pCall->unInitialize();\n");
+            c_writer.write("\t\t\t}\n");
+            c_writer.write("\t\t}\n\n");
+            c_writer.write("\t\tm_pCall->unInitialize();\n");
         }
         else if (returntype == null)
         {
-            writer.write("\t\t\t\t/*not successful*/\n\t\t\t}\n");
-            writer.write("\t\t}\n\n");
-            writer.write("\t\tm_pCall->unInitialize();\n");
+            c_writer.write("\t\t\t\t/*not successful*/\n\t\t\t}\n");
+            c_writer.write("\t\t}\n\n");
+            c_writer.write("\t\tm_pCall->unInitialize();\n");
         }
         else if (returntypeisarray)
         {
@@ -646,71 +646,71 @@
             if (CUtils.isSimpleType(qname))
             {
                 containedType = CUtils.getSimpleType(qname);
-                writer.write("\t\t\t\tAxis_Array * RetAxisArray = m_pCall->getBasicArray( "
+                c_writer.write("\t\t\t\tAxis_Array * RetAxisArray = m_pCall->getBasicArray( "
                         + CUtils.getXSDEnumeratorForType(containedType) + ",\""
                         + paramTagName + "\",0);\n");
-                writer.write ("\t\t\t\tRetArray->clone( *RetAxisArray);\n");
-                writer.write ("\t\t\t\tAxis::AxisDelete( (void *) RetAxisArray, XSD_ARRAY);\n");
+                c_writer.write ("\t\t\t\tRetArray->clone( *RetAxisArray);\n");
+                c_writer.write ("\t\t\t\tAxis::AxisDelete( (void *) RetAxisArray, XSD_ARRAY);\n");
             }
             else
             {
                 containedType = qname.getLocalPart();
-                writer.write("\t\t\t\tRetArray = (" + containedType 
+                c_writer.write("\t\t\t\tRetArray = (" + containedType 
                         + "_Array *) m_pCall->getCmplxArray( RetArray,(void *) Axis_DeSerialize_"
                         + containedType);
-                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\t}\n\t\t}\n\n");
-            writer.write("\t\tm_pCall->unInitialize();\n\n");
-            writer.write("\t\treturn RetArray;\n");
+            c_writer.write("\t\t\t}\n\t\t}\n\n");
+            c_writer.write("\t\tm_pCall->unInitialize();\n\n");
+            c_writer.write("\t\treturn RetArray;\n");
         }
         else if (returntypeissimple)
         {
             if (returntype.isNillable () || CUtils.isPointerType(outparamType))
             {
-                writer.write( "\t\t\t\tRet = m_pCall->" 
+                c_writer.write( "\t\t\t\tRet = m_pCall->" 
                         + CUtils.getDeserializerMethodName( outparamType, false) 
                         + "(\"" + returntype.getParamNameAsSOAPString() + "\", 0);\n");
             }
             else
             {
-                writer.write ("\t\t\t\t" + outparamType + " * pReturn = m_pCall->" +
+                c_writer.write ("\t\t\t\t" + outparamType + " * pReturn = m_pCall->" +
                           CUtils.getDeserializerMethodName(outparamType, false) + "(\"" +
                           returntype.getElementNameAsSOAPString() + "\", 0);\n");
-                writer.write ("\t\t\t\tif(pReturn)\n");
-                writer.write ("\t\t\t\t{\n");
-                writer.write ("\t\t\t\t\tRet = *pReturn;\n");
-                writer.write ("\t\t\t\t\tAxis::AxisDelete( (void *) pReturn, " + CUtils.getXSDEnumeratorForType( outparamType) + ");\n");
-                writer.write ("\t\t\t\t}\n");
+                c_writer.write ("\t\t\t\tif(pReturn)\n");
+                c_writer.write ("\t\t\t\t{\n");
+                c_writer.write ("\t\t\t\t\tRet = *pReturn;\n");
+                c_writer.write ("\t\t\t\t\tAxis::AxisDelete( (void *) pReturn, " + CUtils.getXSDEnumeratorForType( outparamType) + ");\n");
+                c_writer.write ("\t\t\t\t}\n");
                 
                 // TODO If we unexpectedly receive a nill value, when nillable="false" we should do something appropriate, perhaps as below:
 //                              writer.write("\t\t\telse");
 //                              writer.write("\t\t\t\tthrow new Exception(\"Unexpected use of nill\");");
             }
-            writer.write("\t\t\t}\n");
-            writer.write("\t\t}\n\n");
-            writer.write("\t\tm_pCall->unInitialize();\n");
-            writer.write("\t\treturn Ret;\n");
+            c_writer.write("\t\t\t}\n");
+            c_writer.write("\t\t}\n\n");
+            c_writer.write("\t\tm_pCall->unInitialize();\n");
+            c_writer.write("\t\treturn Ret;\n");
         }
         else
         {
             outparamType = returntype.getLangName();
             //need to have complex type name without *
-            writer.write("\t\t\t\tpReturn = (" + outparamType
+            c_writer.write("\t\t\t\tpReturn = (" + outparamType
                     + " *) m_pCall->getCmplxObject( (void *) Axis_DeSerialize_"
                     + outparamType + ",(void *) Axis_Create_"
                     + outparamType + ",(void *) Axis_Delete_"
                     + outparamType + ",\"" + paramTagName
                     + "\",0);\n\t\t\t}\n");
-            writer.write("\t\t}\n\n");
-            writer.write("\t\tm_pCall->unInitialize();\n\n");
-            writer.write("\t\treturn pReturn;\n");
+            c_writer.write("\t\t}\n\n");
+            c_writer.write("\t\tm_pCall->unInitialize();\n\n");
+            c_writer.write("\t\treturn pReturn;\n");
         }
 
-        writer.write("\t}\n");
+        c_writer.write("\t}\n");
         
         //=============================================================================
         // End of try block, beginning of catch block
@@ -722,7 +722,7 @@
         // End of method
         //=============================================================================        
                 
-        writer.write("}\n");
+        c_writer.write("}\n");
     }
     
     /**
@@ -731,19 +731,19 @@
      */
     protected void writeCatchBlock(MethodInfo minfo) throws WrapperFault, IOException
     {
-        writer.write ("\tcatch(AxisException& e)\n\t{\n");
+        c_writer.write ("\tcatch(AxisException& e)\n\t{\n");
         
-        writer.write ("\t\tint iExceptionCode = e.getExceptionCode();\n\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\n");
-        writer.write ("\t\tISoapFault* pSoapFault = (ISoapFault*)\n");
-        writer.write ("\t\t\tm_pCall->checkFault(\"Fault\",\""
+        c_writer.write ("\t\tint iExceptionCode = e.getExceptionCode();\n\n");
+        c_writer.write ("\t\tif(AXISC_NODE_VALUE_MISMATCH_EXCEPTION != iExceptionCode)\n");
+        c_writer.write ("\t\t{\n");
+        c_writer.write ("\t\t\tm_pCall->unInitialize();\n");
+        c_writer.write ("\t\t\tthrow;\n");
+        c_writer.write ("\t\t}\n\n");
+        c_writer.write ("\t\tISoapFault* pSoapFault = (ISoapFault*)\n");
+        c_writer.write ("\t\t\tm_pCall->checkFault(\"Fault\",\""
                   + wscontext.getServiceInfo().getTargetEndpointURI () + "\" );\n\n");
-        writer.write ("\t\tif(pSoapFault)\n");
-        writer.write ("\t\t{\n");
+        c_writer.write ("\t\tif(pSoapFault)\n");
+        c_writer.write ("\t\t{\n");
     
         //to get fault info             
         Iterator paramsFault = minfo.getFaultType ().iterator ();
@@ -755,30 +755,30 @@
         int j = 0;
         if (!paramsFault.hasNext ())
         {
-            writer.write ("\t\t\tconst char *detail = pSoapFault->getSimpleFaultDetail();\n");
-            writer.write ("\t\t\tbool deleteDetail=false;\n\n");
-            writer.write ("\t\t\tif (NULL==detail || 0==strlen(detail))\n");
-            writer.write ("\t\t\t{\n");
-            writer.write ("\t\t\t\tdetail=m_pCall->getFaultAsXMLString();\n");
-            writer.write ("\t\t\t\tif (NULL==detail)\n");
-            writer.write ("\t\t\t\t\tdetail=\"\";\n");
-            writer.write ("\t\t\t\telse\n");
-            writer.write ("\t\t\t\t\tdeleteDetail=true;\n");
-            writer.write ("\t\t\t}\n\n");
-            writer.write ("\t\t\tOtherFaultException ofe(pSoapFault->getFaultcode(),\n");
-            writer.write ("\t\t\t\tpSoapFault->getFaultstring(), pSoapFault->getFaultactor(),\n");
-            writer.write ("\t\t\t\tdetail, iExceptionCode);\n\n");
-            writer.write ("\t\t\tif (deleteDetail && NULL!=detail)\n");
-            writer.write ("\t\t\t\tAxis::AxisDelete( (void *) const_cast<char*>(detail), XSD_STRING);\n");
-            writer.write ("\n");
-            writer.write ("\t\t\tm_pCall->unInitialize();\n");
-            writer.write ("\t\t\tdelete pSoapFault;\n");
-            writer.write ("\t\t\tthrow ofe;\n");
+            c_writer.write ("\t\t\tconst char *detail = pSoapFault->getSimpleFaultDetail();\n");
+            c_writer.write ("\t\t\tbool deleteDetail=false;\n\n");
+            c_writer.write ("\t\t\tif (NULL==detail || 0==strlen(detail))\n");
+            c_writer.write ("\t\t\t{\n");
+            c_writer.write ("\t\t\t\tdetail=m_pCall->getFaultAsXMLString();\n");
+            c_writer.write ("\t\t\t\tif (NULL==detail)\n");
+            c_writer.write ("\t\t\t\t\tdetail=\"\";\n");
+            c_writer.write ("\t\t\t\telse\n");
+            c_writer.write ("\t\t\t\t\tdeleteDetail=true;\n");
+            c_writer.write ("\t\t\t}\n\n");
+            c_writer.write ("\t\t\tOtherFaultException ofe(pSoapFault->getFaultcode(),\n");
+            c_writer.write ("\t\t\t\tpSoapFault->getFaultstring(), pSoapFault->getFaultactor(),\n");
+            c_writer.write ("\t\t\t\tdetail, iExceptionCode);\n\n");
+            c_writer.write ("\t\t\tif (deleteDetail && NULL!=detail)\n");
+            c_writer.write ("\t\t\t\tAxis::AxisDelete( (void *) const_cast<char*>(detail), XSD_STRING);\n");
+            c_writer.write ("\n");
+            c_writer.write ("\t\t\tm_pCall->unInitialize();\n");
+            c_writer.write ("\t\t\tdelete pSoapFault;\n");
+            c_writer.write ("\t\t\tthrow ofe;\n");
         }
         else
         {
             flag = true;
-            writer.write ("\t\t\tpcCmplxFaultName = pSoapFault->getCmplxFaultObjectName();\n");
+            c_writer.write ("\t\t\tpcCmplxFaultName = pSoapFault->getCmplxFaultObjectName();\n");
         }
         
         while (paramsFault.hasNext ())
@@ -813,12 +813,12 @@
                 faultType = CUtils.getClassNameFromParamInfoConsideringArrays (par,wscontext);
                 if (j > 1)
                 {
-                    writer.write ("\t\t\telse if");
+                    c_writer.write ("\t\t\telse if");
                     writeExceptions (faultType, faultInfoName, paramName, langName);
                 }
                 else
                 {
-                    writer.write ("\t\t\tif");
+                    c_writer.write ("\t\t\tif");
                     writeExceptions (faultType,faultInfoName, paramName, langName);
                 }
             }
@@ -826,39 +826,39 @@
         
         if (flag == true)
         {
-            writer.write ("\t\t\telse\n");
-            writer.write ("\t\t\t{\n");
-            writer.write ("\t\t\t\tconst char *detail = pSoapFault->getSimpleFaultDetail();\n");
-            writer.write ("\t\t\t\tbool deleteDetail=false;\n\n");
-            writer.write ("\t\t\t\tif (NULL==detail || 0==strlen(detail))\n");
-            writer.write ("\t\t\t\t{\n");
-            writer.write ("\t\t\t\t\tdetail=m_pCall->getFaultAsXMLString();\n\n");
-            writer.write ("\t\t\t\t\tif (NULL==detail)\n");
-            writer.write ("\t\t\t\t\t\tdetail=\"\";\n");
-            writer.write ("\t\t\t\t\telse\n");
-            writer.write ("\t\t\t\t\t\tdeleteDetail=true;\n");
-            writer.write ("\t\t\t\t}\n\n");
-            writer.write ("\t\t\t\tOtherFaultException ofe(pSoapFault->getFaultcode(),\n");
-            writer.write ("\t\t\t\t\tpSoapFault->getFaultstring(), pSoapFault->getFaultactor(),\n");
-            writer.write ("\t\t\t\t\tdetail, iExceptionCode);\n\n");
-            writer.write ("\t\t\t\tif (deleteDetail && NULL!=detail)\n");
-            writer.write ("\t\t\t\t\tAxis::AxisDelete( (void *) const_cast<char*>(detail), XSD_STRING);\n");
-            writer.write ("\n");
-            writer.write ("\t\t\t\tm_pCall->unInitialize();\n");
-            writer.write ("\t\t\t\tdelete pSoapFault;\n");
-            writer.write ("\t\t\t\tthrow ofe;\n");
-            writer.write ("\t\t\t}\n");
-        }
-        
-        writer.write ("\t\t}\n");
-        writer.write ("\t\telse\n");
-        writer.write ("\t\t{\n");
-        writer.write ("\t\t\tm_pCall->unInitialize();\n");
-        writer.write ("\t\t\tdelete pSoapFault;\n");
-        writer.write ("\t\t\tthrow;\n");
-        writer.write ("\t\t}\n");
+            c_writer.write ("\t\t\telse\n");
+            c_writer.write ("\t\t\t{\n");
+            c_writer.write ("\t\t\t\tconst char *detail = pSoapFault->getSimpleFaultDetail();\n");
+            c_writer.write ("\t\t\t\tbool deleteDetail=false;\n\n");
+            c_writer.write ("\t\t\t\tif (NULL==detail || 0==strlen(detail))\n");
+            c_writer.write ("\t\t\t\t{\n");
+            c_writer.write ("\t\t\t\t\tdetail=m_pCall->getFaultAsXMLString();\n\n");
+            c_writer.write ("\t\t\t\t\tif (NULL==detail)\n");
+            c_writer.write ("\t\t\t\t\t\tdetail=\"\";\n");
+            c_writer.write ("\t\t\t\t\telse\n");
+            c_writer.write ("\t\t\t\t\t\tdeleteDetail=true;\n");
+            c_writer.write ("\t\t\t\t}\n\n");
+            c_writer.write ("\t\t\t\tOtherFaultException ofe(pSoapFault->getFaultcode(),\n");
+            c_writer.write ("\t\t\t\t\tpSoapFault->getFaultstring(), pSoapFault->getFaultactor(),\n");
+            c_writer.write ("\t\t\t\t\tdetail, iExceptionCode);\n\n");
+            c_writer.write ("\t\t\t\tif (deleteDetail && NULL!=detail)\n");
+            c_writer.write ("\t\t\t\t\tAxis::AxisDelete( (void *) const_cast<char*>(detail), XSD_STRING);\n");
+            c_writer.write ("\n");
+            c_writer.write ("\t\t\t\tm_pCall->unInitialize();\n");
+            c_writer.write ("\t\t\t\tdelete pSoapFault;\n");
+            c_writer.write ("\t\t\t\tthrow ofe;\n");
+            c_writer.write ("\t\t\t}\n");
+        }
+        
+        c_writer.write ("\t\t}\n");
+        c_writer.write ("\t\telse\n");
+        c_writer.write ("\t\t{\n");
+        c_writer.write ("\t\t\tm_pCall->unInitialize();\n");
+        c_writer.write ("\t\t\tdelete pSoapFault;\n");
+        c_writer.write ("\t\t\tthrow;\n");
+        c_writer.write ("\t\t}\n");
         
-        writer.write ("\t}\n");
+        c_writer.write ("\t}\n");
     }
 
     /**
@@ -871,21 +871,21 @@
     {
         try
         {
-            writer.write("(0 == strcmp(\"" + faultInfoName + "\", pcCmplxFaultName))\n");
-            writer.write("\t\t\t{\n");
-            writer.write("\t\t\t\t" + faulttype + " pFaultDetail = \n");
-            writer.write("\t\t\t\t\t(" + faulttype + ")pSoapFault->getCmplxFaultObject(\n");
-            writer.write("\t\t\t\t\t\t(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 + ",\n");
-            writer.write("\t\t\t\t\t\t\"" + faultInfoName + "\",\n");
-            writer.write("\t\t\t\t\t\t0);\n\n");
-            writer.write("\t\t\t\tpFaultDetail->setFaultCode(pSoapFault->getFaultcode());\n");
-            writer.write("\t\t\t\tpFaultDetail->setFaultString(pSoapFault->getFaultstring());\n");
-            writer.write("\t\t\t\tpFaultDetail->setFaultActor(pSoapFault->getFaultactor());\n");
-            writer.write("\t\t\t\tpFaultDetail->setExceptionCode(e.getExceptionCode());\n");
-            writer.write("\t\t\t\tm_pCall->unInitialize();\n");
-            writer.write ("\t\t\t\tdelete pSoapFault;\n");
+            c_writer.write("(0 == strcmp(\"" + faultInfoName + "\", pcCmplxFaultName))\n");
+            c_writer.write("\t\t\t{\n");
+            c_writer.write("\t\t\t\t" + faulttype + " pFaultDetail = \n");
+            c_writer.write("\t\t\t\t\t(" + faulttype + ")pSoapFault->getCmplxFaultObject(\n");
+            c_writer.write("\t\t\t\t\t\t(void*) Axis_DeSerialize_" + langName + ",\n");
+            c_writer.write("\t\t\t\t\t\t(void*) Axis_Create_" + langName + ",\n");
+            c_writer.write("\t\t\t\t\t\t(void*) Axis_Delete_" + langName + ",\n");
+            c_writer.write("\t\t\t\t\t\t\"" + faultInfoName + "\",\n");
+            c_writer.write("\t\t\t\t\t\t0);\n\n");
+            c_writer.write("\t\t\t\tpFaultDetail->setFaultCode(pSoapFault->getFaultcode());\n");
+            c_writer.write("\t\t\t\tpFaultDetail->setFaultString(pSoapFault->getFaultstring());\n");
+            c_writer.write("\t\t\t\tpFaultDetail->setFaultActor(pSoapFault->getFaultactor());\n");
+            c_writer.write("\t\t\t\tpFaultDetail->setExceptionCode(e.getExceptionCode());\n");
+            c_writer.write("\t\t\t\tm_pCall->unInitialize();\n");
+            c_writer.write ("\t\t\t\tdelete pSoapFault;\n");
             
             String faultTypeName;
             if (faulttype.lastIndexOf('*') != -1)
@@ -893,10 +893,10 @@
             else
                 faultTypeName = faulttype;
     
-            writer.write ("\t\t\t\t" + faultTypeName + " fault = *pFaultDetail;\n");
-            writer.write ("\t\t\t\tdelete pFaultDetail;\n");
-            writer.write ("\t\t\t\tthrow fault;\n");
-            writer.write("\t\t\t}\n");
+            c_writer.write ("\t\t\t\t" + faultTypeName + " fault = *pFaultDetail;\n");
+            c_writer.write ("\t\t\t\tdelete pFaultDetail;\n");
+            c_writer.write ("\t\t\t\tthrow fault;\n");
+            c_writer.write("\t\t\t}\n");
         } 
         catch (IOException e)
         {

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionHeaderWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionHeaderWriter.java?rev=688130&r1=688129&r2=688130&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionHeaderWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionHeaderWriter.java Fri Aug 22 10:37:39 2008
@@ -78,13 +78,13 @@
     {
         try
         {
-            writer.write("#include <string>\n");
-            writer.write("#include <exception>\n");
-            writer.write("#include <axis/AxisException.hpp>\n");
-            writer.write("#include <axis/ISoapFault.hpp>\n");
+            c_writer.write("#include <string>\n");
+            c_writer.write("#include <exception>\n");
+            c_writer.write("#include <axis/AxisException.hpp>\n");
+            c_writer.write("#include <axis/ISoapFault.hpp>\n");
             getLangName();
-            writer.write("using namespace std;\n");
-            writer.write("AXIS_CPP_NAMESPACE_USE \n\n");
+            c_writer.write("using namespace std;\n");
+            c_writer.write("AXIS_CPP_NAMESPACE_USE \n\n");
         }
         catch (IOException e)
         {
@@ -99,13 +99,13 @@
     {
         try
         {
-            writer.write("/*\n");
-            writer.write(
+            c_writer.write("/*\n");
+            c_writer.write(
                 " * This file was auto-generated by the Axis C++ Web Service "
                     + "Generator (WSDL2Ws)\n");
-            writer.write(
+            c_writer.write(
                 " * This file contains an Exception class of the web service.\n");
-            writer.write(" */\n\n");
+            c_writer.write(" */\n\n");
         }
         catch (IOException e)
         {
@@ -127,10 +127,10 @@
                 faultName = getServiceName() + "_" + faultInfoName;
             }
 
-            writer.write("public:\n");
-            writer.write("\tSTORAGE_CLASS_INFO " + faultName + "(ISoapFault* pFault);\n");
-            writer.write("\tSTORAGE_CLASS_INFO " + faultName + "(const int iExceptionCode, const char* pcMessage = NULL );\n");
-            writer.write("\tSTORAGE_CLASS_INFO " + faultName + "(const " + faultName + "& e);\n");
+            c_writer.write("public:\n");
+            c_writer.write("\tSTORAGE_CLASS_INFO " + faultName + "(ISoapFault* pFault);\n");
+            c_writer.write("\tSTORAGE_CLASS_INFO " + faultName + "(const int iExceptionCode, const char* pcMessage = NULL );\n");
+            c_writer.write("\tSTORAGE_CLASS_INFO " + faultName + "(const " + faultName + "& e);\n");
             
         }
         catch (IOException e)
@@ -153,7 +153,7 @@
                 faultName = getServiceName() + "_" + faultInfoName;
             }
 
-            writer.write("\tSTORAGE_CLASS_INFO virtual ~" + faultName + "() throw();\n");
+            c_writer.write("\tSTORAGE_CLASS_INFO virtual ~" + faultName + "() throw();\n");
         }
         catch (IOException e)
         {
@@ -168,11 +168,11 @@
         try
         {
             
-            writer.write("\tSTORAGE_CLASS_INFO const ISoapFault* getFault();\n\n");
-            writer.write("private:\n");
-            writer.write("\tSTORAGE_CLASS_INFO string getMessageForExceptionCode(int iExceptionCode);\n");
-            writer.write("\t ISoapFault* m_pISoapFault;\n");
-            writer.write("\t string m_sMessageForExceptionCode;\n\n");
+            c_writer.write("\tSTORAGE_CLASS_INFO const ISoapFault* getFault();\n\n");
+            c_writer.write("private:\n");
+            c_writer.write("\tSTORAGE_CLASS_INFO string getMessageForExceptionCode(int iExceptionCode);\n");
+            c_writer.write("\t ISoapFault* m_pISoapFault;\n");
+            c_writer.write("\t string m_sMessageForExceptionCode;\n\n");
         }
         catch (Exception e)
         {
@@ -210,7 +210,7 @@
                     {
                         ParameterInfo par = (ParameterInfo) paramInfo.get(j);
                         langName = par.getLangName();
-                        writer.write(
+                        c_writer.write(
                             "#include \""
                                 + langName
                                 + CUtils.getHeaderFileExtension()

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionWriter.java?rev=688130&r1=688129&r2=688130&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ExceptionWriter.java Fri Aug 22 10:37:39 2008
@@ -85,7 +85,7 @@
         {
             if ("AxisClientException".equals(faultInfoName))
             {
-                writer.write(
+                c_writer.write(
                     "#include \""
                         + getServiceName()
                         + "_"
@@ -95,13 +95,13 @@
             }
             else
             {
-                writer.write(
+                c_writer.write(
                     "#include \""
                         + faultInfoName
                         + CUtils.getHeaderFileExtension()
                         + "\"\n\n");
             }
-            writer.write("#include <axis/AxisWrapperAPI.hpp>\n\n");
+            c_writer.write("#include <axis/AxisWrapperAPI.hpp>\n\n");
         }
         catch (IOException e)
         {
@@ -116,16 +116,16 @@
     {
         try
         {
-            writer.write("/*\n");
-            writer.write(
+            c_writer.write("/*\n");
+            c_writer.write(
                 " * This file was auto-generated by the Axis C++ Web Service "
                     + "Generator (WSDL2Ws)\n");
-            writer.write(
+            c_writer.write(
                 " * This file contains implementations of the "
                     + getServiceName()
                     + " Exception "
                     + "class of the web service.\n");
-            writer.write(" */\n\n");
+            c_writer.write(" */\n\n");
 
         }
         catch (IOException e)
@@ -148,29 +148,29 @@
                 faultName = getServiceName() + "_" + faultInfoName;
             }
 
-            writer.write(
+            c_writer.write(
                 faultName + "::\n" + faultName + "(ISoapFault* pFault)\n");
-            writer.write("{\n");
-            writer.write(
+            c_writer.write("{\n");
+            c_writer.write(
                 "\tm_iExceptionCode = AXISC_SERVICE_THROWN_EXCEPTION;\n");
-            writer.write("\tm_pISoapFault = pFault;\n"); // Fred Preston
-            writer.write("}\n\n");
+            c_writer.write("\tm_pISoapFault = pFault;\n"); // Fred Preston
+            c_writer.write("}\n\n");
 
-            writer.write(
+            c_writer.write(
                 faultName + "::\n" + faultName + "(const int iExceptionCode, const char* pcMessage):AxisException(iExceptionCode)\n");
-            writer.write("{\n\n");
-            writer.write("\tstring sMessage = \"\";\n");
-            writer.write("\tif (pcMessage)\n\t{\n");
-            writer.write("\t\tsMessage = string(pcMessage);\n");
-            writer.write("\t\tgetMessageForExceptionCode(iExceptionCode);\n");
-            writer.write("\t\tm_sMessageForExceptionCode = getMessageForExceptionCode(iExceptionCode) + \" \" + sMessage;\n");
-            writer.write("\t\tsetMessage(m_sMessageForExceptionCode.c_str());\n");
-			writer.write("\t}\n\n");
-            writer.write("\telse\n");
-            writer.write("\t\tsetMessage(getMessageForExceptionCode(iExceptionCode).c_str());\n");
-            writer.write("}\n\n");
-            writer.write(faultName + "::\n" + faultName + "(const " + faultName + "& e):AxisException(e)\n");
-            writer.write("{}\n\n");
+            c_writer.write("{\n\n");
+            c_writer.write("\tstring sMessage = \"\";\n");
+            c_writer.write("\tif (pcMessage)\n\t{\n");
+            c_writer.write("\t\tsMessage = string(pcMessage);\n");
+            c_writer.write("\t\tgetMessageForExceptionCode(iExceptionCode);\n");
+            c_writer.write("\t\tm_sMessageForExceptionCode = getMessageForExceptionCode(iExceptionCode) + \" \" + sMessage;\n");
+            c_writer.write("\t\tsetMessage(m_sMessageForExceptionCode.c_str());\n");
+			c_writer.write("\t}\n\n");
+            c_writer.write("\telse\n");
+            c_writer.write("\t\tsetMessage(getMessageForExceptionCode(iExceptionCode).c_str());\n");
+            c_writer.write("}\n\n");
+            c_writer.write(faultName + "::\n" + faultName + "(const " + faultName + "& e):AxisException(e)\n");
+            c_writer.write("{}\n\n");
             
             
         }
@@ -193,7 +193,7 @@
             {
                 faultName = getServiceName() + "_" + faultInfoName;
             }
-            writer.write(
+            c_writer.write(
                 faultName
                     + "::\n~"
                     + faultName
@@ -219,33 +219,33 @@
                 faultName = getServiceName() + "_" + faultInfoName;
             }
             
-            writer.write(
+            c_writer.write(
                 "string "
                     + faultName
                     + "::\ngetMessageForExceptionCode (int iExceptionCode)\n");
-            writer.write("{\n");
-            writer.write("\tswitch(iExceptionCode)\n");
-            writer.write("\t{\n");
-            writer.write("\t\tcase AXISC_SERVICE_THROWN_EXCEPTION:\n");
-            writer.write(
+            c_writer.write("{\n");
+            c_writer.write("\tswitch(iExceptionCode)\n");
+            c_writer.write("\t{\n");
+            c_writer.write("\t\tcase AXISC_SERVICE_THROWN_EXCEPTION:\n");
+            c_writer.write(
                 "\t\t\tm_sMessageForExceptionCode = \"The "
                     + getServiceName()
                     + " service has thrown an exception. see details\";\n");
-            writer.write("\t\t\tbreak;\n");
-            writer.write("\t\tdefault:\n");
-            writer.write(
+            c_writer.write("\t\t\tbreak;\n");
+            c_writer.write("\t\tdefault:\n");
+            c_writer.write(
                 "\t\t\tm_sMessageForExceptionCode = \"Unknown Exception has occurred in the "
                     + getServiceName()
                     + " service\";\n");
-            writer.write("\t}\n");
-            writer.write("return m_sMessageForExceptionCode;\n");
-            writer.write("}\n\n");
+            c_writer.write("\t}\n");
+            c_writer.write("return m_sMessageForExceptionCode;\n");
+            c_writer.write("}\n\n");
 
-            writer.write("const ISoapFault* " + faultName + "::\ngetFault()");
+            c_writer.write("const ISoapFault* " + faultName + "::\ngetFault()");
             //Fred Preston
-            writer.write("{\n");
-            writer.write("\treturn m_pISoapFault;\n");
-            writer.write("}\n\n");
+            c_writer.write("{\n");
+            c_writer.write("\treturn m_pISoapFault;\n");
+            c_writer.write("}\n\n");
 
         }
         catch (IOException e)
@@ -263,7 +263,7 @@
         {
             String filename = getFilePath().getName();
 
-            this.writer =
+            c_writer =
                 new BufferedWriter(
                     new FileWriter(
                         getFilePath(filename.startsWith("AxisClientException")),
@@ -275,8 +275,8 @@
             writeConstructors();
             writeDestructors();
             writeMethods();
-            writer.flush();
-            writer.close();
+            c_writer.flush();
+            c_writer.close();
             if (WSDL2Ws.c_verbose)
                 System.out.println(
                     getFilePath().getAbsolutePath() + " created.....");

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/HeaderFileWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/HeaderFileWriter.java?rev=688130&r1=688129&r2=688130&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/HeaderFileWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/HeaderFileWriter.java Fri Aug 22 10:37:39 2008
@@ -47,7 +47,7 @@
         {
             String filename = getFilePath().getName();
 
-            this.writer =
+            c_writer =
                 new BufferedWriter(
                     new FileWriter(
                         getFilePath(filename.startsWith("AxisClientException")),
@@ -55,15 +55,15 @@
 
             writeClassComment();
             // if this headerfile not defined define it 
-            this.writer.write(
+            c_writer.write(
                 "#if !defined(__"
-                    + classname.toUpperCase()
+                    + c_classname.toUpperCase()
                     + "_"
                     + getFileType().toUpperCase()
                     + "_H__INCLUDED_)\n");
-            this.writer.write(
+            c_writer.write(
                 "#define __"
-                    + classname.toUpperCase()
+                    + c_classname.toUpperCase()
                     + "_"
                     + getFileType().toUpperCase()
                     + "_H__INCLUDED_\n\n");
@@ -71,35 +71,35 @@
             writePreprocessorStatements();
             //class
 
-            if ("AxisClientException".equals(classname))
+            if ("AxisClientException".equals(c_classname))
             {
-                this.writer.write(
+                c_writer.write(
                     "class "
                         + getServiceName()
                         + "_"
-                        + classname
+                        + c_classname
                         + getExtendsPart()
                         + "\n{\n");
             }
             else
             {
-                this.writer.write(
-                    "class " + classname + getExtendsPart() + "\n{\n");
+                c_writer.write(
+                    "class " + c_classname + getExtendsPart() + "\n{\n");
             }
             writeAttributes();
             writeConstructors();
             writeDestructors();
             writeMethods();
-            this.writer.write("};\n\n");
-            this.writer.write(
+            c_writer.write("};\n\n");
+            c_writer.write(
                 "#endif /* !defined(__"
-                    + classname.toUpperCase()
+                    + c_classname.toUpperCase()
                     + "_"
                     + getFileType().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.....");
@@ -119,11 +119,11 @@
         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.getServiceName() + "_" + classname + CUtils.getHeaderFileExtension();
+            fileName = targetOutputLocation + "/" + this.getServiceName() + "_" + c_classname + CUtils.getHeaderFileExtension();
         }
 
         return new File(fileName);

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParamCPPFileWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParamCPPFileWriter.java?rev=688130&r1=688129&r2=688130&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParamCPPFileWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParamCPPFileWriter.java Fri Aug 22 10:37:39 2008
@@ -54,7 +54,7 @@
     {
         try
         {
-            this.writer = new BufferedWriter(new FileWriter(getFilePath(), false));
+            c_writer = new BufferedWriter(new FileWriter(getFilePath(), false));
             writeClassComment();
             writePreprocessorStatements();
             
@@ -69,8 +69,8 @@
                 writeGlobalCodes();
             }
             
-            writer.flush();
-            writer.close();
+            c_writer.flush();
+            c_writer.close();
             if (WSDL2Ws.c_verbose)
                 System.out.println(getFilePath().getAbsolutePath() + " created.....");
         }
@@ -85,12 +85,12 @@
     protected abstract void writeGlobalCodes() throws WrapperFault;
     protected File getFilePath() throws WrapperFault
     {
-        classname = CUtils.sanitizeString( classname);
+        c_classname = CUtils.sanitizeString( c_classname);
 
         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);
     }
 
@@ -98,13 +98,13 @@
     {
         try
         {
-            writer.write("#include <axis/AxisException.hpp>\n");
-            writer.write("#include <axis/ElementMissingException.hpp>\n");
-            writer.write("#include <axis/RedundantElementException.hpp>\n");
-            writer.write("#include <axis/UnknownElementException.hpp>\n");
-            writer.write("#include <axis/AxisWrapperAPI.hpp>\n");
-            writer.write("#include <axis/Axis.hpp>\n\n");
-            writer.write("#include \"" + this.classname + CUtils.getHeaderFileExtension() + "\"\n");
+            c_writer.write("#include <axis/AxisException.hpp>\n");
+            c_writer.write("#include <axis/ElementMissingException.hpp>\n");
+            c_writer.write("#include <axis/RedundantElementException.hpp>\n");
+            c_writer.write("#include <axis/UnknownElementException.hpp>\n");
+            c_writer.write("#include <axis/AxisWrapperAPI.hpp>\n");
+            c_writer.write("#include <axis/Axis.hpp>\n\n");
+            c_writer.write("#include \"" + this.c_classname + CUtils.getHeaderFileExtension() + "\"\n");
         }
         catch (IOException e)
         {



Mime
View raw message