File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes help with web service to display xml file contents using netbeans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Web Services
Bookmark "help with web service to display xml file contents using netbeans" Watch "help with web service to display xml file contents using netbeans" New topic
Author

help with web service to display xml file contents using netbeans

Noyce Fischer
Greenhorn

Joined: May 01, 2003
Posts: 2
hello everybody

I have a written a java DOM code to read xml file and I need to use it to create a web service that reads xml files using netbeans
the problem is in the return type of the code since it's void the web service returns null
so I was wondering if there is another way to make the web service print the xml file contents or another return type for the method

here is my xml file "CV.xml"


and here is my DOM code
I know it's too long but thats how I learnt to write it


thanks in advance>
Arjun Abhishek
Ranch Hand

Joined: Jul 08, 2008
Posts: 57
Hi

Can't you return a string containing the content of xml to print from the method instead of void. so that the WS client will consume the string and print it.

Thanks
Arjun.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12792
    
    5
This really sounds like a job for a RESTful web service.

Here is a Netbeans tutorial on creating a RESTful service.

Bill
Noyce Fischer
Greenhorn

Joined: May 01, 2003
Posts: 2
hello

thanks William for your sugesstion but we're not allowed to use RESTful web services

Arjun thanks for your answer i have already found a way to store all returened nodes in strings but how can i return multiple strings to be printed
 
GeeCON Prague 2014
 
subject: help with web service to display xml file contents using netbeans