axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prest...@apache.org
Subject svn commit: r330584 - in /webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp: ClientStubWriter.java literal/BeanParamWriter.java literal/ClientStubWriter.java literal/ParamCPPFileWriter.java
Date Thu, 03 Nov 2005 17:18:04 GMT
Author: prestonf
Date: Thu Nov  3 09:17:57 2005
New Revision: 330584

URL: http://svn.apache.org/viewcvs?rev=330584&view=rev
Log:
Part of the fix for AXISCPP-149.  This covers all of the simple types.

Modified:
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParamCPPFileWriter.java

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java?rev=330584&r1=330583&r2=330584&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 Thu Nov  3 09:17:57 2005
@@ -1,6 +1,6 @@
 /*
  *   Copyright 2003-2004 The Apache Software Foundation.
-// (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved
+ // (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
  *   you may not use this file except in compliance with the License.
@@ -43,68 +43,70 @@
 public class ClientStubWriter extends CPPClassWriter
 {
     protected ArrayList methods;
+
     public ClientStubWriter(WebServiceContext wscontext) throws WrapperFault
     {
-        super(
-            WrapperUtils.getClassNameFromFullyQualifiedName(
-                wscontext.getSerInfo().getQualifiedServiceName()));
+        super(WrapperUtils.getClassNameFromFullyQualifiedName(wscontext
+                .getSerInfo().getQualifiedServiceName()));
         this.wscontext = wscontext;
         this.methods = wscontext.getSerInfo().getMethods();
     }
+
     protected String getServiceName() throws WrapperFault
     {
         return wscontext.getSerInfo().getServicename();
     }
+
     protected void writeClassComment() throws WrapperFault
     {
         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(" * 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");
-        }
-        catch (IOException e)
+        } catch (IOException e)
         {
             throw new WrapperFault(e);
         }
     }
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.apache.axis.wsdl.wsdl2ws.cpp.HeaderFileWriter#writeConstructors()
      */
     protected void writeConstructors() throws WrapperFault
     {
         try
         {
-            writer.write(
-                classname
-                    + "::"
-                    + classname
-                    + "(const char* pchEndpointUri, AXIS_PROTOCOL_TYPE eProtocol)\n:Stub(pchEndpointUri, eProtocol)\n{\n");
+            writer
+                    .write(classname
+                            + "::"
+                            + classname
+                            + "(const char* pchEndpointUri, AXIS_PROTOCOL_TYPE eProtocol)\n:Stub(pchEndpointUri, eProtocol)\n{\n");
             writer.write("}\n\n");
-            writer.write(
-                classname
-                    + "::"
-                    + classname
+            writer.write(classname + "::" + 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(\""
-                    + wscontext.getWrapInfo().getTargetEndpointURI()
-                    + "\");\n");
+            //TODO get TransportURI from WrapInfo and check what the transport
+            // is and do the following line accordingly
+            writer
+                    .write("\tm_pCall->setEndpointURI(\""
+                            + wscontext.getWrapInfo().getTargetEndpointURI()
+                            + "\");\n");
             writer.write("}\n\n");
-        }
-        catch (IOException e)
+        } catch (IOException e)
         {
             throw new WrapperFault(e);
         }
     }
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.apache.axis.wsdl.wsdl2ws.cpp.HeaderFileWriter#writeDistructors()
      */
     protected void writeDestructors() throws WrapperFault
@@ -112,22 +114,23 @@
         try
         {
             writer.write(classname + "::~" + classname + "()\n{\n}\n\n");
-        }
-        catch (IOException e)
+        } catch (IOException e)
         {
             throw new WrapperFault(e);
         }
     }
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.apache.axis.wsdl.wsdl2ws.cpp.HeaderFileWriter#writeMethods()
      */
     protected void writeMethods() throws WrapperFault
     {
         try
         {
-            writer.write(
-                "\n/*Methods corresponding to the web service methods*/\n");
+            writer
+                    .write("\n/*Methods corresponding to the web service methods*/\n");
             MethodInfo minfo;
             for (int i = 0; i < methods.size(); i++)
             {
@@ -136,14 +139,15 @@
                 writer.write("\n");
             }
             //damitha
-        }
-        catch (IOException e)
+        } catch (IOException e)
         {
             throw new WrapperFault(e);
         }
     }
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.apache.axis.wsdl.wsdl2ws.cpp.HeaderFileWriter#writePreprocssorStatements()
      */
     protected void writePreprocessorStatements() throws WrapperFault
@@ -152,28 +156,19 @@
         {
             if ("AxisClientException".equals(classname))
             {
-                writer.write(
-                    "#include \""
-                        + getServiceName()
-                        + "_"
-                        + classname
-                        + CUtils.CPP_HEADER_SUFFIX
-                        + "\"\n\n");
+                writer.write("#include \"" + getServiceName() + "_" + classname
+                        + CUtils.CPP_HEADER_SUFFIX + "\"\n\n");
             }
             else
             {
-                writer.write(
-                    "#include \""
-                        + classname
-                        + CUtils.CPP_HEADER_SUFFIX
-                        + "\"\n\n");
+                writer.write("#include \"" + classname
+                        + CUtils.CPP_HEADER_SUFFIX + "\"\n\n");
             }
             writer.write("#include <axis/AxisWrapperAPI.hpp>\n");
-		writer.write("#include <string.h>\n\n");	// for memcpy
+            writer.write("#include <string.h>\n\n"); // for memcpy
             writer.write("using namespace std;\n\n ");
 
-        }
-        catch (IOException e)
+        } catch (IOException e)
         {
             throw new WrapperFault(e);
         }
@@ -181,14 +176,15 @@
 
     /**
      * This method genarate methods that wraps the each method of the service
+     * 
      * @param methodName
      * @param params
      * @param outparam
      * @throws IOException
      */
 
