You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by gy...@fas.harvard.edu on 2002/08/02 21:53:46 UTC

Q Related to Obtaining XML files from other Server

Hi All,

Is it possible that a Java servlet from one server, without using SOAP and HTTP 
protocals, can dynamically obtain xml/html files located on other regular web 
servers ?

Are there any programs available to do the above work?

Any suggestions are appreciated.

thanks,

Helen



Re: Q Related to Obtaining XML files from other Server

Posted by Robert Dietrick <rd...@sega.com>.
Since you say you want to obtain "obtain xml/html files located on other
regular web servers" ("web servers" being the operative words here), I
assume that you *do* indeed want to use HTTP to get the files.

It's easy.  See java.net.HttpURLConnection.

-rob

gyu@fas.harvard.edu wrote:
> 
> Hi All,
> 
> Is it possible that a Java servlet from one server, without using SOAP and HTTP
> protocals, can dynamically obtain xml/html files located on other regular web
> servers ?
> 
> Are there any programs available to do the above work?
> 
> Any suggestions are appreciated.
> 
> thanks,
> 
> Helen
> 
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>

--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Q Related to Obtaining XML files from other Server

Posted by ni...@borwankar.com.
A servlet itself  *responds* to requests  so if you want it to 
*initiate* requests, then the body of some servlet
method (init(), doPost(),doGet() or Service()) will need to contain some 
code that is a client of the server that is serving up
the XML you want to fetch.  As another psoter suggested 
 java.net.HttpURLConnection could be useful in this context.

If you want the XML to be fetched just once you could do it in the 
init() method of the servlet.
If it needs to be fetched repeatedly then the servlet needs to be 
invoked repeatedly by some external agent.
Code in the methods of a servlet does not run until so invoked.

Since you say other "web" servers the request will need to be HTTP, and 
since you want to retrieve XML
then the remote server will need to set the MIME Content type to 
text/xml  else the XML will be interpreted as plain text.

Hope some of this is useful although not directly related to SOAP,

Nitin Borwankar

gyu@fas.harvard.edu wrote:

>Hi All,
>
>Is it possible that a Java servlet from one server, without using SOAP and HTTP 
>protocals, can dynamically obtain xml/html files located on other regular web 
>servers ?
>
>Are there any programs available to do the above work?
>
>Any suggestions are appreciated.
>
>thanks,
>
>Helen
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@xml.apache.org>
>For additional commands, e-mail: <ma...@xml.apache.org>
>
>  
>




Re: Q Related to Obtaining XML files from other Server

Posted by ni...@borwankar.com.
A servlet itself  *responds* to requests  so if you want it to 
*initiate* requests, then the body of some servlet
method (init(), doPost(),doGet() or Service()) will need to contain some 
code that is a client of the server that is serving up
the XML you want to fetch.  As another psoter suggested 
 java.net.HttpURLConnection could be useful in this context.

If you want the XML to be fetched just once you could do it in the 
init() method of the servlet.
If it needs to be fetched repeatedly then the servlet needs to be 
invoked repeatedly by some external agent.
Code in the methods of a servlet does not run until so invoked.

Since you say other "web" servers the request will need to be HTTP, and 
since you want to retrieve XML
then the remote server will need to set the MIME Content type to 
text/xml  else the XML will be interpreted as plain text.

Hope some of this is useful although not directly related to SOAP,

Nitin Borwankar

gyu@fas.harvard.edu wrote:

>Hi All,
>
>Is it possible that a Java servlet from one server, without using SOAP and HTTP 
>protocals, can dynamically obtain xml/html files located on other regular web 
>servers ?
>
>Are there any programs available to do the above work?
>
>Any suggestions are appreciated.
>
>thanks,
>
>Helen
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@xml.apache.org>
>For additional commands, e-mail: <ma...@xml.apache.org>
>
>  
>




--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Q Related to Obtaining XML files from other Server

Posted by Robert Dietrick <rd...@sega.com>.
Since you say you want to obtain "obtain xml/html files located on other
regular web servers" ("web servers" being the operative words here), I
assume that you *do* indeed want to use HTTP to get the files.

It's easy.  See java.net.HttpURLConnection.

-rob

gyu@fas.harvard.edu wrote:
> 
> Hi All,
> 
> Is it possible that a Java servlet from one server, without using SOAP and HTTP
> protocals, can dynamically obtain xml/html files located on other regular web
> servers ?
> 
> Are there any programs available to do the above work?
> 
> Any suggestions are appreciated.
> 
> thanks,
> 
> Helen
> 
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>

Re: Q Related to Obtaining XML files from other Server

Posted by Praveen Peddi <pp...@contextmedia.com>.
If your Java Servlet means a HttpServlet, then I don't think its possible.
HttpServlet only handles Http request.

It can be achieved using GenericServlet, which is a super class of
HttpServlet.


Praveen

----- Original Message -----
From: <gy...@fas.harvard.edu>
To: <ax...@xml.apache.org>
Cc: <so...@xml.apache.org>; <jd...@mailbox.sys-con.com>
Sent: Friday, August 02, 2002 3:53 PM
Subject: Q Related to Obtaining XML files from other Server


> Hi All,
>
> Is it possible that a Java servlet from one server, without using SOAP and
HTTP
> protocals, can dynamically obtain xml/html files located on other regular
web
> servers ?
>
> Are there any programs available to do the above work?
>
> Any suggestions are appreciated.
>
> thanks,
>
> Helen
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>


Re: Q Related to Obtaining XML files from other Server

Posted by Praveen Peddi <pp...@contextmedia.com>.
If your Java Servlet means a HttpServlet, then I don't think its possible.
HttpServlet only handles Http request.

It can be achieved using GenericServlet, which is a super class of
HttpServlet.


Praveen

----- Original Message -----
From: <gy...@fas.harvard.edu>
To: <ax...@xml.apache.org>
Cc: <so...@xml.apache.org>; <jd...@mailbox.sys-con.com>
Sent: Friday, August 02, 2002 3:53 PM
Subject: Q Related to Obtaining XML files from other Server


> Hi All,
>
> Is it possible that a Java servlet from one server, without using SOAP and
HTTP
> protocals, can dynamically obtain xml/html files located on other regular
web
> servers ?
>
> Are there any programs available to do the above work?
>
> Any suggestions are appreciated.
>
> thanks,
>
> Helen
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Q Related to Obtaining XML files from other Server

Posted by Praveen Peddi <pp...@contextmedia.com>.
If your Java Servlet means a HttpServlet, then I don't think its possible.
HttpServlet only handles Http request.

It can be achieved using GenericServlet, which is a super class of
HttpServlet.


Praveen

----- Original Message -----
From: <gy...@fas.harvard.edu>
To: <ax...@xml.apache.org>
Cc: <so...@xml.apache.org>; <jd...@mailbox.sys-con.com>
Sent: Friday, August 02, 2002 3:53 PM
Subject: Q Related to Obtaining XML files from other Server


> Hi All,
>
> Is it possible that a Java servlet from one server, without using SOAP and
HTTP
> protocals, can dynamically obtain xml/html files located on other regular
web
> servers ?
>
> Are there any programs available to do the above work?
>
> Any suggestions are appreciated.
>
> thanks,
>
> Helen
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>