0% found this document useful (0 votes)
10 views47 pages

Cloud Computing

The document outlines practical exercises for creating web services using Java and .NET, including a currency converter, SOAP services, REST services, and consuming Google’s search and map APIs. It also details the installation and configuration of virtualization using KVM on a Linux operating system. Each practical includes step-by-step instructions for setting up projects, writing code, and running services in a web browser.

Uploaded by

Kishan chauhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views47 pages

Cloud Computing

The document outlines practical exercises for creating web services using Java and .NET, including a currency converter, SOAP services, REST services, and consuming Google’s search and map APIs. It also details the installation and configuration of virtualization using KVM on a Linux operating system. Each practical includes step-by-step instructions for setting up projects, writing code, and running services in a web browser.

Uploaded by

Kishan chauhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 47

Practical No.

1
Aim:- Define a simple services like Converting Rs into
Dollar and Call it from different platform like JAVA
and .NET
Step 1 : - Create the new project for webservice using
java web application

Step 2:- Create the Project give the Project Name.


Step 3:- Select the Server for running web services in
web browser

Step 4:- We can see the server of framework for browser


the webservice.
Step 5:- Create the Web Service is name
CurrencyConverter and use the package name is server.

Step 6:- Create the web service for currencyconverter inr


to dollar.
Step 7:- Add the insert code for create a operation for inr
to dollar for use in web services.

Step 8:-Create the operation InrtoDollar converter.


Step 9:- Create the web service and run the web browser.

Step 10 :-Run the web service in web browser.


Step 11:- Create the input.jsp file the for input the web
service button and textbox the web page.
Step 12:- Create a Output.jsp file in create the web
service for client server in the web browser.

Step 13:- Run the browser in the web pages using input
and output.jsp for web services.
Practical No.2
Aim:- Create a Simple SOAP service.
Step 1:- Create the Project for web services in netbeans.

Step 2:- Give the Project name


Step 3:- In Project select the server in web browser run the
project.

Step 4:- Create the web services(HelloWorld.java) in project.


Step 5:- Create the web service(Soma.java) in project.

Step 6:- Edit the code in HelloWorld.java


Step 7:- Run the project.

Step 8:- Enter the Char and word the textbox.


Step 9:-Output of the webservices.

Step 10:- Edit the Soma.java First design in project.


Step 11:- Edit the code Soma.java in netbeans

Step 12:- Run and deploy after the output.


Step 13:- Enter the value in the textbox.

Step 14:- Output the entered value


Step 15:- Create the java project in javaclientw eb services.

Step 16:- Name of the project.


Step 17:- create a web service client

Step 18:- Edit the code of javaclientws.java file.


Step 19:-Run the File and output .
Practical No.3
Aim :- Create a Simple REST Service.
Step 1:- Create the Project for Web services in netbeans.

Step 2:-Rename the Project name.


Step 3:- Select the Server run project in the browser.

Step 4:- Create the restfull services in project file.


Step 5:- Create the packages in restfull services

Step 6:- Edit the code in Restful Services.


Step 7:- Run the RestFull Services inWeb Browser
Lowercase

Step 8:- UpperCase in Web Browser.


Practical No.4
Aim:- Develop application to consume Google’s search /
Google’s Map RESTful Web service.
Step 1:- Create the api in Going Google Cloud Console.

Step 2:- Create api key


Step 3:- Write the code in python file.
Code:-
import requests
import webbrowser
OPENWEATHER_API_KEY =
"c36d6cd315401c8670153667c752c675"
def get_location_details(city_name):
endpoint = "https://api.openweathermap.org/geo/1.0/direct"
params = {
'q': city_name,
'appid': OPENWEATHER_API_KEY,
}
response = requests.get(endpoint, params=params)
data = response.json()
if response.status_code == 200 and data:
return data[0]
else:
print(f"Error: {data[0].get('message', 'Unknown error') if
data else 'No data found'}")
return None
def open_google_map(lat, lon):
google_maps_url = f"https://www.google.com/maps?q={lat},
{lon}"
webbrowser.open(google_maps_url)
def main():
city_name = input("Enter the city name: ")
location_details = get_location_details(city_name)
if location_details:
print("\nLocation Details:")
print(f"Name: {location_details['name']}")
print(f"Country: {location_details['country']}")
print(f"Latitude: {location_details['lat']}")
print(f"Longitude: {location_details['lon']}")
open_map = input("Would you like to open this location on
Google Maps? (yes/no): ").lower()
if open_map == 'yes':
open_google_map(location_details['lat'],
location_details['lon'])
else:
print("Failed to retrieve location details.")

if __name__ == "__main__":
main()
Output:-
Practical No.5
Aim:- Installation and Configuration of virtualization using
KVM.
Software Tools Required
 Virtual Machine Monitor: VMware Workstation
 Operating System: Linux

Downloads Required:
 Virtual Machine Monitor: Download VMware
Workstation Pro 17.6.0 Build 24238078 for Windows |
Uptodown.com
 Operating System: Download Ubuntu Desktop | Ubuntu
(for Linux distribution of your choice)
Open Vmware Workstation and start the steps
Demonstration:
Create a New Virtual Machine >

Browse and place the ISO File

Provide full name as Practical5 and user name as example


and password and confirm password as linux
Give virtual machine name as KVM

Provide disk size: 16.0GB then click Next


Click on Customize Hardware
To enable KVM
Check the Virtualize Intel VT
Ubuntu, a linux Distribution system will load.
Ubuntu Setup:
1.Choose Language then click next
2.Then in Accessibility Tab Click next
3.Keyboard Layout As English US then next
4.Connect to Internet then next
5.Tick Install ubuntu then next
6.Interactive then Default Installation
7.Install Proprietary Software (tick both options)
8.Then Tick Erase disk and install ubuntu
9.Then Fill up the following details:

10.Then set the time zone and click next


Location: Mumbai
Timezone:Asia/Kolkata
11.Then Following window appears, Click Install
We get the following screen,

Click Restart.
Now login using your password.
II. KVM Setup Steps: Open Terminal

1. Update the System


sudo apt update && sudo apt upgrade -y
2. Check if Virtualization is Enabled:
sudo grep -c "svm\|vmx" /proc/cpuinfo
3. Verify KVM Virtualization
Check if KVM virtualization is enabled by running
command:
kvm-ok
If the kvm-ok command is not found, install the CPU
checker tool: sudo apt install cpu-checker
then type kvm-ok
Output should include:
INFO: /dev/kvm exists
KVM acceleration can be used.

4. Install KVM and Required Packages

sudo apt install qemu-kvm virt-manager libvirt-daemon-


system libvirt-clients bridge-utils -y

5. Enable the Virtualization Daemon Start and enable the


libvirt daemon:
sudo systemctl enable libvirtd
sudo systemctl start libvirtd

6. Check the Status of the Libvirt Daemon

Verify that the daemon is running:


sudo systemctl status libvirtd
7. Add Your User to KVM and Libvirt Groups
Replace your-username with your actual username and run
the following commands:
sudo usermod -aG kvm your-username
sudo usermod -aG libvirt your-username
8. Log Out and Re-login
Log out from your system and log back in to apply group
changes.

9. Run KVM Virtual Machine Manager


Search for "Virtual Machine Manager" in your system
applications and launch it.

10. Prepare to Create Virtual Machines


In Virtual Machine Manager, click Create a New Virtual
Machine to begin setting up virtual environments.
Now we can create new virtual machine from File>Create
New Virtual Machine
Then ,Select the os to install (eg/:windows, ubuntu etc)
Then

Then
Practical no.6
Aim:-

You might also like