CC - 753 All Practical
CC - 753 All Practical
CC - 753 All Practical
754
Practical No: 01
Aim:Create a soap web service to convert Celsius temperature to Fahrenheit and vice
versa with Java client.
Practical:
Make sure that you have Netbeans version 8.2 and selected “Glassfish Server 4.1” as
a server:
Step1: Open netbeans → Create a new project file → Java Web → Web Application.
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Tempwebservice code:
Step 7: Right click on the screen → Insert Code → Add Web Service
Operation
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Step 8: Create the parameter for FtoC i.e a Create the parameter for CtoF i.e b
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Step 10: Right Click on your Web service File → Test Web Web Service
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Step 12: In the 'Categories' section → Web Services → WebService Client → Next
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Step 14: Right Click on your project → select new → jsp → Name it as index → Finish.
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Step 15: Right Click on your project → select new → jsp → Name it as indexaction →
Finish
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Step 18: Right Click on project → New →Other → Web Services → Web Service Client
Step 19: Browse the tempwebservice in Project and in Package write tycs1
Step 20: Now on running the index.jsp file → you should be greeted with this browser
popup:
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Practical No: 02
Aim: Create a soap web service to convert celsius temperature to fahrenheit and vice
versa using python client.
Input:
Output:
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Practical No: 03
Aim: Create a soap service to convert Dollar to INR and vice versa using java client
Practical:
Step 1: Open netbeans → Create a new project file → Java Web → Web Application.
Step 2: Right on the project i.e P3 → New → Web Service and name it → Finish
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Step 6: Browse Web Services and give package name also → Finish.
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
INRtoDOLL code
Step 7: Right click on the screen → Insert Code → Add Web Service Operation
Step 8: Create the parameter for INRtodoll i.e INR → Ok
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Step 11: Now on running the input.jsp file → you should be greeted with this browser popup
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Practical No: 04
Aim: Create a soap service to convert Dollar to INR and vice versa using python client
Input:
Output:
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Practical No: 05
Aim: Create a web service to perform a CRUD operation (Player database)
Practical:
(REFERENCE: Creating RESTful Web Services in NetBeans 7 : Part 1 (oracle.com) and
Creating RESTful Web Services in NetBeans 7: Part 2 (oracle.com))
On NetBeans v8, go to the services tab, expand Databases and right-click Java DB
and Start Server:
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Create a table and add a few columns with 1 primary column in playerDB
Created table:
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Now to add the data, right click on a table and click view data:
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Now create Server project, by New project > other > Java web > web application:
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Select New Data Source > select your jdlc database and name it whatever you want:
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Now your tables should appear on the left side, to add them to your web application,
click on “Add all”:
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
You can verify your RESTful databases are added by checking your newly created
package:
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
After testing, you can deploy your package to glassfish: right click on project🡪deploy
Now create a new Java application and make sure to uncheck “Create Main Class”:
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Now generate Entity classes from database by right-clicking the new java application
and selecting new > entities classes from database:
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Now we can begin executing CRUD operations, from New > Other > Web Service >
New RESTful Java Client:
For Create:
Code:
public static void main(String args[]) throws IOException
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
{
CreatePlayerJerseyClient client1=new CreatePlayerJerseyClient();
Response response=client1.findAll_XML(Response.class);
Output:
For Read:
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Code:
public static void main(String args[]) {
GetPlayerJerseyClient client1 = new GetPlayerJerseyClient();
// Use the correct class for Response, and make sure to handle the response properly
Response response = client1.findAll_XML(Response.class);
// Use the correct GenericType
GenericType<List<Player>> genericType = new GenericType<List<Player>>() {};
// Check if the response is successful before extracting the data
if (response.getStatus() == Response.Status.OK.getStatusCode());
if (response.getStatus() == Response.Status.OK.getStatusCode()) {
List<Player> data = response.readEntity(genericType);
System.out.println("Retrieving and Displaying Players Details");
for (Player player : data) {
System.out.println("FirstName: " + player.getFirstname());
System.out.println("PlayerID: " + player.getId());
System.out.println("Jerseyno: " + player.getJerseynumber());
System.out.println("LastName: " + player.getLastname());
System.out.println("Last Spoken Words: " + player.getLastspokenwords());
System.out.println();
}
} else {
// Handle the case where the response is not successful
System.err.println("Error fetching data from the server. Status: " + response.getStatus());
}
}
}
Output:
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
For Update:
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Original Entry:
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
System.out.println("FirstName: "+player.getFirstname());
System.out.println("PlayerID: "+player.getId());
System.out.println(" Jerseyno: "+player.getJerseynumber());
System.out.println("LastName: "+player.getLastname());
System.out.println("Last Spoken Words: "+player.getLastspokenwords());
}
else{
System.err.println("Error found, Status: "+ response.getStatus());
}}
Output:
For Delete:
Code for Delete:
public static void main(String args[])throws IOException {
DeletePlayerJerseyClient client1=new DeletePlayerJerseyClient();
client1.remove("6"); //ID
}
Output:
Practical No: 06
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Aim: Develop Micro-blogger application (like Twitter) using RESTful Web services.
Step 2: Right click on Java DB → Create Database →Enter Name & Password
Step 3: After above steps database is created → Right Click on Created Database →
Connect
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Step 6: Add Column and name as Message_ID Step 7: Add Column Username
and check the Primary key and Unique → OK
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Step 13: File → New Project → Java Web → Web Application → Next → Project Name →
Next → Finish
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Step 15: Right Click on Project → Web Services → RESTful Web Services from Database
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Step 16: Select New data Source → Give JNDI Name → Select the database connection →
Ok
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Step 20: Select Web Test Client in Project → Browse and Select the Project → Ok → Ok
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
CreateMessage
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
CreateMessage Code
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Output:
GetMessage
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
GetMessage Code:
Output:
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
UpdateMessage
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
UpdateMessage Code:
Output:
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
DeleteMessage
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
DeleteMessage Code:
Output:
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Practical No: 07
Step 2: After clicking on get started for free write → Create New Project
https://console.cloud.google.com/welcome/new
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
MapController Code:
package com.example.demo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class MapController {
@GetMapping("/showMap")
public String index() {
return "index";
}
}
Step 10: Click on Project → New → File → Name the File → Finish
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
index.html
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
<html>
<head>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load("current", {
"packages":["map"],
// Note: you will need to get a mapsApiKey for your project.
// See: https://developers.google.com/chart/interactive/docs/basic_load_libs#load-settings
"mapsApiKey": "AIzaSyAtmIGVfCB_Uk-t6dHIDBDBoDtf7T4wdqw"
});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Lat', 'Long', 'Name'],
[19.0760, 72.8777, 'Mumbai'],
[18.5204, 73.8567, 'Pune'],
[19.1176, 72.9060, 'Powai'],
]);
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Output:
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Output:
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Practical No: 08
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Output:
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Practical No: 09
Practical:
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Step 4: run
sudo add user username libvirt
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Step 8: Click on the top left icon to create a New Virtual Machine
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Step 10: Set the path to the ISO file installed into Ubuntu
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Step 11: To add iso file copy the file from windows to ubuntu system , drag and drop from
windows files explorer to ubuntu file explorer
If it does not work then power off the ubuntu and go to view /Customise/:Library
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Step 13: Select the system you created and go to edit virtual machine settings and go to
options and Guest Isolation check the Drag and Drop checkbox and now try to drag and drop
the iso file
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Step 14: Select the amount of RAM and CPU cores to allocate to the new VM
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Step 16: Lastly set the name you want your VM to be known by
Step 17: After setting up, it will open after initial installation
Cloud Computing
TY BSc CS SEM VI ROLL NO. 754
Cloud Computing