1. Homepage
  2. Programming
  3. KIT214 Intelligent and Secure Web Development - Assignment 2: Web services for an online book-shopping website

KIT214 Intelligent and Secure Web Development - Assignment 2: Web services for an online book-shopping website

Engage in a Conversation
University of TasmaniaAustraliaKIT214Intelligent and Secure Web DevelopmentWeb servicePHPXMLCSSJavascriptHTML

Total: 25 Marks CourseNana.COM

Due: 19th Oct 2022 CourseNana.COM

Problem: CourseNana.COM

Assignment 2 CourseNana.COM

Note: If you have the expertise, you can build a proper HTML/CSS/JS interface, but it is not required. The output should be ideally tested with JMeter or POSTMAN, or curl. CourseNana.COM

This is an open-ended assignment; if the following functionalities are implemented, it is your choice how to implement them. CourseNana.COM

You have to establish web services for an online book-shopping website. You do not have to create a proper HTML/CSS/JS-based website for this. CourseNana.COM

Consider the WS Architecture with THREE sections (Market, Seller 1, and Seller 2): CourseNana.COM

RATING ( pur_id *, user_id F, book_id F, review, rating) CourseNana.COM

PURCHASE ( pur_id *, user_id F, book_id *, qantity, price, seller_ip, date) CourseNana.COM

USER ( user_id *, balance, password, address, token, token_date) CourseNana.COM

VM1 CourseNana.COM

Book list WS CourseNana.COM

Search WS, Purchase WS, Post Rating WS, Recommend Book WS, Add Balance WS CourseNana.COM

VM1 CourseNana.COM

You have created the following web services: CourseNana.COM

Books ( book_id *, book_name, stock_qty, price_of_book) CourseNana.COM

i. Book list web service: This web service will return an XML/JSON response of what books are available from a seller. Each IP address you have will represent a seller. So, the seller’s book list can be determined by: CourseNana.COM

https://<ipaddress>/seller/booklist.php CourseNana.COM

You decide what you want to sell and prepare the list (at least 5 books). The XML file should look like this: CourseNana.COM

<root> CourseNana.COM

<book><bookid>100</book>
<bookname>Very legal book</bookname> <price>5</price>
CourseNana.COM

</book> CourseNana.COM

<book><bookid>120</book> <bookname>Something</bookname> <price>50</price> CourseNana.COM

</book> ... CourseNana.COM

</root> CourseNana.COM

OR in JSON: CourseNana.COM

[{ CourseNana.COM

}, { CourseNana.COM

}
...
CourseNana.COM

] CourseNana.COM

Create appropriate tables in your MySQL database and fill in your data. Then create the XML/JSON dynamically. Use appropriate content type. CourseNana.COM

Given an IP address, the book list is shown in the XML (or JSON) output in the web browser. CourseNana.COM

ii. Search for books WS: In this web service, you can pass a search parameter with any name, and if a book is found in any of the IP addresses, the details (book_id, name, price, seller_ip) are returned as an XML or JSON output in your web service. It should be sorted in ascending order concerning price. The seller_ip identifies a seller. An example of a URL for this WS: CourseNana.COM

         /book/search/:name CourseNana.COM

Fix a set of IP addresses to search as you wish. You should not access the database directly with this WS; you must consume the book list WS with guzzle or curl or file_get_contents. You can use your own VMs to set up at least two book lists. CourseNana.COM

If the book is found in two separate seller lists, you must merge the lists. But the purchase in the next step happens in only one VM. You have to manually copy-paste details from the search into the purchase service. CourseNana.COM

If you feel more adventurous, ask other students for their IP addresses with the book list (you may need to see the format they are using), but this is not required. CourseNana.COM

Hint: You must check more than one Fixed IP address within the same web service. CourseNana.COM

iii. Authorization Token WS: This web service will generate a token that is time limited by 10s. The token will be generated for users if they give the correct password. CourseNana.COM

/user/getToken/:user_id/:password CourseNana.COM

"book_id" : 100,
"bookname": "Very legal book", "price": 5
CourseNana.COM

"book_id" : 120, "bookname" : "Something", "price" : 50 CourseNana.COM

The token is then used in the Purchase, Add balance and Ratings WS along with the user_id. If the token is not valid or expired, the Purchase, Add balance and Ratings will return a 401 error. A token signifies a session for a WS. CourseNana.COM

iv. Purchase a book WS: This web service will take the parameters user_id, token, book_id, seller_ip, and quantity. An example of a URL for this WS, CourseNana.COM

/book/purchase/:user_id/:token/:book_id/:seller_ip/:quantity_req/ CourseNana.COM

