You're adding a lot more work to this than is necessary. Just call the cfc method (which will return a standard query) like so..

url_to_cfc/yourcfc.cfc?methodname=yourmethod&returnFormat=json

This should provide you with a proper json string. Then on the php side use json_decode() to decode the string into a php array. You should be good too go with that and it'll take a lot less work.

John
ma...@fusionlink.com


Dusty Hale wrote:
Hi thank you Allen, John, and Brooks for the responses. I was actually planning on keeping the query result in the cfc and formatting the results in HTML table rows and pushing that into a <cfsavecontent variable="myresults"> and then sending that returning that variable to the web service. So in PHP I was hoping to just spit out that variable somehow to display the results in the HTML table rows.

Does that sound like it would work? Can anyone see any problems with doing it this way. Security is not too much of an issue here it is just some categories of sponsor information.

Muchos Gracias,

Dusty

On Thu, Apr 16, 2009 at 10:36 AM, <ma...@fusionlink.com <mailto:ma...@fusionlink.com>> wrote:

    You can simply specify the return type as either wddx or json. PHP
    has (or at least had) a wddx reader. And json is common now, so I
    suspect php has functions for that as well. If you do specify the
    return type, do it in the url not on the attribute of the
    cffunction. It keeps your web service agnostic so to speak.

    John
    ma...@fusionlink.com <mailto:ma...@fusionlink.com>


    ----- Original Message -----
    From: brooks.wil...@atl.frb.org <mailto:brooks.wil...@atl.frb.org>
    [mailto:brooks.wil...@atl.frb.org <mailto:brooks.wil...@atl.frb.org>]
    To: discussion@acfug.org <mailto:discussion@acfug.org>
    Sent: Thu, 16 Apr 2009 08:01:21 -0400
    Subject: Re: [ACFUG Discuss] creating a web service with cf

    sure - but you need to decide on a data format. does php support
    cf query
    type? i doubt it - you will likely need to change the query to an
    array.




    Dusty Hale <du...@dustyhale.com <mailto:du...@dustyhale.com>>
    Sent by: ad...@acfug.org <mailto:ad...@acfug.org>
    04/16/2009 01:02 AM
    Please respond to
    discussion@acfug.org <mailto:discussion@acfug.org>


    To
    discussion@acfug.org <mailto:discussion@acfug.org>
    cc

    Subject
    [ACFUG Discuss] creating a web service with cf






    I have a need which I think would be a good fit to create a web
    service
    but since I have never developed a web service I thought to get
    some other
    opinions.

    I have a site which is hosted on a Linux box with php and no CF. I
    need
    for part of this site to use a database and make a little admin app to
    manage it. Well I am lazy and don't want to do this with PHP and MySQL
    mainly because I know CF and SQL so I just want to do this with
    what I am
    used to. So my thought was that I could create a CFC that would
    act as a
    web service that the PHP site could call remotely. All it needs to
    do is
    get some data from the SQL server and display it in HTML. So I
    though I
    could generate the result HTML in the CFC and the PHP site could
    call it
    remotely. Again the PHP site is not on the same server as the CFC
    so it
    would be a remote call.

    This is basically what a web service is for right? Would this approach
    work?

    Thanks so much in advance for any replies.

    Dusty



    -------------------------------------------------------------
    To unsubscribe from this list, manage your profile @
    http://www.acfug.org?fa=login.edituserform

    For more info, see http://www.acfug.org/mailinglists
    Archive @ http://www.mail-archive.com/discussion%40acfug.org/
    List hosted by http://www.fusionlink.com
    -------------------------------------------------------------




    -------------------------------------------------------------

    To unsubscribe from this list, manage your profile @

    http://www.acfug.org?fa=login.edituserform



    For more info, see http://www.acfug.org/mailinglists

    Archive @ http://www.mail-archive.com/discussion%40acfug.org/

    List hosted by http://www.fusionlink.com

    -------------------------------------------------------------





--
Dusty Hale
Email: du...@dustyhale.com
Phone (Atlanta): 404.474.3754
Phone (Toll Free USA): 877.841.3370
Website: www.DustyHale.com <http://www.DustyHale.com>



-------------------------------------------------------------
To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------



Reply via email to