[ 
http://issues.apache.org/jira/browse/AXISCPP-477?page=comments#action_61370 ]
     
Fred Preston commented on AXISCPP-477:
--------------------------------------

Hi Mark,
Ok, so the problem is in the generated stub, i.e.
catch(AxisException& e)
{
  int iExceptionCode = e.getExceptionCode();
  if(AXISC_NODE_VALUE_MISMATCH_EXCEPTION != iExceptionCode)
  {
########## This throw is not preceeded by a
########## call to m_pCall->unInitialize()
    throw;
  }
  ISoapFault* pSoapFault = (ISoapFault*)
                        
m_pCall->checkFault("Fault","http://localhost/axis/MathOps"; );
  if(pSoapFault)
  {
    pcCmplxFaultName = pSoapFault->getCmplxFaultObjectName();
    if(0 == strcmp("DivByZeroStruct", pcCmplxFaultName))
    {
      DivByZeroStruct* pFaultDetail = 
(DivByZeroStruct*)pSoapFault->getCmplxFaultObject(
      (void*) Axis_DeSerialize_DivByZeroStruct,
      (void*) Axis_Create_DivByZeroStruct,
      (void*) Axis_Delete_DivByZeroStruct,
      "DivByZeroStruct",
      0);

      pFaultDetail->setFaultCode(pSoapFault->getFaultcode());
      pFaultDetail->setFaultString(pSoapFault->getFaultstring());
      pFaultDetail->setFaultActor(pSoapFault->getFaultactor());
      pFaultDetail->setExceptionCode(e.getExceptionCode());
      m_pCall->unInitialize();
      throw *pFaultDetail;
    }
    else if(0 == strcmp("SpecialDetailStruct", pcCmplxFaultName))
    {
      SpecialDetailStruct* pFaultDetail = 
      (SpecialDetailStruct*)pSoapFault->getCmplxFaultObject( (void*) 
Axis_DeSerialize_SpecialDetailStruct,
(void*) Axis_Create_SpecialDetailStruct,
(void*) Axis_Delete_SpecialDetailStruct,
"SpecialDetailStruct",  0);
pFaultDetail->setFaultCode(pSoapFault->getFaultcode());
pFaultDetail->setFaultString(pSoapFault->getFaultstring());
pFaultDetail->setFaultActor(pSoapFault->getFaultactor());
pFaultDetail->setExceptionCode(e.getExceptionCode());
m_pCall->unInitialize();
throw *pFaultDetail;
    }
    else if(0 == strcmp("OutOfBoundStruct", pcCmplxFaultName))
    {
      OutOfBoundStruct* pFaultDetail = 
(OutOfBoundStruct*)pSoapFault->getCmplxFaultObject( (void*) 
Axis_DeSerialize_OutOfBoundStruct, (void*) Axis_Create_OutOfBoundStruct, 
(void*) Axis_Delete_OutOfBoundStruct, "OutOfBoundStruct", 0);

      pFaultDetail->setFaultCode(pSoapFault->getFaultcode());
      pFaultDetail->setFaultString(pSoapFault->getFaultstring());
      pFaultDetail->setFaultActor(pSoapFault->getFaultactor());
      pFaultDetail->setExceptionCode(e.getExceptionCode());
      m_pCall->unInitialize();
      throw *pFaultDetail;
    }
    else
    {
      const char *detail = pSoapFault->getSimpleFaultDetail();
      bool deleteDetail=false;
      if (NULL==detail || 0==strlen(detail))
      {
        detail=m_pCall->getFaultAsXMLString();
        if (NULL==detail)
          detail="";
        else
          deleteDetail=true;
      }
      OtherFaultException ofe(pSoapFault->getFaultcode(), 
pSoapFault->getFaultstring(), pSoapFault->getFaultactor(), detail, 
iExceptionCode);
      if (deleteDetail && NULL!=detail)
        delete [] const_cast<char*>(detail);
      m_pCall->unInitialize();
      throw ofe;
    }
  }
  else
########## This throw is not preceeded by a
########## call to m_pCall->unInitialize()
    throw;
}

There are two 'throw' commands that are not preceeded by the a call to 
m_pCall->unInitialize().  Also, if the response message is correct and there is 
no exception, then there is also no call to m_pCall->unInitialize().  I will 
fix the calls before the throw command, but will not add the uninitialise call 
when the response is valid as there might be problems.


> Inconsistent call::uninitialize when throwing faults from stubs
> ---------------------------------------------------------------
>
>          Key: AXISCPP-477
>          URL: http://issues.apache.org/jira/browse/AXISCPP-477
>      Project: Axis-C++
>         Type: Bug
>   Components: Client - Stub
>     Reporter: Mark Whitlock
>     Assignee: Fred Preston

>
> When the generated stub catches AxisException (in FaultMappingTest for 
> example) it throws exceptions back to the client application. Sometimes it 
> calls Call::uninitialize before it throws the exception back and sometimes it 
> doesn't. This looks wrong to me. Surely the call object should always be 
> uninitialized before any exception is thrown back to the client application. 
> This may not be a simple fix since uninitializing the call object may cause 
> problems at termination when throwing some exceptions back.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira

Reply via email to