• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Using Web Service to populate a CFSELECT

Participant ,
Dec 02, 2011 Dec 02, 2011

Copy link to clipboard

Copied

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.

TOPICS
Advanced techniques

Views

1.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 02, 2011 Dec 02, 2011

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 02, 2011 Dec 02, 2011

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 02, 2011 Dec 02, 2011

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 03, 2011 Dec 03, 2011

Copy link to clipboard

Copied

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 03, 2011 Dec 03, 2011

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 03, 2011 Dec 03, 2011

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 03, 2011 Dec 03, 2011

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 03, 2011 Dec 03, 2011

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 03, 2011 Dec 03, 2011

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation