tracker issue : CF-4198050

select a category, or use search below
(searches all categories and all time range)
Title:

Empty queries on Axis 2 comes back as a QueryBean object instead of empty query

| View in Tracker

Status/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:

Extra info: Invoking the webservice method in the browser via http://localhost/myConponent.cfc?method=myFunction will return the following wddx packet in the html: <wddxpacket version="1.0"><header><data><recordset rowcount="0" fieldnames="FIELD1,FIELD2,FIELD3" type="coldfusion.sql.QueryTable"><field name="FIELD1"></field><field name="FIELD2"></field><field name="FIELD3"></field></recordset></data></header></wddxpacket>
Comment by External U.
1458 | November 23, 2016 11:33:18 PM GMT
Geoffrey, This will be fixed in upcoming update of Coldfusion11.
Comment by Poonam J.
1459 | November 24, 2016 11:27:30 PM GMT
Awesome, thanks
Comment by External U.
1460 | November 25, 2016 12:25:58 AM GMT
Thanks. Closing this track.
Comment by Poonam J.
1461 | November 25, 2016 01:23:30 AM GMT