madmike2002
New Member
I need some help with my programming exercise as I am still quite new in programming.Here is what I have done so far: 1) I have setup a web service from scratch on netbeans. 2) I have created a bunch of java classes of marshalling and unmarshalling code on server side and which basically allow me to insert some sample java objects/data and marshall it into a XML file, then use unmarshaller to read and print the data. 3) Now I have created another webservice class called getxml.java, so I can call the method on client application.\[code\]@WebService()public class getxml {/** * This is a sample web service operation */public List<Book> getListofBooks () { List<Book> books = new ArrayList<Book>(); try { books = JAXBXMLHandler.unmarshal(new File("books.xml")); } catch (JAXBException e) { e.printStackTrace(); } System.out.println(books);return (books);} \[/code\]4) Then I setup a quick Java Application, added Web Service Client as my Existing Web Service server project. After that, I have got those generated files and used the Web Service References by drag and drop it to the client's source. I try to do a print but getting an red line under "getListofBooks"\[code\]public class JavaApplication5 { public static void main(String[] args) { // TODO code application logic here } private static java.util.List<org.me.xml.Book> getListofBooks() { org.me.xml.GetxmlService service = new org.me.xml.GetxmlService(); org.me.xml.Getxml port = service.getGetxmlPort(); return port.getListofBooks(); } }\[/code\]Question is how do I do System.out.print books the XML file stored in server?