This code would require you to have client access installed on your ColdFusion server. :)
<!--- First, just for an example, lets go to a web site and retrieve a Bastard Operator from Hell excuse --->
<CFHTTP
url = "http://towel.blinkenlights.nl:666/"
resolveurl = 1
throwOnError = "Yes"
>
<!--- Now, I am going to trim all the characters out of this that I dont want to send to the AS400, as well as remove some of the HTML page formatting --->
<CFSET Quote = Left(Replace(REReplace(cfhttp.FileContent,"#chr(13)#<#chr(10)#[^>]*>!@%^&*()$/\","","All"), "=== The BOFH Excuse Server ===
Your excuse is:", "",
"ALL"), 50)>
<!--- show the excuse on the screen so that we know what we are sending --->
<cfdump var="#Quote#">
<!---// set local variables //--->
<CFPARAM name="Validate"
default="default"
type="any">
<!---// set default attributes //--->
<CFPARAM name="form.username"
default="Your User Name">
<CFPARAM name="form.secret"
default="Your Password">
<CFPARAM name="form.AS400"
default="Your System IP Address">
<!--- In this instance, I am running a program called 'SNDMSG', to simply send an AS400 break message to a user I am passing in the URL, like this: http://mypage.com/index.cfm?USER=MyUser --->
<CFPARAM name="CommandtoRun"
default="SNDMSG TOUSR(#Left(URL.User, 7)#)
MSG('#Quote#')">
<!---// [begin] action //--->
<!--- create the iSeries/AS400 object --->
<CFOBJECT action="create"
type="java"
class="com.ibm.as400.access.AS400"
name="iseries">
<CFOBJECT action="create"
type="java"
class="com.ibm.as400.access.CommandCall"
name="Command">
<!--- Initialize our contructor 'iSeries' --->
<CFSET iseries.init(form.AS400, Trim(UCase(form.username)), Left(Trim(form.secret), 10))>
<!--- Execute our AS400 username validation --->
<CFSET Validate = (iSeries.ValidateSignon())>
<!--- Initialize our contructor 'command' --->
<CFSET CmdCall = command.init(iSeries, CommandtoRun)>
<!--- Execute our AS400 command we defined above --->
<CFSET CmdRun = (Command.Run())>
<!--- disconnect --->
<CFSET iseries.disconnectService(iseries.command)>
<!--- this will return 'YES' if the command ran sucessfully --->
<CFDUMP var="#CmdRun#">
This code would require you to have client access installed on your ColdFusion server. :)