Uploaded image for project: 'Axis-C++'
  1. Axis-C++
  2. AXISCPP-968

WSDL2WS generate wrong code: complex array should not been deleted

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.6 Beta
    • current (nightly)
    • WSDL processing - RPC
    • None

    Description

      [Error Statement]:
      I have used AxisCPP1.6Beta version to generate TestWrapper.cpp like the below:
      TestWrapper.cpp :
      int TestWrapper::OperationTest(void* pTestMsg)
      {
      ... ...
      MailBoxInformation_Array out0;
      ... ...
      try
      {
      pWs->GetMailBox(v0,v1,v2,&out0,&out1);
      pIWSSZ->addOutputCmplxArrayParam((Axis_Array*)(&out0),(void*) Axis_Serialize_MailBoxInformation, (void*) Axis_Delete_MailBoxInformation, (void*) Axis_GetSize_MailBoxInformation, ">GetMailBoxResponse>MailBox", Axis_URI_MailBoxInformation);
      delete out0;
      ... ...
      }

      From the generated code, out0 is really a complex array, which is a new addressing/accessing method introduced from axis-c-1.6 and be used elsewhere.
      The complex array it-self is an object, not simple memory block, so should not been deleted directly by delete.
      In deed it will been released after out of stack automatically, I think.

      [solution]:
      I have investigated the source code of AxisCPP/WSDL2Ws tool, and found that if I modify the following code at about line 781~801 in writeMethodInWrapper method that belongs to WrapWriter (wsdl2ws/cpp/iteral) class, the generated code will become correct.
      else

      { containedType = qname.getLocalPart(); writer.write( "\tpIWSSZ->addOutputCmplxArrayParam((Axis_Array*)(&out" + i + ")," + "(void*) Axis_Serialize_" + containedType + ", (void*) Axis_Delete_" + containedType + ", (void*) Axis_GetSize_" + containedType + ", \"" + returnParamName + "\", Axis_URI_" + containedType + ");\n"); //<mxiong debug 2006/4/25 // writer.write("\tdelete out" + i + ";\n"); //>mxiong debug 2006/4/25 }

      }

      So I think it maybe a bug, could you like to check it ?

      Attachments

        Activity

          People

            Unassigned Unassigned
            mxiong Michael Xiong
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: