House of Fusion
Home of the ColdFusion Community

Search cf-talk

December 02, 2008

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31       

Search over 2,500 ColdFusion resources here  >>>      
Home /  Groups /  ColdFusion Talk (CF-Talk)

CFHTTP call in CFC, returning content fails

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Kris Jones
09/06/2008 06:12 PM

I've got a function in a cfc, that is doing a soap request via CFHTTP. I've enabled output on the function, and can dump the CFHTTP.filecontent successfully after the cfhttp call. I then return that result from the function. However, in the calling cfm template, the return variable on the function is coming up not defined. So, I see the dump from inside the function, then an error that Variable XXX is undefined. Been fooling around with this for too long. Have tried moving logic from function into CFM page, and I'm having different issues with the results -- like being unable to do any xmlsearch calls on the results at all, although I can reference individual node values with dot notation. Anybody got an idea what I'm missing here? I'm using similar structure on other calls, and can't see the problem. Thanks, Kris ------------------- CFM template has: <cfinvoke component="#oComp#" method="myfunc" returvariable="xxx">   <cfinvokeargument name="arga" value="somevalue" />   <cfinvokeargument name="argb" value="someothervalue /> </cfinvoke> <cfdump var="#xxx#"><cfabort /> -------------------- CFC Function looks something like: <cffunction name="myfunc" access="public" returntype="any" output="true"> <cfargument name="arga" type="string" required="yes"> <cfargument name="argb" type="string" required="yes"> <cfset var myresult = "" /> <cfset var mypacket = "" /> <cfsavecontent variable="nfws_soappacket">   <cfoutput>   .....[soap description here]....   </cfoutput> </cfsavecontent> <cfhttp url="someaddress" method="POST"> ...param ...param </cfhttp> <cfset myresult = xmlParse(cfhttp.FileContent) /> <cfdump var="#myresult#" /> <cfreturn myresult /> </cffunction> -------------------

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Kris Jones
09/06/2008 06:16 PM

Sorry, the function contents had stupid typo (I never have been good at obscuring/genericizing my actual code before posting). Here is what I meant to write: ------------------- CFM template has: <cfinvoke component="#oComp#" method="myfunc" returvariable="xxx">        <cfinvokeargument name="arga" value="somevalue" />        <cfinvokeargument name="argb" value="someothervalue /> </cfinvoke> <cfdump var="#xxx#"><cfabort /> -------------------- CFC Function looks something like: <cffunction name="myfunc" access="public" returntype="any" output="true"> <cfargument name="arga" type="string" required="yes"> <cfargument name="argb" type="string" required="yes"> <cfset var myresult = "" /> <cfset var mypacket = "" /> <cfsavecontent variable="mypacket">        <cfoutput>        .....[soap description here]....        </cfoutput> </cfsavecontent> <cfhttp url="someaddress" method="POST"> ...param ...param </cfhttp> <cfset myresult = xmlParse(cfhttp.FileContent) /> <cfdump var="#myresult#" /> <cfreturn myresult /> </cffunction> -------------------


<< Previous Thread Today's Threads Next Thread >>

Mailing Lists