Hi -
I have the following code (that works by the way) but our vendor is suggesting that we use HttpClient when calling out to them. For the life of me, I cannot rewrite this little itty bitty piece of code using HttpClient (either commons v 3.1 or the new httpclient beta 4) and get it to work!!!
URL url = new URL("http://tsparcs02:9080/apex/api/query? filtername=USER_FLTR&PARM_USER_ID=maher&usn=n4api1&pwd=n4api&mode=SNX&operatorId=MAH&complexId=USNWK&facilityId=PORTELIZABETH&yard=MAIN.xml");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
String userPassword = username + ":" + password;
// Base64 encode the authentication string
String encoding = new sun.misc.BASE64Encoder().encode(userPassword.
getBytes());
// Set Basic Authentication parameters
con.setRequestProperty("Authorization", "Basic " + encoding);
con.connect();
DataInputStream dis = new DataInputStream(con.getInputStream());
If anyone can help me out I would appreciate it.
Jennifer