[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How to invoke HttpUnit from php code?

Posted on 2006-11-20
4
Medium Priority
?
720 Views
Last Modified: 2006-11-23
I have a site, UrlAudit.com it takes a list of URL and scans them to detect things like, Popups, frame breakers, viruses, etc

We are trying to increase the functionality and the accuracy of the system.  We have installed HttpUnit, however, our programmer has read the dcumentation at http://httpunit.sourceforge.net/, but he says he can't figure out how to invoke HttpUnit with our scripts.

Question is:

How can we call HttpUnit from our PHP script to scan the lists of urls?
0
Comment
Question by:GodadoLLC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 400 total points
ID: 17985533
You wouldn't so much invoke HttpUnit, but a Java program that uses it. Something like

$command = "$path_to_java $classpath $fq_classname_of_java_app_using_httpunit";
$output = shell_exec("$command");
0
 
LVL 6

Accepted Solution

by:
SamsonChung earned 1600 total points
ID: 17991100
just simply

<?php
$returned = exec("java $httpUnitName");

?>

if you are on a linux/unix system, you can also modulized the system by writing a shell script that calls the java app
and have php call that shell script.

so you can simply run the shell script to see if it is working or not.

remember, exec ("blah"); means blah is simply a shell/dos command. so it takes in arguments too.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 18003082
:-)
0
 
LVL 6

Expert Comment

by:SamsonChung
ID: 18003105
%:^)

Thanks
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

656 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