Adobe Dreamweaver Forums



Last 10 THreads :         problems linking PDFs (Last Post : Alan - Replies : 1 - Views : 2 )           »          Changing RadioButton Label (Last Post : justintoflex - Replies : 2 - Views : 5 )           »          Table Borders MIssing in JavaHelp (Last Post : soxmann - Replies : 3 - Views : 8 )           »          Clock .getUTC not working (Last Post : bolszo - Replies : 2 - Views : 3 )           »          cfimage error (Last Post : masoud_amen - Replies : 2 - Views : 3 )           »          Dragging components (Last Post : hsfrey - Replies : 2 - Views : 4 )           »          Is file too large? (Last Post : tweaked_eye - Replies : 0 - Views : 1 )           »          Could not find the included template (Last Post : azuro28 - Replies : 2 - Views : 3 )           »          flash loader reappears after movie plays (Last Post : lyshamo - Replies : 3 - Views : 4 )           »          How to turn IMAGE into MOVIECLIP??? (Last Post : Snufferson - Replies : 7 - Views : 8 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 11-21-2008, 05:24 PM
projectproofing
 
Posts: n/a
Diggs:
Default Flex and ColdFusion web services

I have a simple CFC created that encompasses a function that has a query. I
want to be able to use the web service in my Flex app, but I am having issues
with getting the information from the CFC.

My function is simple:
<cffunction name="listBySubject" access="remote" returntype="query"
output="false" hint="I grab the newest stories">
<cfargument name="subject" type="string" required="yes">
<cfquery name="list" datasource="#myDataSource#">
SELECT linktext, story, photo
FROM pressreleases
WHERE rss_feed = <cfqueryparam value="#arguments.subject#" />
OR rss_feed2 = <cfqueryparam value="#arguments.subject#" />
ORDER BY releaseDate DESC
</cfquery>
<cfreturn list>
</cffunction>

How can I modify that to use in a Flex app's <mx:WebService>? Do I have to use
cfsavecontent and return XML or can I keep it a query and use it with an
ArrayCollection?

Something like:
<cffunction name="listBySubject" access="remote" returntype="xml"
output="false" hint="I grab the newest stories">
<cfargument name="subject" type="string" required="yes">
<cfquery name="list" datasource="prmc-media">
SELECT linktext, story, photo
FROM pressreleases
WHERE rss_feed = <cfqueryparam value="#arguments.subject#" />
OR rss_feed2 = <cfqueryparam value="#arguments.subject#" />
ORDER BY releaseDate DESC
</cfquery>

<cfsavecontent variable="storyList">
<magStories>
<cfoutput query="list">
<magStory id="#ISBN#">
<linkURL>#XMLFormat(linkURL)#</booktitle>
<story>#XMLFormat(story)#</teaser>
<photo>#XMLFormat(photo)#</price>
</magStory>
</cfoutput>
</magStories>
</cfsavecontent>

<cfreturn storyList>
</cffunction>

Locally I can use RemoteObject all day with the way it is normally, but since
UofMichigan has BlueDragon, I am forced to convert my apps to WebServices.



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-21-2008, 08:03 PM
jfb00
 
Posts: n/a
Diggs:
Default Re: Flex and ColdFusion web services

Hi,
Here is how to do the web services in coldfsuion.
http://www.quackit.com/coldfusion/tu...b_services.cfm
No in flex you call the webservices like:
<mx:WebService id="webService"
wsdl="http://www.flash-mx.com/ws/months.cfc?wsdl">
<mxperation name="getMonths"
resultFormat="object"
result="getMonths_result(event);"
fault="getMonths_fault(event);" />
</mx:WebService>


http://blog.flexexamples.com/2008/04...ce-from-flex-u
sing-the-webservice-class/
I hope this give you the idea.
Rgds

JFB


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 11:53 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk