3 Replies Latest reply on Mar 7, 2017 11:42 PM by BKBK

    Why is my Object() showing as Object()()?

    snmmi

      I need to move a web service from an old ColdFusion 8 server (running from SQL 2005) to a new ColdFusion 2016 (running from SQL 2016).

      The web service is just a basic .CFC file which is coded like this:

      <cfcomponent output="false">
         <cffunction
      name="getinfo" returntype="query" output="no" access="remote">
            <cfargument name="variable1" type="string">
            <cfargument name="variable2" type="string">
            <cfargument name="variable3" type="string"> 
           
            <cfquery
      name="qryName" datasource="database_name"> select columns from table
            </cfquery> 

            <cfreturn qryName>
         </cffunction>
      </cfcomponent>

      My vendor using the web service is receiving this error:

      Unable to generate a temporary class (result=1). error CS0266: Cannot implicitly convert type 'object' to 'object[]'

      The issue appears to be that ColdFusion 8 service was showing:

      data() As Object()

      But the new ColdFusion 2016 is showing:

      data() As Object()()

      I don't have a clue as to where ColdFusion is even setting the Object as I thought everything was contained within the .CFC file. I'm not very advanced with ColdFusion, so any help is appreciated.

      Any idea why the extra () is showing up on the Object()? How would I go about investigating this?

      Note: The ColdFusion 8 server had a fully in-house coded website on it with an Application.cfm file, etc. which I did not copy to the ColdFusion 2016 server. If I need to look at the old setup, which files should I be looking for?

        • 1. Re: Why is my Object() showing as Object()()?
          BKBK Adobe Community Professional & MVP

          1) Is it possible for you to open the WSDL in the browser? That is, http://URL_to_webservice_CFC?wsdl

           

          If you get the WSDL, as expected, then you will see that it defines the complexType, QueryBean. That is what ColdFusion's web service converts the query to. You could then experiment by changing returntype="query" to returntype="any".

           

          2) Your CFC code example doesn't seem to be a faithful reproduction of the actual code. It contains 3 arguments which are never used.

           

          In any case, what happens when you run the query in a CFM page? That is, what do you get when you run this:

           

               <cfquery name="qryName" datasource="database_name">

                    select columns from table
                </cfquery> 
                <cfdump var="#qryName#">

          • 2. Re: Why is my Object() showing as Object()()?
            snmmi Level 1

            When I investigated further, I found the issue was simply I needed to change the web service version from 2 to 1.  Then the WSDL was formatted the same as the old server.

             

            Thank you for taking time to respond.

            • 3. Re: Why is my Object() showing as Object()()?
              BKBK Adobe Community Professional & MVP

              Thanks for sharing that. Please mark your answer as correct. It will certainly help someone else in future, as this is the kind of issue that others will face.

               

              Please report the issue as a bug. We expected the error message to say something about the webservice version.