Thangamani RATHINAM wrote:
> Hello,
>
> Here is a situation for which I am designing a solution. I am designing a
> transaction server which is going to receive information from different
> servers and send the results back to them. So this is actually going to be a
> server to server interaction. I am planning to use servlets, but my
> questions are:
>
> 1. How can they send information to me? (I would like them to send me a
> form post, Is it possible? how would they do it from their server(not from
> browser)?)
>
If both servers are HTTP-based (such as both running servlets), you can have the
first server call the second one by using the java.net.URLConnection class. There
are examples of this kind of call in the Networking Trail of the Java Language
Tutorial:
http://java.sun.com/docs/books/tutorial
For your case, you will need to make sure that your request to the second server
conforms to the HTTP standards for how data is sent in a POST transaction. This will
require you to understand the HTTP protocol. A good starting place is the documents
at the World Wide Web consortium (http://www.w3c.org).
By the way, this same technique can be used from an applet to call a servlet.
>
> 2. How can I send back the results (which will be a String) to them? (If I
> send it as a html page, can they decode and process it?)
>
The response from your second server can be anything you want it to produce. The
simplest case might be that the second server produces an HTML page (and your first
server is acting like a proxy for it) -- all you need to do is copy all the output
from the second server to the output stream of your first server. If the second
server sends something different, you might have to translate -- it is all up to how
you want to design things.
>
> I know this is a silly designing problem, but I would appreciate if someone
> show me the right direction to proceed ;-)
>
> Thanks in advance.
>
> Tango.
>
Craig McClanahan
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html