Oct 12 2006

Google Minis Rock

Posted by john at 3:24 PM
0 comments
- Categories: Coldfusion

code for a simple cfc:
<cfcomponent name="GoogleMini">
   <cffunction name="PostQuery" access="remote" output="false" returntype="any">
      <cfargument name="varQ" type="any" required="true" />
      <cfargument name="varRestrict" type="any" required="false" />
      <cfargument name="varIe" type="any" required="false" />
      <cfargument name="varSite" type="any" required="false" />
      <cfargument name="varOutput" type="any" required="false" />
      <cfargument name="varClient" type="any" required="false" />
      <cfargument name="varLr" type="any" required="false" />
      <cfargument name="varProxystylesheet" type="any" required="false" />
      <cfargument name="varOe" type="any" required="false" />
      
      <cfoutput >
      <cfhttp method="get" result="varGresult" url="http://gian/search">
         <cfhttpparam name="q" value="#varQ#" type="formfield">
         <cfhttpparam name="restrict" value="#varRestrict#" type="formfield">
         <cfhttpparam name="ie" value="#varIe#" type="formfield">
         <cfhttpparam name="site" value="#varSite#" type="formfield">
         <cfhttpparam name="output" value="#varOutput#" type="formfield">
         <cfhttpparam name="client" value="#varClient#" type="formfield">
         <cfhttpparam name="lr" value="#varLr#" type="formfield">
         <cfhttpparam name="proxystylesheet" value="#varProxystylesheet#" type="formfield">
         <cfhttpparam name="oe" value="#varOe#" type="formfield">
      </cfhttp>
      <cfscript>
         gXml = xmlparse(varGresult.filecontent);
         
      </cfscript>
   
      
      
      </cfoutput>

      <cfreturn #gXml# />
   </cffunction>
</cfcomponent>
Calling Page:
<cfscript>
myObj = createobject("webservice","http://127.0.0.1/com/googlemini.cfc?wsdl");
myObjVal = myObj.PostQuery("consent form","","","yoursitename","xml_no_dtd","yourclientformatting","","","");
</cfscript>
<cfdump var="#myObjval#" >

Comments

Write your comment



(it will not be displayed)