You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by na...@apache.org on 2005/07/03 05:37:52 UTC

cvs commit: ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal ClientStubWriter.java

nadiramra    2005/07/02 20:37:52

  Modified:    c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal
                        ClientStubWriter.java
  Log:
  Make c stubs consistent with C++ flow.
  
  Revision  Changes    Path
  1.35      +57 -56    ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java
  
  Index: ClientStubWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- ClientStubWriter.java	30 Jun 2005 10:24:25 -0000	1.34
  +++ ClientStubWriter.java	3 Jul 2005 03:37:52 -0000	1.35
  @@ -249,62 +249,62 @@
                   writer.write(outparamType + " RetArray = {NULL, 0};\n");
               }
               else
  -	    {
  -		if (!returntypeissimple)
  -		{		//for AnyType too
  -		    if (outparamType.lastIndexOf ("*") > 0)
  -		    {
  -			writer.write (outparamType + " pReturn = NULL;\n");
  -		    }
  -		    else
  -			writer.write (outparamType + "* pReturn = NULL;\n");
  -		    //for complex types
  -		}
  -		else
  -		{
  -		    //for simple types
  -		    if (returntype.isNillable ()
  -			&& !(CUtils.isPointerType(outparamType)))
  -		    {
  -			writer.write (outparamType + "* Ret = NULL;\n");
  -		    }
  -		    else
  -		    {
  -			String initValue = CUtils.getInitValue (outparamType);
  -			if (initValue != null)
  -			{
  -			    writer.write (outparamType + " Ret = " +
  -					  initValue + ";\n");
  -			}
  -			else
  -			{
  -			    if (outparamType.equals ("xsd__base64Binary")
  -				|| outparamType.equals ("xsd__hexBinary"))
  -			    {
  -				writer.write (outparamType + " Ret;\n");
  -				writer.write ("\tRet.__ptr = NULL;\n");
  -				writer.write ("\tRet.__size = 0;\n");
  -			    }
  -			    else
  -			    {
  -				if (outparamType.equals ("xsd__dateTime")
  -				    || outparamType.equals ("xsd__date")
  -				    || outparamType.equals ("xsd__time"))
  -				{
  -				    writer.write (outparamType + " Ret;\n");
  -				    writer.write ("\tmemset(&Ret,0,sizeof(" +
  -						  outparamType + "));\n");
  -				}
  -				else
  -				{
  -				    writer.write (outparamType + " Ret;\n");
  -				}
  -			    }
  -			}
  -		    }
  -		}
  -		//TODO initialize return parameter appropriately.
  -	    }
  +            {
  +               if (!returntypeissimple)
  +               {		//for AnyType too
  +                  if (outparamType.lastIndexOf ("*") > 0)
  +                  {
  +                     writer.write (outparamType + " pReturn = NULL;\n");
  +                  }
  +                  else
  +                     writer.write (outparamType + "* pReturn = NULL;\n");
  +                  //for complex types
  +               }
  +               else
  +               {
  +                  //for simple types
  +                  if (returntype.isNillable ()
  +                        && !(CUtils.isPointerType(outparamType)))
  +                  {
  +                     writer.write (outparamType + "* Ret = NULL;\n");
  +                  }
  +                  else
  +                  {
  +                     String initValue = CUtils.getInitValue (outparamType);
  +                     if (initValue != null)
  +                     {
  +                        writer.write (outparamType + " Ret = " +
  +                                      initValue + ";\n");
  +                     }
  +                     else
  +                     {
  +                        if (outparamType.equals ("xsd__base64Binary")
  +                              || outparamType.equals ("xsd__hexBinary"))
  +                        {
  +                           writer.write (outparamType + " Ret;\n");
  +                           writer.write ("\tRet.__ptr = NULL;\n");
  +                           writer.write ("\tRet.__size = 0;\n");
  +                        }
  +                        else
  +                        {
  +                           if (outparamType.equals ("xsd__dateTime")
  +                                 || outparamType.equals ("xsd__date")
  +                                 || outparamType.equals ("xsd__time"))
  +                           {
  +                              writer.write (outparamType + " Ret;\n");
  +                              writer.write ("\tmemset(&Ret,0,sizeof(" +
  +                                            outparamType + "));\n");
  +                           }
  +                           else
  +                           {
  +                              writer.write (outparamType + " Ret;\n");
  +                           }
  +                        }
  +                     }
  +                  }
  +               }
  +               //TODO initialize return parameter appropriately.
  +            }
           }
           writer.write ("\tconst char* pcCmplxFaultName;\n");
           writer.write ("\tpcCmplxFaultName = NULL;\n");
  @@ -346,6 +346,7 @@
   
   
           // TODO new calls from stub base
  +    	writer.write ("\taxiscApplyUserPreferences(stub);\n");
             
           for (int i = 0; i < paramsB.size(); i++)
           {