Skip to main content
Inspiring
December 2, 2011
Question

Using Web Service to populate a CFSELECT

  • December 2, 2011
  • 2 replies
  • 1717 views

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.

This topic has been closed for replies.

2 replies

BKBK
Community Expert
Community Expert
December 3, 2011

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.

Community Expert
December 2, 2011

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

Dave Watts, Eidolon LLC
Inspiring
December 3, 2011

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.

Community Expert
December 3, 2011

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

Dave Watts, Eidolon LLC