Reddy Anoop

+ Follow
since Aug 22, 2007
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Reddy Anoop

I am using POST. Here is the code that I have. The servlet accepts a varible called "data" that has the complete xml. Please suggest.

String str = "";
String line = "";
String data1 = "";
// Send data
URL url = new URL(" http://xx123.test:80/translate");
URLConnection conn = url.openConnection();
OutputStreamWriter wr =
new OutputStreamWriter(conn.getOutputStream());
BufferedReader br =
new BufferedReader(new InputStreamReader(blb.getBinaryStream()));

while ( (str = br.readLine())!=null)
data1 += str; //strBuffer.append(str); }
line = URLEncoder.encode("data", "UTF-8") + "=" +
URLEncoder.encode(data1, "UTF-8");


// Get the response
BufferedReader rd =
new BufferedReader(new InputStreamReader(conn.getInputStream()));
while ((line = rd.readLine()) != null) {
wr.close() ;
catch (Exception e) {
e.printStackTrace(); // should do real exception handling

I am calling a servlet by passing XML data.

Sample xml that I am passing:

data1 =
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TestServlet SYSTEM "">
<TestConfig generatedDate="31 Oct 2007 16:27:30 GMT" dtdVersion="200703v1" qualification="false">
<MemoryModule mfgPartNum="501-6242" displaySequence="1000"/>

String line = URLEncoder.encode("data", "UTF-8") + "=" + URLEncoder.encode(data1, "UTF-8");

when I print the variable line, it prints ASCII values.

I wanted to send the xml as it is, can anyone please advise how to do this.


[ UD: added linebreak ]
[ November 14, 2007: Message edited by: Ulf Dittmer ]
Hi! I need to call a servlet via http_post with a data parameter. The parameter has the data that the servlet will process. The variable is called "Data". I need to use http_post and pass this "Data" variable.
The servlet returns an xml file that I have logic to process.
Can any of you please advise on how to call the sevlet via http_post by passing a variable? If you have sample code that will be helpful

My objective is to call a servlet by passing an xml file. The servlet currently takes the input xml file and returns output as xml. I will need to take this xml parse and store it into oracle table.

I have an xml file that is stored as a blob in oracle. I am reading that blob. Since servlet that is coded is not capable of dealing with blob, I need to convert it into a character stream and send it.

I am having difficulty trying to do that. Please adivise.

Hi! can anyone please suggest how to resolve the following issue.

I have a file that is saved as BLOB in oracle database. I am reading that into a "Blob" variable. After this I need to convert the blob into string.

I need to call a servlet that only is expecting a "String" as input.

Can anyone please suggest. If you have a sample code that will be helpful.

Can anyone please suggest how to use http_post to post an xml file ?
I need to pass an xml file to a webservice ussing http_post and parse the response that I get back from the webserice and store into a table.
Hi!, while parsing an xml file, I am getting error that it is not able to resolve a url
(eg: <!DOCTYPE RootElement SYSTEM "">. When I googled, there were suggestions that I need to use EntityResolver. But it is not working. Here is the code that I have. Ant help is greatly appreciated.


DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
docBuilder.setEntityResolver(new EntityResolver() {
public InputSource resolveEntity(java.lang.String publicId,
java.lang.String systemId)
throws SAXException, {
if (publicId.equals("--myDTDpublicID-"))
return new InputSource(new ByteArrayInputStream
("<?xml version='1.0' encoding='UTF-8'?>".getBytes()));
else return null;

I need help/suggestion on how to resolve the following issue.
I need to read an xml file stored in as BLOB in an oracle table. I am able to read the file. I am stuck after this because, I am calling another java program to parse by passing in an XML file. Since I am not sure how to convert the BLOB to an xml file, I am getting no where. Any suggestions/help is greatly appreciated.
Here is what I need to do.
1. Read BLOB data type from xml
2. Convert the BLOB into an xml file and call the parser program with this
xml file as the parameter.

16 years ago