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 "James Jose (JIRA)" <ax...@ws.apache.org> on 2005/03/14 14:28:08 UTC

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

Problem in getAnyObject() API in Call class
-------------------------------------------

         Key: AXISCPP-547
         URL: http://issues.apache.org/jira/browse/AXISCPP-547
     Project: Axis-C++
        Type: Bug
    Reporter: James Jose


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


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

Posted by "Mark Whitlock (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-547?page=history ]

Mark Whitlock reassigned AXISCPP-547:
-------------------------------------

    Assign To: Mark Whitlock

> 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


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

Posted by "John Hawkins (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-547?page=history ]

John Hawkins updated AXISCPP-547:
---------------------------------

    Priority: Minor  (was: Major)

> 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
>     Priority: Minor

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


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

Posted by "James Jose (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-547?page=comments#action_61076 ]
     
James Jose commented on AXISCPP-547:
------------------------------------

In the testcase I used getAnyobject() 3 times to test the behaviour of this API when there is no data to return.

I feel if there is no data to return, then API should return "NULL".

Calling checkMessage() after getAnyobject() results in AxisException is fine. Currently e.what() returning an empty string.

it's good if e.what() gives some error message.

> 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


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

Posted by "Mark Whitlock (JIRA)" <ax...@ws.apache.org>.
     [ 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


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

Posted by "John Hawkins (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-547?page=history ]

John Hawkins updated AXISCPP-547:
---------------------------------

    Component: Client - Stub

> 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

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


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

Posted by "Fred Preston (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-547?page=all ]

Fred Preston updated AXISCPP-547:
---------------------------------

    Assign To:     (was: Mark Whitlock)

> 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
>     Priority: Minor

>
> 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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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

Posted by "nadir amra (JIRA)" <ax...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/AXISCPP-547?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

nadir amra closed AXISCPP-547.
------------------------------

       Resolution: Fixed
    Fix Version/s: current (nightly)

If getAnyObject() is called before checkMessage() API, one gets:

AxisSoapException: Cannot deserialize the requested element. 

If getAnyObject() any other time, you will get something, either an exception or whitespace or an AnyType with nothing in it. 

So I cannot recreate the problem with the latest code.

> Problem in getAnyObject() API in Call class
> -------------------------------------------
>
>                 Key: AXISCPP-547
>                 URL: https://issues.apache.org/jira/browse/AXISCPP-547
>             Project: Axis-C++
>          Issue Type: Bug
>          Components: Client - Stub
>            Reporter: James Jose
>            Priority: Minor
>             Fix For: current (nightly)
>
>
> 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.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org