sending xml to servlet

Hi,

I am new to servlet. I need to send an xml from an application running in a one server to a servlet running in another server. Is this possible. If so, could some one please direct me to some material, or give me some idea of how it could be done.

Appreciate all your help

Thanks.

[309 byte] By [radsata] at [2007-10-3 2:31:10]
# 1

Please use URLConnection to connect to your servlet. like:

URL servletURL = new URL("http://yourservleturlmapping?type=xml");

URLConnection conn = servletURL.openConnection();

OutputStream out = conn.getOutputStream();

Once you get OutputStream, you can write your xml file or XML object. In the servlet side, you can use request.getInputStream() get an InputStream object. Then you can get your XML data from it.

Hope it will help you.

rcd27a at 2007-7-14 19:30:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thanks, It did help
radsata at 2007-7-14 19:30:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...