Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Timothée CAPALDI
@WebMethod
public String givelistofbook();
→ Return a list of books (those available at the library) as a string. For example: book1,book2,book3
@WebMethod
public String addbookandgivelist(String addedbook);
→ Add addedbook to previous list of books and return the resulting list as a string. For example, if I
pass book4 as a parameter: book1,book2,book3,book4
@WebMethod
public String removebookandgivelist(String removedbook);
→ Remove removedbook from previous list of books and return the resulting list as a string. For
example, if I pass book2 as a parameter: book1, book3,book4
@WebMethod
public String searchandgivebook(String rearchedbook);
→ Test if searchedbook is part of the list and return searchedbook if it is, or return “unavailable” if it is
not. For example, if I pass book3 as a parameter: book3, if I pass book5 as a parameter: unavailable
out from client with code calling each methodes one by one:
String res=booklist.givelistofbook();
System.out.println("Available books:\n"+res);
res=booklist.addbookandgivelist("book4");
System.out.println("Available books after adding:\n"+res);
res=booklist.searchandgivebook("book1");
System.out.println("Searched book:\n"+res);
res=booklist.removebookandgivelist("book1");
System.out.println("Available books after removing:\n"+res);
res=booklist.searchandgivebook("book1");
System.out.println("Searched book:\n"+res);
Each post corresponds to one call of a method from the client to the server. BURP detects the status,
length, type of a call and the time it takes to proceed. All these data are available in this table.
public String giveListOfBook(); => Give a list of all books from the inventory
public void addBook(String name,String author); => add a book to inventory
public void removeBookByTitle(String name); => remove a book by title
public void removeBookById(int id); => remove a book by n°
public String searchBookByTitle(String name); => show availability of a book
public String searchAuthor(String author); => show available book by an author
VI. Real Life example
In real life, my service could be used by my client to manage the library’s inventory. First, the user of the
client would get the list of books available at the moment. Then the user could add books to the list,
remove books from the list by name or by id, search a book by name or search an author to show all his
books. To clarify, I made a user interface.