How to create an function wrapper to interface a legacy system

Posted on 2003-03-04
Medium Priority
Last Modified: 2012-05-04
I had heard about function wrapper. I wants to know if it is possible to create a function wrapper to interface a legacy system using perl and CGI.
If it is possible, pls highlight any resource available.
Question by:RayLeong
  • 2
LVL 92

Expert Comment

ID: 8069814
To call an external program use Runtime.exec() method.
To read from a URL use the URLConnection class.

Author Comment

ID: 8069994
I wanted to perform some request on another server.
I just went reading up on CGI. Based on my understanding now and your comments, do you mean that all I have to do is hit the URL and the cgi program will execute like any executable. The parameters can be passed in using the URL (e.g. url?param=value).
I have yet to find out how to get the output of the CGI execution. Give me a hint.
If you don't mind I would like to extend the question. The CGI programs are located in a web server, so logically, it does not matter even if I uses https as the transport protocol.
LVL 92

Accepted Solution

objects earned 600 total points
ID: 8070045
> do you mean that all I have to do is hit the URL and the
> cgi program will execute like any executable

That is how cgi's work.

> I have yet to find out how to get the output of the CGI execution.

Use the URL and URLConnection classes:

URL url = new URL("http://www.xyz.com/my.cgi");
URLConnection conn = url.openConnection();
InputStream in = conn.getInputStream();
// output of cgi can be read from stream


Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question