Heres an example of using Java in CF, we're using this code to compress a datafeed to Amazon, its in a cfscript.

arguments.SOAPreq = arguments.SOAPreq.getbytes();
ender = '--'&Amazon.Mimeboundry;
ender= ender.getbytes();
// create buffer to but the output of the content into and initalize it
bos = createObject("java", "java.io.ByteArrayOutputStream").init();
//Write the Soap Request to the output stream
bos.write(arguments.SOAPreq,0,len(arguments.SOAPreq));
// Create the GZIP output stream and initialize it
//this is telling java to put the output of the compression into the BOS outputstream
gzip = createobject('java','java.util.zip.GZIPOutputStream').init(bos);
gzip.write(arguments.Payload.getbytes());
gzip.close();
// Complete the GZIP file
bos.write(ender,0,len(ender));
compressedData = bos.tobytearray();
bos.close();

Adam Haskell
Sr. Developer
Parts Express
In a message dated 7/1/2004 4:10:25 PM Eastern Daylight Time, [EMAIL PROTECTED] writes:

>Hi Everyone,
>
>I've been looking at Kevin Hoyt's article at:
>
>http://www.macromedia.com/devnet//mx/coldfusion/articles/googlews_02.html
>
>on ways to invoke the GoogleAPI Web Service via a CFX.
>
>In the very last paragraph he states:
>
>"In the next article in this series, instead of building and configuring a Java
>CFX tag, you'll place Java code directly into a ColdFusion page."
>
>Could someone elaborate on this? How can you embed Java code in a ColdFusion
>page? Or is he talking about something different?
>
>Many thanks,
>Phill Gibson
>[EMAIL PROTECTED]
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to