It will reduce the user’s balance based on the price x quantity. The price and available quantity must be retrieved from the seller_ip’s book list from (i). The transaction will fail if there is an inadequate balance or available quantity. The output (purchase fail or successful purchase details) is returned in XML or JSON format, including the pur_id, if the purchase was successful. This adds a record to the purchase table, if successful. CourseNana.COM

You must create appropriate USER and PURCHASE tables for this. CourseNana.COM

v. Rating WS: This WS will take a review for a book from a user. The inputs are the pur_id, user_id, token, rating, review, and book_id. The data will be stored in a RATING table. One user can give only one Rating/Review for one book. If the purchase was not found in the PURCHASE table, then it returns an error. CourseNana.COM

/book/rating/:user_id/:token/:pur_id/:rating/:review/:book_id CourseNana.COM

vi. Recommend New Book WS: This web service will take a user_id and recommend a new book based on the purchase they have already made, and the rating provided by this user and other users for all the books. It may return an empty response if the user has read all the books. Otherwise, it will return an XML/JSON list of books in descending order of recommendation. The data will be taken from the RATING table. CourseNana.COM

           /book/recommend/:user_id CourseNana.COM

vii.Add Balance: This web service adds funds to the balance. It takes an amount, user_id and token to add to the balance. If zero is added, the current value is returned. Otherwise, the new value is returned. The return format should be XML or JSON. The data will be taken from or put into the USER table. CourseNana.COM

/balance/add/:user_id/:token/:addbalance CourseNana.COM

You can choose your style of XML or JSON response. But it should have the minimum information according to what is mentioned above. You must choose appropriate response codes 400, 404, 401, 503, etc. Explain your decision in the comments and the 2-page report. CourseNana.COM

Database: CourseNana.COM

Create your own database(s). Ideally, you should have different databases for each section, i.e., 3 in total. But if you cannot do this, you can put all tables in the same database. BUT ... a Web Service should ONLY access data from its corresponding tables (and/or database) in its section. CourseNana.COM

Typical outcomes: CourseNana.COM

You can prefill your databases with the BOOKS tables. Also, create USER and PURCHASE tables and prefill them with any data. You may prefill the RATINGS table with some values, but typically this will be filled while testing. CourseNana.COM

In your video, you will have to demonstrate the following: o Purchase 10-15 books. CourseNana.COM

o Leave 10-15 reviews.
o Get 5 recommendations for 5 different users. CourseNana.COM

Use POSTMAN as below by creating an endpoint for all the functions in your API. An example is shown below. CourseNana.COM

You may use JMeter to do the same, set up your own HTML forms for this or use curl. CourseNana.COM

Submission: CourseNana.COM

All PHP codes, XML/JSON, text files, .htaccess files, and SQL files as a zip and a 2-page report on MyLO. CourseNana.COM

Submit a video of the operation and everything in the marking scheme below. Also, explain your code. The video length should be around 15 mins. CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
University of Tasmania代写,Australia代写,KIT214代写,Intelligent and Secure Web Development代写,Web service代写,PHP代写,XML代写,CSS代写,Javascript代写,HTML代写,University of Tasmania代编,Australia代编,KIT214代编,Intelligent and Secure Web Development代编,Web service代编,PHP代编,XML代编,CSS代编,Javascript代编,HTML代编,University of Tasmania代考,Australia代考,KIT214代考,Intelligent and Secure Web Development代考,Web service代考,PHP代考,XML代考,CSS代考,Javascript代考,HTML代考,University of Tasmaniahelp,Australiahelp,KIT214help,Intelligent and Secure Web Developmenthelp,Web servicehelp,PHPhelp,XMLhelp,CSShelp,Javascripthelp,HTMLhelp,University of Tasmania作业代写,Australia作业代写,KIT214作业代写,Intelligent and Secure Web Development作业代写,Web service作业代写,PHP作业代写,XML作业代写,CSS作业代写,Javascript作业代写,HTML作业代写,University of Tasmania编程代写,Australia编程代写,KIT214编程代写,Intelligent and Secure Web Development编程代写,Web service编程代写,PHP编程代写,XML编程代写,CSS编程代写,Javascript编程代写,HTML编程代写,University of Tasmaniaprogramming help,Australiaprogramming help,KIT214programming help,Intelligent and Secure Web Developmentprogramming help,Web serviceprogramming help,PHPprogramming help,XMLprogramming help,CSSprogramming help,Javascriptprogramming help,HTMLprogramming help,University of Tasmaniaassignment help,Australiaassignment help,KIT214assignment help,Intelligent and Secure Web Developmentassignment help,Web serviceassignment help,PHPassignment help,XMLassignment help,CSSassignment help,Javascriptassignment help,HTMLassignment help,University of Tasmaniasolution,Australiasolution,KIT214solution,Intelligent and Secure Web Developmentsolution,Web servicesolution,PHPsolution,XMLsolution,CSSsolution,Javascriptsolution,HTMLsolution,