Article View: comp.lang.java.programmer
Article #320Re: Looking for a Datek or other streamers interface or ideas about the concept!
From: Eugene Kononov
Date: Thu, 16 Aug 2001 19:33
Date: Thu, 16 Aug 2001 19:33
63 lines
3191 bytes
3191 bytes
Yes, this is relatively simple, although you may encounter a fe
caveats. Essentioally, you want to use an HttpsURLConnection class to
log in to Datek site and to post requests to it. I've implemented a
stand alone Java app that retreves quotes from Datek and automatically
places trades. Here is how your logIn method may look like:
public void logIn() throws IOException, DatekException {
if (isLogEnabled)
log.write("Trying to log in.");
connection = ( HttpsURLConnection ) url.openConnection();
//connection.setRequestProperty("Authorization", "Basic " +
Base64.encode(userName + ":" + password));
connection.setRequestProperty("Authorization", "Basic " +
authString);
// set some properties
connection.setDoOutput(true);
connection.setDoInput(true);
connection.setUseCaches(false);
connection.setAllowUserInteraction(false);
// check the response from the server
responseCode = connection.getResponseCode();
responseMessage = connection.getResponseMessage();
// close connection
connection.disconnect();
if (responseCode == HttpURLConnection.HTTP_OK) {
if (isLogEnabled)
log.write("Logged in successfully.");
}
else {
if (isLogEnabled)
log.write("Couldn't log in. Server message: " +
responseMessage);
throw new DatekException("Couldn't log in. See the log for
more information.");
}
}
MM <meMRmm@bigfoot.com> wrote in message news:<3B79965C.11FE4273@bigfoot.com>...
> Would like a Datek streamer and trade buy/sell interface
> (applet/jbean/class/code/etc).
>
> I have sniffed its connection and its an HTTP port, per session static
> ip.
>
> The login to Datek is HTTPS and a completely different remote IP,
> makes sense for security reasons.
>
> Any help / ideas would be appreciated!
>
> Thanks!
>
> PS: reply via email if possible!
Technical Details
Message-ID:
<d4a4fd16.0108161133.10734d72@posting.google.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!postnews1.google.com!not-for-mailReferences:
<3B79965C.11FE4273@bigfoot.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10a146,1ee31794d4e30811 X-Google-Attributes: gid10a146,public X-Google-Thread: f74b3,1ee31794d4e30811 X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-08-16 12:33:05 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!postnews1.google.com!not-for-mail From: nonlinear5@yahoo.com (Eugene Kononov) Newsgroups: comp.lang.java.programmer,borland.public.jbuilder.java.language Subject: Re: Looking for a Datek or other streamers interface or ideas about the concept! Date: 16 Aug 2001 12:33:05 -0700 Organization: http://groups.google.com/ Lines: 63 Message-ID: <d4a4fd16.0108161133.10734d72@posting.google.com> References: <3B79965C.11FE4273@bigfoot.com> NNTP-Posting-Host: 63.66.112.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 997990385 22482 127.0.0.1 (16 Aug 2001 19:33:05 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 16 Aug 2001 19:33:05 GMT