Something like:

<!---
I would perform a prevalidation of the file path being passed to ensure you
are getting a
valid string that is not being tampered with.
--->

<cffunction name="loadWDDXFile"
            access="public"
            output="false"
            returntype="query"
            displayname="loadWDDXFile"
            hint=""
            description="">

    <cfargument name="wddxFilePath"
            required="true"
            type="string" />

    <cfset var wddxString = "" />
    <cfset var qryFromFile = "" />

    <!--- Modify this to the meta of your query that you are expecting from
the file --->
    <cfset qryFromFile = queryNew("column1, column2, column3", "varchar,
varchar, varchar") />

    <cfif FileExists(arguments.wddxFilePath)>

        <cftry>

            <cffile action="read"
                file="#arguments.wddxFilePath#"
                variable="wddxString" />

            <cfcatch type="any">

                <cfthrow type="system.cfcomponents.services.wddxService"
                    message="WDDX configuration file not found:
#arguments.wddxFilePath#" />

            </cfcatch>

        </cftry>

        <cfif isWDDX(wddxString)>

            <cfwddx action="wddx2cfml" input="#wddxString#"
output="qryFromFile" />

        </cfif>

    </cfif>

    <cfreturn qryFromFile />

</cffunction>

Teddy R. Payne, ACCFD
Google Talk - teddyrpa...@gmail.com



On Fri, Nov 20, 2009 at 2:35 PM, Jeff Howard <jeh...@gmail.com> wrote:

> Thanks for the help.  I understand how to do that part, but how do I get
> the packet from my server to their server is more my question and then read
> it?  That is the part I'm disconnecting on.  I have all the code written
> except for that step.  I have already deserialized and converted into a
> query object fror query of queries, I just am missing how port the wddx from
> my server/app to their server/app.
> On Fri, Nov 20, 2009 at 2:31 PM, <axunderw...@ups.com> wrote:
>
>>  <!--- Deserialize to a variable named wddxResult. --->
>> Deserializing WDDX packet...<p>
>> <cfwddx action = "wddx2cfml" input = #wddxText# output = "qnew">
>> http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000351.htm
>>
>>
>>  ------------------------------
>> *From:* ad...@acfug.org [mailto:ad...@acfug.org] *On Behalf Of *Jeff
>> Howard
>> *Sent:* Friday, November 20, 2009 2:25 PM
>> *To:* discussion@acfug.org
>> *Subject:* [ACFUG Discuss] porting data using wddx
>>
>>   Hey all,
>>
>> I'm trying to do something else new to me.  I have an app that I'm trying
>> to send to someone without sending passwords to the db.  This is a demo of
>> the app.  What I am trying to do is read the needed table into a query,
>> convert the query to wddx and send the app to have them install.  What I'm
>> trying to figure out is how to read the wddx file so I can convert it back
>> into a cf query object to use query of queries on so that they can run the
>> demo without actually connecting to the db.
>>
>> I've converted to the wddx file and believe I know what to do once they
>> have the app installed but I can't seem to figure out what to do with the
>> wddx file to port it and have CF read it on their end.
>>
>> Does anyone have a quick tip or an article on how to accomplish this?
>>
>> Thanks,
>> Jeff
>>
>> -------------------------------------------------------------
>> To unsubscribe from this list, manage your profile @
>> http://www.acfug.org?fa=login.edituserform<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 FusionLink <http://www.fusionlink.com/>
>> -------------------------------------------------------------
>
>
>

Reply via email to