Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Converting XML Document to String

843833May 10 2005 — edited May 12 2005
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 9 2005
Added on May 10 2005
1 comment
160 views