I am trying to use XML to speak to a server and return data using the following code. Once active the code seems to wait indefinitely. Other threads in the program still remain active. I have used simalar code to speak to the server with no issue before. Can anyone see whats wrong here?
final String dosCommand = "cmd /c omp -iX -u admin -w admin -h " + openvasIP + " -p " + openvasPort + " --xml=\"<get_reports report_id='" + reportID + "' format_id='a3810a62-1f62-11e1-9219-406186ea4fc5'/>\"";
final String location = "C:\\";
try {
final Process process = Runtime.getRuntime().exec(dosCommand + " " + location);
final InputStream in = process.getInputStream();
int ch;
while ((ch = in.read()) != -1) {
System.out.print((char) ch);
String taskOut = String.valueOf((char) ch);
jTextArea3.append(taskOut);
Nothing is outputted at all. Not event the command into System.out.print.
EDIT: This command is designed to download file data in TXT or PDF (its on TXT right now). If I run the command from the CMD and send it to a txt file I get this - command...
C:\>omp -h 192.168.0.13 -p 9390 -u admin -w admin --get-report 474b824a-79bd-419
5-98ab-80efb40faca8 --format a3810a62-1f62-11e1-9219-406186ea4fc5 > c:/book/test
er2.txt
The output...
lib xml-Message: asking for 1048576
lib xml-Message: <= <authenticate_response status="200" status_text="OK"><role
>Admin</role><timezone>UTC</timezone></authenticate_response>
lib xml-Message: asking for 1048576
lib xml-Message: <= <get_version_response status="200" status_text="OK"><versi
on>4.0</version></get_version_response>
lib xml-Message: asking for 1048576
lib xml-Message: <= <get_reports_response status="200" status_text="OK"><repor
t type="scan" id="474b824a-79bd-4195-98ab-80efb40faca8" format_id="a3810a62-1f62
-11e1-9219-406186ea4fc5" extension="txt" content_type="text/plain">SSBTdW1tYXJ5C
j09PT09PT09PQoKVGhpcyBkb2N1bWVudCByZXBvcnRzIG9uIHRoZSByZXN1bHRzIG9mIGFuIGF1dG9tY
XRpYyBzZWN1cml0eSBzY2FuLgpUaGUgcmVwb3J0IGZpcnN0IHN1bW1hcmlzZXMgdGhlIHJlc3VsdHMgZ
m91bmQuClRoZW4sIGZvciBlYWNoIGhvc3QsIHRoZSByZXBvcnQgZGVzY3JpYmVzIGV2ZXJ5IGlzc3VlI
GZvdW5kLgpQbGVhc2UgY29uc2lkZXIgdGhlIGFkdmljZSBnaXZlbiBpbiBlYWNoIGRlc2NyaXB0aW9uL
CBpbiBvcmRlciB0byByZWN0aWZ5CnRoZSBpc3N1ZS4KClZlbmRvciBzZWN1cml0eSB1cGRhdGVzIGFyZ
and so on....
So - am i trying to do this the wrong way?
The resulting text file is perfect. I like the same data in a jTextArea ideally