Apologies..

Correction.. In this case..there is no need to actually present the
querystring as a second parameter.. 
You'll just pass the uri in with your url params and read the response (if
needed). 
BTW, I have not debugged,tested or compiled this code, so please contact me
if you have questions.
It probably will need to be tweaked.

<cfscript>
        ret.message = createObject('java','ReadHttpsURL').ReadHttpsURL(URI);
        writeOutput(ret.message);
</cfscript>

==========>


import java.net.*;
import java.io.*;

public class ReadHttpsURL {
    public static String uri;
    
    public static void main(String args[]){
       ReadHttpsURL obj = new ReadHttpsURL();
       obj.readit(uri);
    }
    
      public String readit(String uri) { 
        try{
            System.setProperty("javax.net.ssl.keyStore",
"x:\\path2yourkey\\yourkey.pfx");
            System.setProperty("javax.net.ssl.keyStorePassword", "foo");
            System.setProperty("javax.net.ssl.keyStoreType", "pkcs12");
 
System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.ww
w.protocol");
            String message;
                String line;
            URL url = new URL(uri);
            
            URLConnection conn = url.openConnection();
            conn.setDoOutput(true);
            conn.setRequestProperty("Content-Type", "text/plain");

            // Get the response
            BufferedReader in = new BufferedReader(new
InputStreamReader(conn.getInputStream()));
            
                // create your stringBuffer to hold your return from the
remote page
            StringBuffer sb = new StringBuffer();
            // loop through response
            while ((line = in.readLine()) != null) {
               sb.append(line);
            }
            message = sb.toString();

            in.close();
            
            return message;

        } catch (Exception e) {
              String message = "exception: " + e.getMessage();
              return message;
        }
   }
}

Warmest Regards,
 
Phillip B. Holmes
http://phillipholmes.com

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.7.1/348 - Release Date: 5/25/2006
 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:241683
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to