esercizi webservices wsdl

This commit is contained in:
2015-06-29 00:45:45 +02:00
parent 620edb5049
commit 53c280b729
60 changed files with 1741 additions and 2 deletions

View File

@@ -0,0 +1,44 @@
package exercise2_client_ws;
import exercise2_ws.Book;
import exercise2_ws.RemoteInterface;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.util.Iterator;
import java.util.List;
public class ClientPrintAll {
public static void main (String[] args) {
Context ctx = null;
try {
ctx =new InitialContext();
} catch (NamingException e) {
e.printStackTrace();
}
RemoteInterface r = null;
try {
r =(RemoteInterface) ctx.lookup("java:global/web/EJBBook!exercise2_ws.RemoteInterface");
List<Book> l = r.findall();
Iterator<Book> it = l.iterator();
while (it.hasNext()){
Book b = it.next();
System.out.print(b.getIsbn() + " " + b.getTitle() + " " + b.getAuthor() + " " +b.getPrice() + " ");
}
} catch (NamingException e) {
e.printStackTrace();
}
}
}