?
Solved

Use java applet to get response result from batch file in command line

Posted on 2007-07-23
7
Medium Priority
?
808 Views
Last Modified: 2013-12-22
I use java to create batch file to get SOAP service and get response.

Batch file as below:
SET PATH=%PATH%;
set CLASSPATH=D:/SOAP Connection Sample/lib;log4j-1.2.8.jar;j2ee.jar;db2jcc.jar;db2jcc_license_cisuz.jar;db2jcc_license_cu.jar;
java HttpConnectionTestTT http://170.65.186.162/WebServiceNew/recordingservice.asmx C:/telenet.txt


C:/telenet.txt as below:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetRecordingID xmlns="http://tempuri.org/">
<extension>150702</extension>
<line>0</line>
<ruleName>AAA</ruleName>
</GetRecordingID>
</soap:Body>
</soap:Envelope>

Can I use applet to call this batch file and get the response in my applet?
I don't want to put them into applet.
Please show me a sample, thanks!

0
Comment
Question by:johnnywong71
  • 3
  • 2
5 Comments
 
LVL 92

Expert Comment

by:objects
ID: 19552761
applet would need to be signed to execute a batch file.
why do u want to use an applet?
0
 
LVL 1

Author Comment

by:johnnywong71
ID: 19553098
It because SOAP can't run in my applet when I load it in IE.

http://www.experts-exchange.com/Software/Internet_Email/Web_Browsers/Internet_Explorer/Q_22713192.html

I need to change a lot to add SOAP method in it.

I can use the following code to run batch file but can't get SOAP response in applet.
Runtime.getRuntime().exec("c:\\test.bat");

0
 
LVL 92

Expert Comment

by:objects
ID: 19553576
you'll get a similiar error running a batch. You need to sign the applet (to fix both problems)

Or make the soap request from the server, and pass results to applet.
0
 
LVL 1

Author Comment

by:johnnywong71
ID: 19553784
Thanks for your information.
But I have not enough time to complete this task.

I just try to run batch file in IE and export the response result into txt file. And IE use FileReader() to get the response from txt file.
It looks like work.
Do you think so?

0
 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 19553788
unless your applet is signed it won't be able to run the batch, or read the local disk.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying 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

TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month14 days, 17 hours left to enroll

840 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