![]() |
![]() |
||||||
|
|||||||
| Tags: |
![]() |
|
|||
|
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. |
| Sponsored Links |
|
|||
|
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"> <mx peration 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 |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise