Converting XML Document to string

S

Sunil Sabir

Dear All,

I am quite new to Java Web Services. I have made a Java Class which
calls all the web services . I am displaying the results on a Command
prompt. Below is my sample code:

import javax.xml.rpc.Service;
import javax.xml.rpc.Stub;
import horusWS.Horus_x0020_Web_x0020_Services_Impl;
import horusWS.Horus_x0020_Web_x0020_ServicesSoap;

public class JavaClient {
public static void main(String[] args)

{
Horus_x0020_Web_x0020_Services_Impl service = new
Horus_x0020_Web_x0020_Services_Impl();

Horus_x0020_Web_x0020_ServicesSoap port =
service.getHorus_x0020_Web_x0020_ServicesSoap();

String str;
str = port.getTextFeedbackLearner(1,"P001",1);
//where getTextFeedbackLearner is the my Web Service.
System.out.println(str);

System.out.println returns the web service in string format. Now I want
to compare this string to my actual getTextFeedbackLearner.xml file.
But I think I need to convert getTextFeedbackLearner.xml to string
first. Please let me know
how can I convert an XML Document to String.

Thanking you in Anticipation.

cheers,
Sunil Sabir
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top