-    public void writeMethodInWrapper(MethodInfo minfo)
-        throws WrapperFault, IOException
+    public void writeMethodInWrapper(MethodInfo minfo) throws WrapperFault,
+            IOException
     {
         boolean isAllTreatedAsOutParams = false;
         ParameterInfo returntype = null;
@@ -201,11 +197,8 @@
         {
             if (1 == noOfOutParams)
             {
-                returntype =
-                    (ParameterInfo) minfo
-                        .getOutputParameterTypes()
-                        .iterator()
-                        .next();
+                returntype = (ParameterInfo) minfo.getOutputParameterTypes()
+                        .iterator().next();
             }
             else
             {
@@ -221,19 +214,17 @@
         String outparamTypeName = null;
         if (returntype != null)
         {
-            outparamTypeName =
-                WrapperUtils.getClassNameFromParamInfoConsideringArrays(
-                    returntype,
-                    wscontext);
-            retType =
-                wscontext.getTypemap().getType(returntype.getSchemaName());
+            outparamTypeName = WrapperUtils
+                    .getClassNameFromParamInfoConsideringArrays(returntype,
+                            wscontext);
+            retType = wscontext.getTypemap()
+                    .getType(returntype.getSchemaName());
             if (retType != null)
             {
                 returntypeisarray = retType.isArray();
                 if (WSDL2Ws.verbose)
                 {
-                    System.out.println(
-                        retType.getLanguageSpecificName()
+                    System.out.println(retType.getLanguageSpecificName()
                             + "LanguageName  .................... ");
                 }
                 if (CUtils.isSimpleType(retType.getLanguageSpecificName()))
@@ -243,8 +234,8 @@
             }
         }
         writer.write("\n/*\n");
-        writer.write(
-            " * This method wrap the service method " + methodName + "\n");
+        writer.write(" * This method wrap the service method " + methodName
+                + "\n");
         writer.write(" */\n");
         //method signature
         String paramTypeName;
@@ -257,46 +248,43 @@
         }
         else
         {
-        	if (returntypeissimple
-					&& returntype.isNillable()
-					&& !(CUtils.isPointerType(outparamTypeName)))
-        	{
-        		writer.write(outparamTypeName + " *");        		
-        	}
-        	else
-        	{
-        		writer.write(outparamTypeName);
-        	}
-            
+            if (returntypeissimple && returntype.isNillable()
+                    && !(CUtils.isPointerType(outparamTypeName)))
+            {
+                writer.write(outparamTypeName + " *");
+            }
+            else
+            {
+                writer.write(outparamTypeName);
+            }
+
             if (WSDL2Ws.verbose)
             {
-                System.out.println(
-                    "Output Parameter type Name :" + outparamTypeName);
+                System.out.println("Output Parameter type Name :"
+                        + outparamTypeName);
             }
         }
         writer.write(" " + classname + "::" + methodName + "(");
         ArrayList paramsB = (ArrayList) params;
         for (int i = 0; i < paramsB.size(); i++)
         {
-            paramTypeName =
-                WrapperUtils.getClassNameFromParamInfoConsideringArrays(
-                    (ParameterInfo) paramsB.get(i),
-                    wscontext);
+            paramTypeName = WrapperUtils
+                    .getClassNameFromParamInfoConsideringArrays(
+                            (ParameterInfo) paramsB.get(i), wscontext);
             if (i > 0)
             {
                 writer.write(", ");
             }
             typeissimple = CUtils.isSimpleType(paramTypeName);
-        	if (typeissimple
-					&& ((ParameterInfo) paramsB.get(i)).isNillable()
-					&& !(CUtils.isPointerType(paramTypeName)))
-        	{
-        		writer.write(paramTypeName + " * Value" + i);
-        	}
-        	else
-        	{
-        		writer.write(paramTypeName + " Value" + i);
-        	}
+            if (typeissimple && ((ParameterInfo) paramsB.get(i)).isNillable()
+                    && !(CUtils.isPointerType(paramTypeName)))
+            {
+                writer.write(paramTypeName + " * Value" + i);
+            }
+            else
+            {
+                writer.write(paramTypeName + " Value" + i);
+            }
         }
         // Multiples parameters so fill the methods prototype
         ArrayList paramsC = (ArrayList) minfo.getOutputParameterTypes();
@@ -305,17 +293,13 @@
             String currentParaTypeName;
             for (int i = 0; i < paramsC.size(); i++)
             {
-                type =
-                    wscontext.getTypemap().getType(
+                type = wscontext.getTypemap().getType(
                         ((ParameterInfo) paramsC.get(i)).getSchemaName());
-                writer.write(
-                    ", AXIS_OUT_PARAM  "
+                writer.write(", AXIS_OUT_PARAM  "
                         + WrapperUtils
-                            .getClassNameFromParamInfoConsideringArrays(
-                            (ParameterInfo) paramsC.get(i),
-                            wscontext)
-                        + " *OutValue"
-                        + i);
+                                .getClassNameFromParamInfoConsideringArrays(
+                                        (ParameterInfo) paramsC.get(i),
+                                        wscontext) + " *OutValue" + i);
             }
         }
         writer.write(")\n{\n");
@@ -337,41 +321,50 @@
                 else
                 {
                     //for simple types
-                	if (returntype.isNillable()
-							&& !(CUtils.isPointerType(outparamTypeName)))
-                	{
-                		writer.write(outparamTypeName + "* Ret = NULL;\n");
-                	}
-					else if (outparamTypeName.equals("xsd__string"))
-					{
-		                		writer.write(outparamTypeName + " Ret;\n");
-								writer.write("\tmemset(&Ret,0,sizeof(" + outparamTypeName + "));\n");
-					}
-                	else
-                	{
-	                    String initValue = CUtils.getInitValue(outparamTypeName);
-	                    if (initValue != null)
-	                    {
-	                        writer.write(
-	                            outparamTypeName + "* Ret = NULL;\n");//" + initValue + ";\n");
-	                    }
-	                    else
-	                    {
-	                        if (outparamTypeName.equals("xsd__base64Binary")
-	                            || outparamTypeName.equals("xsd__hexBinary"))
-	                        {
-	                            writer.write(outparamTypeName + "* Ret=NULL;\n");
-	                            //writer.write("\tRet->__ptr = NULL;\n");
-	                            //writer.write("\tRet->__size = 0;\n");
-	                        }
-	
-	                        else
-	                        {
-	                            writer.write(outparamTypeName + "* Ret=NULL;\n");
-	                        }
-	                    }
-	                    //TODO initialize return parameter appropriately.
-                	}
+                    if (returntype.isNillable()
+                            && !(CUtils.isPointerType(outparamTypeName)))
+                    {
+                        writer.write(outparamTypeName + "* Ret = NULL;\n");
+                    }
+                    else if (outparamTypeName.equals("xsd__string"))
+                    {
+                        writer.write(outparamTypeName + " Ret;\n");
+                        writer.write("\tmemset(&Ret,0,sizeof("
+                                + outparamTypeName + "));\n");
+                    }
+                    else
+                    {
+                        String initValue = CUtils
+                                .getInitValue(outparamTypeName);
+                        if (initValue != null)
+                        {
+                            writer.write(outparamTypeName + "* Ret = NULL;\n");//" +
+                                                                               // initValue
+                                                                               // +
+                                                                               // ";\n");
+                        }
+                        else
+                        {
+                            if (outparamTypeName.equals("xsd__base64Binary")
+                                    || outparamTypeName
+                                            .equals("xsd__hexBinary"))
+                            {
+                                writer
+                                        .write(outparamTypeName
+                                                + "* Ret=NULL;\n");
+                                //writer.write("\tRet->__ptr = NULL;\n");
+                                //writer.write("\tRet->__size = 0;\n");
+                            }
+
+                            else
+                            {
+                                writer
+                                        .write(outparamTypeName
+                                                + "* Ret=NULL;\n");
+                            }
+                        }
+                        //TODO initialize return parameter appropriately.
+                    }
                 }
             }
         }
@@ -381,47 +374,38 @@
         //writer.write("\tchar* cFaultactor;\n");
         writer.write("\tconst char* pcCmplxFaultName;\n");
         writer.write("\ttry\n\t{");
-        writer.write(
-            "\n\t\tif (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER"
-                + ")) \n\t\t\treturn ");
+        writer
+                .write("\n\t\tif (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER"
+                        + ")) \n\t\t\treturn ");
         //damitha
         if (returntype != null)
         {
-            if (outparamTypeName.equals("xsd__string") && returntypeissimple) 
-		writer.write("Ret;\n");
-	    else
-	        writer.write(
-                (returntypeisarray
-                    ? "RetArray"
-                    : returntypeissimple
-                    ? "*Ret"
-                    : "pReturn")
-                    + ";\n");
+            if (outparamTypeName.equals("xsd__string") && returntypeissimple)
+                writer.write("Ret;\n");
+            else
+                writer.write((returntypeisarray ? "RetArray"
+                        : returntypeissimple ? "*Ret" : "pReturn")
+                        + ";\n");
         }
         else
         {
             writer.write(";\n");
         }
-        writer.write("\tif (NULL==m_pCall->getTransportProperty(\"SOAPAction\",false))\n");
+        writer
+                .write("\tif (NULL==m_pCall->getTransportProperty(\"SOAPAction\",false))\n");
         writer.write("\t{\n");
-        writer.write(
-            "\t\tm_pCall->setTransportProperty(SOAPACTION_HEADER , \""
-                + minfo.getSoapAction()
-                + "\");\n");
+        writer.write("\t\tm_pCall->setTransportProperty(SOAPACTION_HEADER , \""
+                + minfo.getSoapAction() + "\");\n");
         writer.write("\t}\n");
         writer.write("\t\tm_pCall->setSOAPVersion(SOAP_VER_1_1);\n");
         //TODO check which version is it really.
-        writer.write(
-            "\t\tm_pCall->setOperation(\""
-                + minfo.getMethodname()
-                + "\", \""
-                + wscontext.getWrapInfo().getTargetNameSpaceOfWSDL()
+        writer.write("\t\tm_pCall->setOperation(\"" + minfo.getMethodname()
+                + "\", \"" + wscontext.getWrapInfo().getTargetNameSpaceOfWSDL()
                 + "\");\n");
         writer.write("\t\tapplyUserPreferences();\n");
         for (int i = 0; i < paramsB.size(); i++)
         {
-            type =
-                wscontext.getTypemap().getType(
+            type = wscontext.getTypemap().getType(
                     ((ParameterInfo) paramsB.get(i)).getSchemaName());
             if (type != null)
             {
@@ -443,10 +427,7 @@
                 {
                     containedType = CUtils.getclass4qname(qname);
                     writer.write("\tm_pCall->addBasicArrayParameter(");
-                    writer.write(
-                        "(Axis_Array*)(&Value"
-                            + i
-                            + "), "
+                    writer.write("(Axis_Array*)(&Value" + i + "), "
                             + CUtils.getXSDTypeForBasicType(containedType)
                             + ", \""
                             + ((ParameterInfo) paramsB.get(i)).getParamName()
@@ -456,75 +437,59 @@
                 {
                     containedType = qname.getLocalPart();
                     writer.write("\tm_pCall->addCmplxArrayParameter(");
-                    writer.write(
-                        "(Axis_Array*)(&Value"
-                            + i
-                            + "), (void*)Axis_Serialize_"
-                            + containedType
-                            + ", (void*)Axis_Delete_"
-                            + containedType
-                            + ", (void*) Axis_GetSize_"
-                            + containedType
+                    writer.write("(Axis_Array*)(&Value" + i
+                            + "), (void*)Axis_Serialize_" + containedType
+                            + ", (void*)Axis_Delete_" + containedType
+                            + ", (void*) Axis_GetSize_" + containedType
                             + ", \""
                             + ((ParameterInfo) paramsB.get(i)).getParamName()
-                            + "\", Axis_URI_"
-                            + containedType);
+                            + "\", Axis_URI_" + containedType);
                 }
             }
             else
             {
                 if (typeissimple)
                 {
-                	
-                    //for simple types	
-                	if (((ParameterInfo) paramsB.get(i)).isNillable()
-                			|| CUtils.isPointerType(paramTypeName))
-                	{
-                		writer.write("\t\tm_pCall->addParameter(");
-	                    writer.write(
-	                        "(void*)Value"
-	                            + i
-	                            + ", \""
-	                            + ((ParameterInfo) paramsB.get(i)).getParamName()
-	                            + "\", "
-	                            + CUtils.getXSDTypeForBasicType(paramTypeName));
-                	}
-                	else
-                	{
-	                    writer.write("\t\tm_pCall->addParameter(");
-	                    writer.write(
-	                        "(void*)&Value"
-	                            + i
-	                            + ", \""
-	                            + ((ParameterInfo) paramsB.get(i)).getParamName()
-	                            + "\", "
-	                            + CUtils.getXSDTypeForBasicType(paramTypeName));
-                	}
+
+                    //for simple types
+                    if (((ParameterInfo) paramsB.get(i)).isNillable()
+                            || CUtils.isPointerType(paramTypeName))
+                    {
+                        writer.write("\t\tm_pCall->addParameter(");
+                        writer.write("(void*)Value"
+                                + i
+                                + ", \""
+                                + ((ParameterInfo) paramsB.get(i))
+                                        .getParamName() + "\", "
+                                + CUtils.getXSDTypeForBasicType(paramTypeName));
+                    }
+                    else
+                    {
+                        writer.write("\t\tm_pCall->addParameter(");
+                        writer.write("(void*)&Value"
+                                + i
+                                + ", \""
+                                + ((ParameterInfo) paramsB.get(i))
+                                        .getParamName() + "\", "
+                                + CUtils.getXSDTypeForBasicType(paramTypeName));
+                    }
                 }
                 else
                 {
-                    //for complex types 
+                    //for complex types
                     writer.write("\tm_pCall->addCmplxParameter(");
-                    writer.write(
-                        "Value"
-                            + i
-                            + ", (void*)Axis_Serialize_"
-                            + paramTypeName
-                            + ", (void*)Axis_Delete_"
-                            + paramTypeName
-                            + ", \""
+                    writer.write("Value" + i + ", (void*)Axis_Serialize_"
+                            + paramTypeName + ", (void*)Axis_Delete_"
+                            + paramTypeName + ", \""
                             + ((ParameterInfo) paramsB.get(i)).getParamName()
-                            + "\", Axis_URI_"
-                            + paramTypeName);
+                            + "\", Axis_URI_" + paramTypeName);
                 }
             }
             writer.write(");\n");
         }
         writer.write("\t\tif (AXIS_SUCCESS == m_pCall->invoke())\n\t\t{\n");
-        writer.write(
-            "\t\t\tif(AXIS_SUCCESS == m_pCall->checkMessage(\""
-                + minfo.getOutputMessage().getLocalPart()
-                + "\", \""
+        writer.write("\t\t\tif(AXIS_SUCCESS == m_pCall->checkMessage(\""
+                + minfo.getOutputMessage().getLocalPart() + "\", \""
                 + wscontext.getWrapInfo().getTargetNameSpaceOfWSDL()
                 + "\"))\n\t\t\t{\n");
 
@@ -535,8 +500,8 @@
             for (int i = 0; i < paramsC.size(); i++)
             {
                 ParameterInfo currentType = (ParameterInfo) paramsC.get(i);
-                type =
-                    wscontext.getTypemap().getType(currentType.getSchemaName());
+                type = wscontext.getTypemap().getType(
+                        currentType.getSchemaName());
                 if (type != null)
                 {
                     currentParaType = type.getLanguageSpecificName();
@@ -544,14 +509,15 @@
                 }
                 else
                 {
-                    currentParaType =
-                        ((ParameterInfo) paramsC.get(i)).getLangName();
+                    currentParaType = ((ParameterInfo) paramsC.get(i))
+                            .getLangName();
                     typeisarray = false;
                 }
                 typeissimple = CUtils.isSimpleType(currentParaType);
 
                 currentParamName = "*OutValue" + i;
-                // Some code need to be merged as we have some duplicated in coding here.
+                // Some code need to be merged as we have some duplicated in
+                // coding here.
                 if (typeisarray)
                 {
                     QName qname = WrapperUtils.getArrayType(type).getName();
@@ -559,91 +525,75 @@
                     if (CUtils.isSimpleType(qname))
                     {
                         containedType = CUtils.getclass4qname(qname);
-                        writer.write(
-                            "\t\t\t\t"
-                                + currentParamName
-                                + " = ("
-                                + currentParaType
-                                + "&)m_pCall->getBasicArray("
+                        writer.write("\t\t\t\t" + currentParamName + " = ("
+                                + currentParaType + "&)m_pCall->getBasicArray("
                                 + CUtils.getXSDTypeForBasicType(containedType)
-                                + ", \""
-                                + currentType.getParamName()
+                                + ", \"" + currentType.getParamName()
                                 + "\", 0);\n");
                     }
                     else
                     {
                         containedType = qname.getLocalPart();
-                        writer.write(
-                            "\t\t\t\t"
-                                + currentParamName
-                                + " = ("
-                                + currentParaType
-                                + "&)m_pCall->getCmplxArray((void*) Axis_DeSerialize_"
-                                + containedType);
-                        writer.write(
-                            "\t\t\t\t, (void*) Axis_Create_"
-                                + containedType
-                                + ", (void*) Axis_Delete_"
-                                + containedType
-                                + ", (void*) Axis_GetSize_"
-                                + containedType
-                                + ", \""
-                                + currentType.getParamName()
-                                + "\", Axis_URI_"
-                                + containedType
-                                + ");\n");
+                        writer
+                                .write("\t\t\t\t"
+                                        + currentParamName
+                                        + " = ("
+                                        + currentParaType
+                                        + "&)m_pCall->getCmplxArray((void*) Axis_DeSerialize_"
+                                        + containedType);
+                        writer.write("\t\t\t\t, (void*) Axis_Create_"
+                                + containedType + ", (void*) Axis_Delete_"
+                                + containedType + ", (void*) Axis_GetSize_"
+                                + containedType + ", \""
+                                + currentType.getParamName() + "\", Axis_URI_"
+                                + containedType + ");\n");
                     }
                 }
                 else
                 {
                     if (typeissimple)
                     {
-                		//Chinthana:
-                		//Changes have done for handle AXIS_OUT_PARAM Types.
-                		if (CUtils.isPointerType(currentParaType))
-                		{
-                            writer.write(
-                                "\t\t\t\t"
+                        //Chinthana:
+                        //Changes have done for handle AXIS_OUT_PARAM Types.
+                        if (CUtils.isPointerType(currentParaType))
+                        {
+                            writer.write("\t\t\t\t"
                                     + currentParamName
                                     + " = m_pCall->"
                                     + CUtils.getParameterGetValueMethodName(
-                                        currentParaType,
-                                        false)
-                                    + "(\""
-                                    + currentType.getParamName()
-                                    + "\", 0);\n");
+                                            currentParaType, false) + "(\""
+                                    + currentType.getParamName() + "\", 0);\n");
+                        }
+                        else
+                        {
+                            writer
+                                    .write("\t\t\t\t"
+                                            + currentParamName
+                                            + " = *(m_pCall->"
+                                            + CUtils
+                                                    .getParameterGetValueMethodName(
+                                                            currentParaType,
+                                                            false) + "(\""
+                                            + currentType.getParamName()
+                                            + "\", 0));\n");
                         }
-                		else
-	                    {
-	                        writer.write(
-	                            "\t\t\t\t"
-	                                + currentParamName
-	                                + " = *(m_pCall->"
-	                                + CUtils.getParameterGetValueMethodName(
-	                                    currentParaType,
-	                                    false)
-	                                + "(\""
-	                                + currentType.getParamName()
-	                                + "\", 0));\n");
-	                    }
-                		//02/06/2006.....................................................
+                        //02/06/2006.....................................................
                     }
                     else
                     {
-                        writer.write(
-                            "\t\t\t\t"
-                                + currentParamName
-                                + " = ("
-                                + currentParaType
-                                + "*)m_pCall->getCmplxObject((void*) Axis_DeSerialize_"
-                                + currentParaType
-                                + ", (void*) Axis_Create_"
-                                + currentParaType
-                                + ", (void*) Axis_Delete_"
-                                + currentParaType
-                                + ",\""
-                                + currentType.getParamName()
-                                + "\", 0);\n");
+                        writer
+                                .write("\t\t\t\t"
+                                        + currentParamName
+                                        + " = ("
+                                        + currentParaType
+                                        + "*)m_pCall->getCmplxObject((void*) Axis_DeSerialize_"
+                                        + currentParaType
+                                        + ", (void*) Axis_Create_"
+                                        + currentParaType
+                                        + ", (void*) Axis_Delete_"
+                                        + currentParaType + ",\""
+                                        + currentType.getParamName()
+                                        + "\", 0);\n");
                     }
                 }
             }
@@ -651,122 +601,102 @@
             writer.write("\t\t}\n");
             writer.write("\tm_pCall->unInitialize();\n");
         }
-        else
-            if (returntype == null)
+        else if (returntype == null)
+        {
+            writer.write("\t\t\t/*not successful*/\n\t\t}\n");
+            writer.write("\t\t}\n");
+            writer.write("\tm_pCall->unInitialize();\n");
+        }
+        else if (returntypeisarray)
+        {
+            QName qname = WrapperUtils.getArrayType(retType).getName();
+            String containedType = null;
+            if (CUtils.isSimpleType(qname))
+            {
+                containedType = CUtils.getclass4qname(qname);
+                writer.write("\t\t\t\tAxis_Array RetAxisArray = "
+                        + "m_pCall->getBasicArray("
+                        + CUtils.getXSDTypeForBasicType(containedType) + ", \""
+                        + returntype.getParamName() + "\", 0);\n");
+                writer
+                        .write("\t\t\t\tmemcpy(&RetArray,&RetAxisArray,sizeof(Axis_Array));\n\t\t\t}\n");
+            }
+            else
             {
-                writer.write("\t\t\t/*not successful*/\n\t\t}\n");
-                writer.write("\t\t}\n");
-                writer.write("\tm_pCall->unInitialize();\n");
+                containedType = qname.getLocalPart();
+                writer.write("\t\t\t\tAxis_Array RetAxisArray = "
+                        + "m_pCall->getCmplxArray((void*) Axis_DeSerialize_"
+                        + containedType);
+                //damitha
+                writer.write(", (void*) Axis_Create_" + containedType
+                        + ", (void*) Axis_Delete_" + containedType
+                        + ", (void*) Axis_GetSize_" + containedType + ", \""
+                        + returntype.getParamName() + "\", Axis_URI_"
+                        + containedType + ");\n");
+                writer
+                        .write("\t\t\t\tmemcpy(&RetArray,&RetAxisArray,sizeof(Axis_Array));\n\t\t\t}\n");
             }
+            writer.write("\t\t}\n");
+            writer.write("\tm_pCall->unInitialize();\n");
+            //        writer.write("\t\t}\n\t\tm_pCall->unInitialize();\n");
+            writer.write("\t\treturn RetArray;\n");
+        }
+        else if (returntypeissimple)
+        {
+            writer.write("\t\t\t\tRet = m_pCall->"
+                    + CUtils.getParameterGetValueMethodName(outparamTypeName,
+                            false) + "(\"" + returntype.getParamName()
+                    + "\", 0);\n\t\t\t}\n");
+            writer.write("\t\t}\n");
+            writer.write("\tm_pCall->unInitialize();\n");
+            //            writer.write("\t\t}\n\t\tm_pCall->unInitialize();\n");
+            if (outparamTypeName.equals("xsd__string"))
+                writer.write("\t\treturn Ret;\n");
             else
-                if (returntypeisarray)
-                {
-                    QName qname = WrapperUtils.getArrayType(retType).getName();
-                    String containedType = null;
-                    if (CUtils.isSimpleType(qname))
-                    {
-                        containedType = CUtils.getclass4qname(qname);
-                        writer.write(
-                            "\t\t\t\tAxis_Array RetAxisArray = "
-                                + "m_pCall->getBasicArray("
-                                + CUtils.getXSDTypeForBasicType(containedType)
-                                + ", \""
-                                + returntype.getParamName()
-                                + "\", 0);\n");
-		            writer.write ("\t\t\t\tmemcpy(&RetArray,&RetAxisArray,sizeof(Axis_Array));\n\t\t\t}\n");
-                    }
-                    else
-                    {
-                        containedType = qname.getLocalPart();
-                        writer.write(
-                            "\t\t\t\tAxis_Array RetAxisArray = "
-                                + "m_pCall->getCmplxArray((void*) Axis_DeSerialize_"
-                                + containedType);
-                        //damitha
-                        writer.write(
-                            ", (void*) Axis_Create_"
-                                + containedType
-                                + ", (void*) Axis_Delete_"
-                                + containedType
-                                + ", (void*) Axis_GetSize_"
-                                + containedType
-                                + ", \""
-                                + returntype.getParamName()
-                                + "\", Axis_URI_"
-                                + containedType
-                                + ");\n");
-		            writer.write ("\t\t\t\tmemcpy(&RetArray,&RetAxisArray,sizeof(Axis_Array));\n\t\t\t}\n");
-                    }
-                    writer.write("\t\t}\n");
-                    writer.write("\tm_pCall->unInitialize();\n");
-                    //        writer.write("\t\t}\n\t\tm_pCall->unInitialize();\n");
-                    writer.write("\t\treturn RetArray;\n");
-                }
-                else
-                    if (returntypeissimple)
-                    {
-                        writer.write(
-                            "\t\t\t\tRet = m_pCall->"
-                                + CUtils.getParameterGetValueMethodName(
-                                    outparamTypeName,
-                                    false)
-                                + "(\""
-                                + returntype.getParamName()
-                                + "\", 0);\n\t\t\t}\n");
-                        writer.write("\t\t}\n");
-                        writer.write("\tm_pCall->unInitialize();\n");
-                        //            writer.write("\t\t}\n\t\tm_pCall->unInitialize();\n");
-			if (outparamTypeName.equals("xsd__string") ) 
-                        	writer.write("\t\treturn Ret;\n");
-			else
-                        {
-				writer.write("\t\t" + outparamTypeName + " r = *Ret;\n"); // make deep copy
-				writer.write("\t\tdelete Ret;\n");  // delete pointer
-                                writer.write("\t\treturn r;\n");
-                        }
-                    }
-                    else
-                    {
-                        outparamTypeName = returntype.getLangName();
-                        //need to have complex type name without *
-                        writer.write(
-                            "\t\t\t\tpReturn = ("
-                                + outparamTypeName
-                                + "*)m_pCall->getCmplxObject((void*) Axis_DeSerialize_"
-                                + outparamTypeName
-                                + ", (void*) Axis_Create_"
-                                + outparamTypeName
-                                + ", (void*) Axis_Delete_"
-                                + outparamTypeName
-                                + ",\""
-                                + returntype.getParamName()
-                                + "\", 0);\n\t\t}\n");
-                        writer.write("\t\t}\n");
-                        writer.write("\tm_pCall->unInitialize();\n");
-                        //            writer.write("\t\t}\n\t\tm_pCall->unInitialize();\n");
-                        writer.write("\t\treturn pReturn;\n");
+            {
+                writer.write("\t\t" + outparamTypeName + " r = *Ret;\n"); // make // This does not do a deep
+                                                                          // deep // copy! This will only copy 
+                                                                          // copy // pointers not content!
+                writer.write("\t\tdelete Ret;\n"); // delete pointer
+                writer.write("\t\treturn r;\n");
+            }
+        }
+        else
+        {
+            outparamTypeName = returntype.getLangName();
+            //need to have complex type name without *
+            writer.write("\t\t\t\tpReturn = (" + outparamTypeName
+                    + "*)m_pCall->getCmplxObject((void*) Axis_DeSerialize_"
+                    + outparamTypeName + ", (void*) Axis_Create_"
+                    + outparamTypeName + ", (void*) Axis_Delete_"
+                    + outparamTypeName + ",\"" + returntype.getParamName()
+                    + "\", 0);\n\t\t}\n");
+            writer.write("\t\t}\n");
+            writer.write("\tm_pCall->unInitialize();\n");
+            //            writer.write("\t\t}\n\t\tm_pCall->unInitialize();\n");
+            writer.write("\t\treturn pReturn;\n");
 
-                    }
-        //added by nithya		
+        }
+        //added by nithya
         writer.write("\t}\n");
         writer.write("\tcatch(AxisException& e)\n\t{\n");
         writer.write("\t\tint iExceptionCode = e.getExceptionCode();\n");
-        writer.write(
-            "\t\tif(AXISC_NODE_VALUE_MISMATCH_EXCEPTION != iExceptionCode)\n");
+        writer
+                .write("\t\tif(AXISC_NODE_VALUE_MISMATCH_EXCEPTION != iExceptionCode)\n");
         writer.write("\t\t{\n");
         writer.write("\t\t\tthrow SoapFaultException(e);\n");
         writer.write("\t\t}\n");
-        //ISoapFault* pSoapFault = (ISoapFault*) m_pCall->checkFault("Fault", "http://localhost/axis/MathOps");
+        //ISoapFault* pSoapFault = (ISoapFault*) m_pCall->checkFault("Fault",
+        // "http://localhost/axis/MathOps");
 
-        writer.write(
-            "\t\tISoapFault* pSoapFault = (ISoapFault*)\n");
+        writer.write("\t\tISoapFault* pSoapFault = (ISoapFault*)\n");
         writer.write("\t\t\tm_pCall->checkFault(\"Fault\",\""
-                + wscontext.getWrapInfo().getTargetEndpointURI()
-                + "\" );\n");
+                + wscontext.getWrapInfo().getTargetEndpointURI() + "\" );\n");
         writer.write("\t\tif(pSoapFault)\n");
         writer.write("\t\t{\n");
-        //writer.write("\t\t\tpcCmplxFaultName = pSoapFault->getCmplxFaultObjectName();\n");
-        //to get fault info  		    
+        //writer.write("\t\t\tpcCmplxFaultName =
+        // pSoapFault->getCmplxFaultObjectName();\n");
+        //to get fault info
         Iterator paramsFault = minfo.getFaultType().iterator();
         String faultInfoName = null;
         String faultType = null;
@@ -782,8 +712,8 @@
         else
         {
             flag = true;
-            writer.write(
-                "\t\t\tpcCmplxFaultName = pSoapFault->getCmplxFaultObjectName();\n");
+            writer
+                    .write("\t\t\tpcCmplxFaultName = pSoapFault->getCmplxFaultObjectName();\n");
         }
         while (paramsFault.hasNext())
         {
@@ -796,27 +726,20 @@
                 ParameterInfo par = (ParameterInfo) paramInfo.get(i);
                 paramName = par.getParamName();
                 langName = par.getLangName();
-                faultType =
-                    WrapperUtils.getClassNameFromParamInfoConsideringArrays(
-                        par,
-                        wscontext);
+                faultType = WrapperUtils
+                        .getClassNameFromParamInfoConsideringArrays(par,
+                                wscontext);
                 if (j > 1)
                 {
                     writer.write("\t\t\telse if");
-                    writeExceptions(
-                        faultType,
-                        faultInfoName,
-                        paramName,
-                        langName);
+                    writeExceptions(faultType, faultInfoName, paramName,
+                            langName);
                 }
                 else
                 {
                     writer.write("\t\t\tif");
-                    writeExceptions(
-                        faultType,
-                        faultInfoName,
-                        paramName,
-                        langName);
+                    writeExceptions(faultType, faultInfoName, paramName,
+                            langName);
                 }
             }
         }
@@ -835,47 +758,44 @@
         writer.write("\t}\n");
         writer.write("}\n");
     }
-    private void writeExceptions(
-        String faulttype,
-        String faultInfoName,
-        String paramName,
-        String langName)
-        throws WrapperFault
+
+    private void writeExceptions(String faulttype, String faultInfoName,
+            String paramName, String langName) throws WrapperFault
     {
         try
         {
-            writer.write(
-                "(0 == strcmp(\"" + faultInfoName + "\", pcCmplxFaultName))\n");
+            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(" + 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\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\tthrow *pFaultDetail;\n");
+            writer.write("\t\t\t\tthrow *pFaultDetail;\n");
             writer.write("\t\t\t}\n");
-        }
-        catch (IOException e)
+        } catch (IOException e)
         {
             throw new WrapperFault(e);
         }
     }
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.apache.axis.wsdl.wsdl2ws.cpp.CPPClassWriter#writeGlobalCodes()
      */
     protected void writeGlobalCodes() throws WrapperFault
@@ -900,34 +820,24 @@
             while (itr.hasNext())
             {
                 typeName = itr.next().toString();
-                writer.write(
-                    "extern int Axis_DeSerialize_"
-                        + typeName
-                        + "("
+                writer.write("extern int Axis_DeSerialize_" + typeName + "("
                         + typeName
                         + "* param, IWrapperSoapDeSerializer* pDZ);\n");
-                writer.write(
-                    "extern void* Axis_Create_"
-                        + typeName
-                        + "("
+                writer.write("extern void* Axis_Create_" + typeName + "("
                         + typeName
                         + " *Obj, bool bArray = false, int nSize=0);\n");
-                writer.write(
-                    "extern void Axis_Delete_"
-                        + typeName
-                        + "("
+                writer.write("extern void Axis_Delete_" + typeName + "("
                         + typeName
                         + "* param, bool bArray = false, int nSize=0);\n");
-                writer.write(
-                    "extern int Axis_Serialize_"
-                        + typeName
-                        + "("
-                        + typeName
-                        + "* param, IWrapperSoapSerializer* pSZ, bool bArray = false);\n");
+                writer
+                        .write("extern int Axis_Serialize_"
+                                + typeName
+                                + "("
+                                + typeName
+                                + "* param, IWrapperSoapSerializer* pSZ, bool bArray = false);\n");
                 writer.write("extern int Axis_GetSize_" + typeName + "();\n\n");
             }
-        }
-        catch (IOException e)
+        } catch (IOException e)
         {
             throw new WrapperFault(e);
         }

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java?rev=330584&r1=330583&r2=330584&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java Thu Nov  3 09:17:57 2005
@@ -1023,13 +1023,13 @@
                     {
                         writer.write("\t" + attribs[i].getTypeName() + " * "
                                 + attribs[i].getParamNameAsMember()
-                                + " = NULL;\n");
+                                + " = NULL;\n\n");
                         writer.write("\tif (("
                                 + attribs[i].getParamNameAsMember()
                                 + " = pIWSDZ->"
                                 + CUtils.getParameterGetValueMethodName(
                                         attribs[i].getTypeName(), attribs[i].isAttribute()) + "( \""
-                                + CUtils.sanitiseAttributeName( classname, soapTagName) + "\",0)) != NULL) {\n");
+                                + CUtils.sanitiseAttributeName( classname, soapTagName) + "\",0)) != NULL)\n\t{\n");
                         writer.write("\t\tparam->"
                                 + attribs[i].getParamNameAsMember() + " = *( "
                                 + attribs[i].getParamNameAsMember() + " );\n");
@@ -1041,7 +1041,7 @@
                         }
                         else
                         {
-                        	writer.write("\t\tdelete " + attribs[i].getParamNameAsMember() + ";\n");
+            				writer.write("\t\tAxis::AxisDelete( (void *) " + attribs[i].getParamNameAsMember() + ", " + CUtils.getXSDTypeForBasicType( attribs[i].getTypeName()) + ");\n");
                         	writer.write("\t}\n");
                         }                        	
                     }

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java?rev=330584&r1=330583&r2=330584&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java Thu Nov  3 09:17:57 2005
@@ -125,7 +125,8 @@
 			      + classname
 			      + CUtils.CPP_HEADER_SUFFIX + "\"\n\n");
 	    }
