Skip navigation
Currently Being Moderated

Using Web Service to populate a CFSELECT

Dec 2, 2011 12:35 PM

I have a WSDL and that I use to grab employee information. I want to query the WSDL to get a complete list of staff and display the names

in a CF dropdown, with the emplID as the value. I've tried a few variations on this

 

<cfinvoke

webservice="path-to.wsdl"

method="getStaffList"

returnvariable="getStaff"

<cfinvokeargument name = "distID" value="2" />

<cfinvokeargument name = "somePage" value="1" />

</cfinvoke>

 

<cfselect name="staff"

query="getStaff"

and so on

</cfselect>

 

This, and the variations on it, returns this error.

 

"The value of the attribute Query, which is currently getStaff, is invalid."

 

I've done a fair amount of searching using terms like these "coldfusion cfinvoke cfselect" and haven't come up

with anything that works. What I tried above came from one such online suggestion.

 

I can use the WSDL in an array that populates table rows by looping through the WSDL, but I'd rather have the results in a CFSELECT for an administrative

panel where the user can choose a name, click SUBMIT, which would send the emplID value to an action page which would

display drill-down information in a table.

 
Replies
  • Dave Watts
    747 posts
    Mar 11, 2003
    Currently Being Moderated
    Dec 2, 2011 12:45 PM   in reply to sbudlong

    Web services generally don't return queries. What kind of object is getStaff? You can use CFDUMP to find this out. Chances are, it's an array, and you can use a function from cflib.org to convert arrays to queries, I suspect (or just write that code yourself).

     

    Dave Watts, CTO, Fig Leaf Software

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 2, 2011 5:42 PM   in reply to Dave Watts

    Hi, Dave!

     

    Thank you for your very helpful suggestion. I'm on cflib.org right now and see that there are all kinds of col UDFs.

    This is a good site to explore.

     

    As for your question about what kind of object getStaff is, I'm home and can't look at the app now,

    but getStaff is in the cfinvoke and I just repeated it in the cfselect.


    I feel as though you are correct, that a cfinvoke has to go through some kind of intermediate

    step before it can be called in a cfselect. That seems to make sense, at least to me.

     
    |
    Mark as:
  • Dave Watts
    747 posts
    Mar 11, 2003
    Currently Being Moderated
    Dec 2, 2011 9:40 PM   in reply to waterunderthebridge

    As for your question about what kind of object getStaff is, I'm home and can't look at the app now,

    but getStaff is in the cfinvoke and I just repeated it in the cfselect.

     

    Unless the web service is also written in CF (and often, even if it is), it won't return a query object, because there's no standard way to define a query object in SOAP.

     

    Dave Watts, CTO, Fig Leaf Software

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 3, 2011 2:12 AM   in reply to sbudlong

    sbudlong wrote:

     

    I have a WSDL and that I use to grab employee information. I want to query the WSDL to get a complete list of staff and display the names

    in a CF dropdown, with the emplID as the value. I've tried a few variations on this

     

    <cfinvoke

    webservice="path-to.wsdl"

    method="getStaffList"

    returnvariable="getStaff"

    <cfinvokeargument name = "distID" value="2" />

    <cfinvokeargument name = "somePage" value="1" />

    </cfinvoke>

     

    WSDLs never return queries or result-sets. The return-type of getStaff will likely be an XML document or some such standard web service complex-type. That is what you will have to parse to get the employee information.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 3, 2011 6:52 AM   in reply to Dave Watts

    OK, Dave. Thank you. You've answered my question. I'll stick with the

    database query that I used before I discovered this Web Service. I can

    still use the Web Service to display relevant employee information using

    the emplID I get from the Oracle query.

     

    Thank you! Now I'm going to explore that cflib.org site that you suggested.

    Looks good! Have a great weekend!

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 3, 2011 6:59 AM   in reply to Dave Watts

    Dave, how can I mark one of your replies as Answer? I think I've done that before in a forum.

     
    |
    Mark as:
  • Dave Watts
    747 posts
    Mar 11, 2003
    Currently Being Moderated
    Dec 3, 2011 9:15 AM   in reply to waterunderthebridge

    I'm sorry, but I don't know how to do that. I don't see a button or option to do that, so presumably it's only available to the person who starts the discussion.

     

    Dave Watts, CTO, Fig Leaf Software

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 3, 2011 9:21 AM   in reply to Dave Watts

    I started the discussion, and I can remember in the past being able to end

    it by marking a reply as the answer. Thank you for your reply. I'll look

    into it a bit more and see what I can do.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 3, 2011 11:12 AM   in reply to waterunderthebridge

    waterunderthebridge wrote:

     

    I started the discussion, and I can remember in the past being able to end

    it by marking a reply as the answer.

    That is still possible, by means of your other (Sbudlong) account.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points