Send form values to Remote CFC


/ Published in: ColdFusion
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <!--- -------------- Send arguments to ClaytonHomes remote service ---------------- --->
  2. <cfhttp url="http://pubwebteam.pubdev.com/M3cf/cfc/getdata.cfc" method="post" >
  3. <cfhttpparam type="formfield" name="method" value="getImages">
  4. <cfhttpparam type="formfield" name="plant" value="921">
  5. </cfhttp>
  6. <cfwddx action="wddx2cfml" input='#cfhttp.FileContent#' output="callReturn">
  7. <Cfdump var="#callReturn#" top="20">
  8.  
  9.  
  10. <!--- ------------------ on the CFC side ------------------ ---->
  11. <cffunction name="getImages" access="remote" returntype="any" output="no">
  12.  
  13. <cfargument name="type" type="string" required="no" default="">
  14. <cfargument name="plant" type="string" required="no" default="">
  15. <cfargument name="seriesId" type="string" required="no" default="">
  16. <cfargument name="modelNumber" type="string" required="no" default="">
  17.  
  18. <cfstoredproc datasource="#this.dsn#" procedure="M3.PrcImagesBySearch">
  19. <cfprocresult name="rs" />
  20. <cfprocparam dbvarname="type" type="in" cfsqltype="cf_sql_varchar" value="#arguments.type#"/>
  21. <cfprocparam dbvarname="plant" type="in" cfsqltype="cf_sql_varchar" value="#arguments.plant#"/>
  22. <cfprocparam dbvarname="seriesId" type="in" cfsqltype="cf_sql_varchar" value="#arguments.seriesId#"/>
  23. <cfprocparam dbvarname="modelNumber" type="in" cfsqltype="cf_sql_varchar" value="#arguments.modelNumber#"/>
  24. </cfstoredproc>
  25.  
  26. <cfset myResult = rs>
  27. <cfreturn myResult>
  28.  
  29. </cffunction>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.