1 package tableappclient.business; 2 3 11 import tableappclient.spec.TableNode; 12 import tableappclient.business.axis.*; 13 import org.w3c.dom.Node ; 14 import org.w3c.dom.NodeList ; 15 import org.w3c.dom.Document ; 16 17 public class TableNodeImpl 18 implements TableNode { 19 static String TABLE="TABLE"; 20 public TableNodeImpl() {}; 21 public Node getTableNode(String hostName, String portNum) { 22 try { 23 24 WelcomePresentationService service = new 25 WelcomePresentationServiceLocator(); 26 27 WelcomePresentation welcome; 28 welcome = service.gettableApp(new java.net.URL ("http://"+hostName+":"+portNum+"/tableApp/tableApp")); 29 Document doc = welcome.tableDoc(); 30 if(doc==null){ 31 return null; 32 } 33 NodeList nodeList = doc.getElementsByTagName(TABLE); 34 return nodeList.item(0); 35 36 } 37 catch (Exception e) { 38 e.printStackTrace(); 39 return null; 40 } 41 } 42 } | Popular Tags |