-	    writer.write ("#include <axis/AxisWrapperAPI.hpp>\n\n");
+	    writer.write ("#include <axis/AxisWrapperAPI.hpp>\n");
+	    writer.write ("#include <axis/Axis.hpp>\n\n");
 	}
 	catch (IOException e)
 	{
@@ -967,14 +968,46 @@
 		    {
 			if (returntype.isNillable ())
 			{
-			    writer.write ("\t\t\tRet = m_pCall->"
-					  +
-					  CUtils.
-					  getParameterGetValueMethodName
-					  (outparamType,
-					   false) + "(\"" +
-					  returntype.getParamName () +
-					  "\", 0);\n\t\t}\n");
+			    if( CUtils.isPointerType( outparamType))
+			    {
+				    writer.write( "\t\t\t" + outparamType + " pReturn = m_pCall->" + CUtils.getParameterGetValueMethodName( outparamType, false) + "(\"" + returntype.getParamName() + "\", 0);\n");
+			    }
+			    else
+			    {
+				    writer.write( "\t\t\t" + outparamType + " * pReturn = m_pCall->" + CUtils.getParameterGetValueMethodName( outparamType, false) + "(\"" + returntype.getParamName() + "\", 0);\n");
+			    }
+	            writer.write( "\n");
+                writer.write( "\t\t\tif( pReturn != NULL)\n");
+                writer.write( "\t\t\t{\n");
+				if( "xsd__base64Binary".equals( outparamType) ||
+					    "xsd__hexBinary".equals( outparamType))
+					{
+				    	writer.write( "\t\t\t\tRet = new " + outparamType + "();\n");
+					    writer.write ("\t\t\t\tif( pReturn->__ptr != NULL)\n");
+						writer.write ("\t\t\t\t{\n");
+						writer.write ("\t\t\t\t\tRet->__ptr = new xsd__unsignedByte [pReturn->__size + 1];\n");
+						writer.write ("\t\t\t\t\tRet->__size = pReturn->__size;\n");
+						writer.write ("\t\t\t\t\tmemcpy( Ret->__ptr, pReturn->__ptr, pReturn->__size);\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\tRet->__ptr = NULL;\n");
+						writer.write ("\t\t\t\t\tRet->__size = pReturn->__size;\n");
+						writer.write ("\t\t\t\t}\n");
+					}
+				    else if( "xsd__string".equals( outparamType))
+					{
+		                writer.write( "\t\t\t\tRet = new char[strlen( pReturn) + 1];\n");
+		                writer.write( "\t\t\t\tstrcpy( Ret, pReturn);\n");
+					}
+					else
+					{
+		                writer.write( "\t\t\t\tRet = new " + outparamType + "();\n");
+		                writer.write( "\t\t\t\t*Ret = *pReturn;\n");
+					}
+				writer.write( "\t\t\t\tAxis::AxisDelete( (void *) pReturn, " + CUtils.getXSDTypeForBasicType( outparamType) + ");\n");
+                writer.write( "\t\t\t}\n");
+                writer.write( "\t\t}\n");
 			}
 			else
 			{
@@ -989,7 +1022,11 @@
 					      returntype.getParamName () +
 					      "\", 0);\n");
 				writer.write ("\t\t\tif(pReturn)\n");
-				writer.write ("\t\t\t\tRet = pReturn;\n");
+				writer.write ("\t\t\t{\n");
+				writer.write ("\t\t\t\tRet = new char[strlen( pReturn) + 1];\n");
+				writer.write ("\t\t\t\tstrcpy( Ret, pReturn);\n");
+				writer.write ("\t\t\t\tAxis::AxisDelete( pReturn, XSD_STRING);\n");
+				writer.write ("\t\t\t}\n");
 			    }
 			    else
 			    {
@@ -1003,8 +1040,32 @@
 					      "\", 0);\n");
 				writer.write ("\t\t\tif(pReturn)\n");
 				writer.write ("\t\t\t{\n");
-				writer.write ("\t\t\t\tRet = *pReturn;\n");
-				writer.write ("\t\t\t\tdelete pReturn;\n");
+				
+				if( "xsd__base64Binary".equals( outparamType) ||
+				    "xsd__hexBinary".equals( outparamType))
+				{
+				    writer.write ("\t\t\t\tif( pReturn->__ptr != NULL)\n");
+					writer.write ("\t\t\t\t{\n");
+					writer.write ("\t\t\t\t\tRet.__ptr = new xsd__unsignedByte [pReturn->__size + 1];\n");
+					writer.write ("\t\t\t\t\tRet.__size = pReturn->__size;\n");
+					writer.write ("\t\t\t\t\tmemcpy( Ret.__ptr, pReturn->__ptr, pReturn->__size);\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\tRet.__ptr = NULL;\n");
+					writer.write ("\t\t\t\t\tRet.__size = pReturn->__size;\n");
+					writer.write ("\t\t\t\t}\n");
+				}
+			    else if( CUtils.isPointerType( outparamType))
+				{
+				    writer.write ("\t\t\t\tRet = *pReturn;\n");
+				}
+				else
+				{
+				    writer.write ("\t\t\t\tRet = *pReturn;\n");
+				}
+
+				writer.write ("\t\t\t\tAxis::AxisDelete( (void *) pReturn, " + CUtils.getXSDTypeForBasicType( outparamType) + ");\n");
 				writer.write ("\t\t\t}\n");
 			    }
 			    // TODO If we unexpectedly receive a nill value, when nillable="false" we should do something appropriate, perhaps as below:

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParamCPPFileWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParamCPPFileWriter.java?rev=330584&r1=330583&r2=330584&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParamCPPFileWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParamCPPFileWriter.java Thu Nov  3 09:17:57 2005
@@ -111,7 +111,8 @@
     {
         try
         {
-            writer.write("#include <axis/AxisWrapperAPI.hpp>\n\n");
+            writer.write("#include <axis/AxisWrapperAPI.hpp>\n");
+            writer.write("#include <axis/Axis.hpp>\n\n");
             writer.write(
                 "#include \""
                     + this.classname



Mime
View raw message