You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Mark Whitlock (JIRA)" <ax...@ws.apache.org> on 2005/03/16 19:36:20 UTC

[jira] Commented: (AXISCPP-547) Problem in getAnyObject() API in Call class

     [ http://issues.apache.org/jira/browse/AXISCPP-547?page=comments#action_60991 ]
     
Mark Whitlock commented on AXISCPP-547:
---------------------------------------

I investigated these two problems. I believe these are both application errors - the testcase is doing something invalid which causes Axis to throw the wrong exception. Testcases that test application errors like this are good tests, but if Axis does the wrong thing, they are low priority bugs to fix.

For the first problem, I changed the testcase to make it more obvious what was happening...
if(AXIS_SUCCESS == m_pCall->checkMessage("divResponse", "http://localhost/axis/Calculator"))
{
        for (int i=0; i<5; i++) 
	{
		cout << "i=" << i << endl;
		any = m_pCall->getAnyObject();
		if(any!=NULL){
			cout << "size=" << any->_size<<endl;
			for (int j=0; j<any->_size; j++)
				cout << "j=" << j << " " << any->_array[j] << endl;
		}
	}

and I got this output

0
i=0
size=1
j=0 <divReturn>5</divReturn>
i=1
size=1
j=0 </divResponse></soapenv:Body>
i=2
Unspecified exception has occured

This shows that the Call::getAnyObject is reading off of the end of the soap message. Call::getAnyObject should not sigsegv in this situation so it is a bug in Axis. However the application should not issue getAnyObject this many times since there is no more data to return after the </soapenv:Body>

In the second problem, Call::checkMessage must be called before Call::getAnyObject because Call::checkMessage steps over the start of the response message. Calling getAnyObject before checkMessage is an application error, but a valid test. 

Discussing this with John Hawkins, he suggested that the parts of these tests that fail due to Axis handling an application error badly should be moved to a separate test and these tests put in a separate test list. This test list of "application error" tests would not be run regularly and could be fixed at a later date. The parts of the tests that do not test application errors could be kept in the main test list. What do you think?

> Problem in getAnyObject() API in Call class
> -------------------------------------------
>
>          Key: AXISCPP-547
>          URL: http://issues.apache.org/jira/browse/AXISCPP-547
>      Project: Axis-C++
>         Type: Bug
>   Components: Client - Stub
>     Reporter: James Jose
>     Assignee: Mark Whitlock

>
> 1. Calling getAnyObject() results in an unhandled exception if there is no data to return. API should return NULL,if there is no data to return.
> 2. if getAnyObject() is called before checkMessage() API, then AxisException. 
>      try{
> 	if (AXIS_SUCCESS == m_pCall->invoke())
> 	{
> 		any = (AnyType*)m_pCall->getAnyObject();
> 		if(AXIS_SUCCESS == m_pCall->checkMessage("divResponse", "http://localhost/axis/Calculator"))
> 		{
> 			Ret = *(m_pCall->getElementAsInt("divReturn", 0));			
> 		}
> 	}
>      }Catch(Exception &e){
>           cout<<e.what();
>      }
>  Here e.what() returns an empty string.It should display some error message.

-- 
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