aspose file tools
The moose likes Sockets and Internet Protocols and the fly likes applet to IIS via sockets Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "applet to IIS via sockets" Watch "applet to IIS via sockets" New topic
Author

applet to IIS via sockets

Christophe Lee
Ranch Hand

Joined: Jul 10, 2001
Posts: 142
Can anyone tell me if IIS by default accepts java socket connections? How can I send information from an applet to the IIS server? Thanks.
James Swan
Ranch Hand

Joined: Jun 26, 2001
Posts: 403
Your applet could just do a HTTP GET or POST to send data to the IIS server.
Have a look at the API for HttpURLConnection.
Christophe Lee
Ranch Hand

Joined: Jul 10, 2001
Posts: 142
Your suggestion, by itself, does not work (I think). I do not think applets, even though downloaded from the server by the client, have the privilege to write files directly to the server. I believe you still need something on the server side to talk to the applet and that something will write the file on the server side.
Am I right here?
If I'm using IIS, how can I achieve writing a file on it? I'm using httpURLConnection to establish a connection, but there is still no way to write directly to the server (or is there?).
Thanks.
James Swan
Ranch Hand

Joined: Jun 26, 2001
Posts: 403
Yes you are correct that applet can't directly write a file on the server.
You would send data from the applet via HTTP (either a GET or a POST), and have the corresponding ASP (or whatever is listening on the other end) take the data from the request and write a file.
Christophe Lee
Ranch Hand

Joined: Jul 10, 2001
Posts: 142
If I'm using IIS, how would you suggest I handle the connection from the applet?
James Swan
Ranch Hand

Joined: Jun 26, 2001
Posts: 403
The most simple approach would be just to use Active Server Pages (ASP) listening at the server side, this is Microsoft's version of JSP, except ASP looks alot like visual basic.
Just have the ASP take the request from the applet (in JSP speak, something like, String myData = request.getParameter("myData"); ), and then write it to a file using whatever file manipulation object ASP has to offer.
Sorry I am not an ASP expert, but I am sure you can find that info easily.
The other approach (mentioned in the Advanced Java Forum) was to use RMI, up to you how you want to do it.
James.
Christophe Lee
Ranch Hand

Joined: Jul 10, 2001
Posts: 142
Hey James,
Thanks for the reply. I think I will stick with Java and use RMI (instead of VB with ASP). However, I am still having a few doubts. They are addressed in the advanced forum's room. You can click here to go to the discussion.
I would really really appreciate any feedback you might have. Thanks again.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: applet to IIS via sockets
 
Similar Threads
Java Applet in ASP
How to include a HTML Page into another HTML page
How Tomcat Works book - development question
Tomcat and IIS
Does Weblogic 5.1 IIS Proxy Plugin support RMI?