Hey thanks! That worked! A little tweaking and adding in the JSSE jar (don't know if that was really necessary or not, but better safe than sorry I suppose) and it popped out like a charm! Finally I can (and hopefully others) can kiss the MSXML and Socket components good by for UPS connections.
Needs to be cleaned up some more, but at least it's talking. Not bad response times either (as opposed to the COM solutions and such). Goodness, this Java/CF thing is kinda cool. Cheers, Erik Yowell [EMAIL PROTECTED] http://www.shortfusemedia.com <cfset urlObj = createObject("java", "java.net.URL")> <cfset sysObj = createObject("java", "java.lang.System")> <cfset conObj = createObject("java", "java.net.URLConnection")> <cfset osObj = createObject("java", "java.io.OutputStream")> <cfset oswObj = createObject("java", "java.io.OutputStreamWriter")> <cfset isrObj = createObject("java", "java.io.InputStreamReader")> <cfset brObj = createObject("java", "java.io.BufferedReader")> <cfset urlString = "https://www.ups.com/ups.app/xml/Rate"> <!--- Must be name=value pairs or it pukes...i think ;) ---> <cfset msg = "#sXMLPacket#"> <!--- Set SSL Handler ---> <cfset sysObj.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.interna l.www.protocol")> <cfset urlObj.init(urlString)> <cfset conObj = urlObj.openConnection()> <cfset conObj.setDoInput(true)> <cfset conObj.setDoOutput(true)> <cfset conObj.setUseCaches(false)> <!--- Set custom http headers... ---> <cfset conObj.setRequestProperty("HOST","www.ups.com:80")> <cfset conObj.setRequestProperty("CONTENT-LENGTH",javaCast("string",Len(sXMLPac ket)))> <cfset conObj.setRequestProperty("ACCEPT","*/*")> <cfset conObj.setRequestProperty("USER_AGENT","#CGI.HTTP_REFERER#")> <!--- Getting an output stream... ---> <cfset osObj = conObj.getOutputStream()> <!--- Initialize java.io.OutputStreamWriter with OutputStream object ---> <cfset oswObj.init(osObj)> <cfset oswObj.write(msg)> <cfset oswObj.flush()> <cfset oswObj.close()> <!--- Get response ---> <!--- Returns java.io.InputStream ---> <cfset isObj = conObj.getInputStream()> <!--- Initialize java.io.InputStreamReader with InputStream object ---> <cfset isrObj.init(isObj)> <cfset brObj.init(isrObj)> <cfset line = brObj.readLine()> <cfloop condition="#IsDefined('line')#"> <cfoutput>#line#</cfoutput> <cfset line = brObj.readLine()> </cfloop> -----Original Message----- From: Jon Hall [mailto:jonhall@;ozline.net] Sent: Friday, November 01, 2002 6:39 PM To: CF-Talk Subject: Re: MSXML alternative for Linux? Well I've written some code to do it, but it isn't pretty, and it isn't exactly speedy either. I know Ben Forta said he was working on it for a release a couple weeks ago though. If you want to play around here is a code dump...I'm working on getting all this into a cfc. Been real busy lately though. I've tinkered a bit with httpclient as well, I'm not sure if there is any advantages to using it from CF rather than java.io. I have a sneaking suspicion httpclient is buried in MX somewhere already though as it is listed as a dependency for Axis. If it is, there might be performance advantages since it is already loaded...how to grab ahold of it though? <cfset urlObj = createObject("java", "java.net.URL")> <cfset conObj = createObject("java", "java.net.URLConnection")> <cfset osObj = createObject("java", "java.io.OutputStream")> <cfset oswObj = createObject("java", "java.io.OutputStreamWriter")> <cfset isrObj = createObject("java", "java.io.InputStreamReader")> <cfset brObj = createObject("java", "java.io.BufferedReader")> <cfset urlString = "http://127.0.0.1/cfhttp_dump.cfm"> <!--- Must be name=value pairs or it pukes...i think ;) ---> <cfset msg = "lala=Hi SERVER! Just a quick hello!"> <cfset urlObj.init(urlString)> <cfset conObj = urlObj.openConnection()> <cfset conObj.setDoInput(true)> <cfset conObj.setDoOutput(true)> <cfset conObj.setUseCaches(false)> <!--- Set custom http headers... ---> <cfset conObj.setRequestProperty("CONTENT_LENGTH", 35)> <!--- Getting an output stream... ---> <cfset osObj = conObj.getOutputStream()> <!--- Initialize java.io.OutputStreamWriter with OutputStream object ---> <cfset oswObj.init(osObj)> <cfset oswObj.write(msg)> <cfset oswObj.flush()> <cfset oswObj.close()> <!--- Get response ---> <!--- Returns java.io.InputStream ---> <cfset isObj = conObj.getInputStream()> <!--- Initialize java.io.InputStreamReader with InputStream object ---> <cfset isrObj.init(isObj)> <cfset brObj.init(isrObj)> <cfset line = brObj.readLine()> <cfloop condition="#isDefined("line")#"> <cfoutput>#line#</cfoutput> <cfset line = brObj.readLine()> </cfloop> -- jon mailto:jonhall@;ozline.net Friday, November 1, 2002, 7:00:24 PM, you wrote: EY> Connecting to UPS for rates and service selection right? CFHTTP is a no EY> go on that one. You can't tweak the actual http header for the CFHTTP EY> call (and the vars are URL Encoded, breaks UPS), though I'm pretty sure EY> someone could write a wrapper class for either of these http clients to EY> have it work with CFMX. EY> http://www.innovation.ch/java/HTTPClient/ EY> http://jakarta.apache.org/commons/httpclient/ EY> This is something I've been tinkering around with for a while, but I EY> fear that my lack of java experience is just going to be keeping me at EY> that 'tinkering' stage for a while. Personally, even though the MSXML EY> method works, seems like a lot of overhead now w/ the java extension of EY> MX. EY> Erik Yowell EY> [EMAIL PROTECTED] EY> http://www.shortfusemedia.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.

