Winsock Scripting Issues

I am Using Winsock protocol to create a script which goes like below

1. Going to URL:
2. Clicking on the link provided on the webpage to connect through the Mainframe terminal (3270), using JNLP file through web Connect client.
3. Enter command “ncamfdy” and press Enter
4. Enter credentials.

The above is the scenario which I need to script.I am able to script it through Winsock protocol only,

The problem is

1. I am getting the data in buffer is in binary format which is completely not understandable, which restricts me to do any enhancement to replay the script successfully.
2. I need to change the JNLP file which is having a host IP, currently every time through webclient it is pointing to the same JNLP file.

If some one can suggest me to how to convert these data in the ASCII format in the buffer and also how to change the JNLP file to point the other environment would be very helpful.

Umair Farooqui