Building a client application: (Port number where a JAVA client-program runs + Build a listener to get data from web service).
Posted on 2007-10-02
I'm trying to connect to a web service data source.
The way the service works is like this:
1.) First, I need to call a LOGIN method. The LOGIN method has two arguments: the IP and the port number where the data source infrastructure will connect to and send the data.
2.) Second, there's a method to request the type of data that I need.
3.) Then lastly after I request type of data that I need, the infrastructure will connect to the port I specify and start sending data.
So the questions are:
1.) In the first step, how can I know the port number that the JAVA program uses to go outside?
So that I can supply this information to the LOGIN method along with the IP address (that I can get easily using InetAddress).
2.) How do I build the listener to receive stream of data that is being pushed from the server?
I'm using J2SE 1.5.
Thanks in advance for all the help.