Title:
Empty queries on Axis 2 comes back as a QueryBean object instead of empty query
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Geoffrey Demoulin / Geoffrey Demoulin (Geoffrey Demoulin)
Created: 11/23/2016
Components: Web Services
Versions: 11.0
Failure Type: Crash
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Critical / All users will encounter
Locale/System: English / Windows 10 64 bit
Vote Count: 0
Problem Description:
Bug 3948955 is still not fixed as of CF11u10.
Steps to Reproduce:
1/ Set the web service version to axis2 (coldfusion web service version 2) in cf admin.
2/ Create a component with a remote method that returns an _EMPTY_ query generated by the result of a cfquery on a DB. This is important, do not do a "return querynew("");".
3/ Register the webservice in the administrator (Let's say http://localhost/myConponent.cfc?wsdl)
4/ Create a web service consumer page using something like:
var myWebservice = CreateObject("webservice", "myWebservice"); // mwWebservice is configured in the admin, pointing to http://localhost/myConponent.cfc?wsdl
var myResultQry = myWebservice.myFunction();
queryExecute(
"select
*
from myResultQry ",
{},
{dbtype = "query"}
);
Actual Result:
Exception:
Error casting an object of type coldfusion.xml.rpc.xsd.QueryBean cannot be cast to coldfusion.sql.QueryTable to an incompatible type. This usually indicates a programming error in Java, although it could also mean you have tried to use a foreign object in a different way than it was designed.
coldfusion.xml.rpc.xsd.QueryBean cannot be cast to coldfusion.sql.QueryTable
Dumping the variable displays: "object of coldfusion.xml.rpc.xsd.QueryBean"
Expected Result:
No exception and an empty query object.
Any Workarounds:
As mentionned in 3948955: Not elegant, but we can check to see if the item is an object and assume it is an empty query result ... qResult = isObject(qFunc(id=0)) ? querynew("") : qFunc(id=0);
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4198050
External Customer Info:
External Company:
External Customer Name: Geoffrey Demoulin
External Customer Email:
External Test Config: My Hardware and Environment details:
Windows 2012R2 64bit / Windows 10 pro 64bit
CF 11 standard update 10 / CF 11 developer update 10
Firefox 51 (dev edition) and chrome 54.0.2840.99 m (64-bit)
Attachments:
Comments: