You are on page 1of 28

Practical 1

Aim: Define a simple services like Converting Rupees into Dollar and Call it from different platform
like JAVA and .NET

Steps:

Step 1: Start NetBeans

Step 2: Go to file -> new project -> java web (select) -> web application > Name it > Add GlassFish
Server 4.1

Step 3: After that Next and give the project name and finish > (you’ll get index.html, delete that file)

Step 4: Right click on the project name page-> new-> Web Service.
Step 5: Give the web service name and package name -> finish

Step 6: A java file will be generate in that > right click >insert code > add web service operation
Step 7: Run the project and then test the web service > (the browser will open).
Step 8: Now we’ll be using the created Web Service by creating our web service client. So, Right Click
on Project Name > New > Other > Web Services > Web Service Client…>Browse your Project Name
and select WSDL file > Add Package Name > Finish.

Step 9: Now to make front page, we need to create a JSP file. So, Right Click on Project Name > New
> JSP > File Name: index > Finish.
Step 10: Create another JSP file and named it as indexaction.
Step 11: Now, drag the both currency port one by one and drop on the indexaction.jsp file.

Step 12: Run the index.jsp file.


Practical 2

Aim: Create a Simple SOAP service.

Steps:

Step 1: Start NetBeans

Step 2: Go to file -> new project -> java web (select) -> web application > Name it > Add GlassFish
Server 4.1

Step 3: After that Next and give the project name and finish > (you’ll get index.html, delete that file)

Step 4: Right click on the project name page-> new-> Web Service.
Step 5: Give the web service name and package name -> finish

Step 6: A java file will be generate in that > right click >insert code > add web service operation
Step 7: Run the project and then test the web service > (the browser will open).
Step 8: Now we’ll be using the created Web Service by creating our web service client. So, Right Click
on Project Name > New > Other > Web Services > Web Service Client…>Browse your Project Name
and select WSDL file > Add Package Name > Finish.

Step 9: Now to make front page, we need to create a JSP file. So, Right Click on Project Name > New
> JSP > File Name: index > Finish.
Step 10: Again create a JSP file with named as indexaction.jsp and drag the both temp port one by
one and drop on the indexaction.jsp file.

Step 11: Run the index.jsp file.


Practical 3

Aim: Create a simple RESTful services.

Steps:

1. Create a new web application in Java netbeans.

2. Name the project.

3. Click on next.
4. Click on finish.

5. Create an entity class


6. Insert code after set id property
7. Add property for student name as mentioned below
9. Add JSF pages from the entity class
10. Now add RestFul web services from entity class as shown below in the image.
11. Now deploy and run the project (make sure Oracle is shut on port 8080)
12. Conclusion: we have successfully defined a RESTful web service that accepts the details to be
stored in a database and performs CRUD operations. We are not storing data in DBMS we are just
accepting in the list as we have to accept details.
Practical 4

Aim: Develop application to consume Google’s search / Google’s Map RESTful Web service.

Steps:

Step 1: Start NetBeans

Step 2: Go to file -> new project -> java web (select) -> web application > Name it > Add GlassFish
Server 4.1

Step 3: After that Next and give the project name and finish
Step 4: Now, create JSP file.
Step 5: Before running the application we need the Google API key:- Visit Google APIs Console
(https://console.developers.google.com, you havetologinwith your Google account).

Step 6: Create a new API Project.

Step 7: - Enter the name to your project.


Step : - Enable the Google Maps API V3 (in library).
Step 9: Create another JSP file as index.jsp

Code for index.jsp:

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>

<html>

<head>

<style>

#map {

height: 400px;

width: 100%;

</style>

</head>

<body>

<%

double lati=Double.parseDouble(request.getParameter("t1"));

double longi=Double.parseDouble(request.getParameter("t2"));

%>

<h3> Google Maps </h3>

<div id="map"></div>

<script lang="javascript">

function initMap() {

var info={lat: <%=lati%>, lng: <%=longi%>};

var map = new google.maps.Map(document.getElementById('map'),

zoom: 4, center: info

});

var marker = new google.maps.Marker({

position: info,

map: map

});

}
</script>

<script async defer

src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBT9WoyDPR5oTMl-BoG1sf7OuW2BZZX-
00&callback=initMap">

</script>

</body>

</html>

Step 10: Run the Input.jsp file.


Practical 5

Aim: Installation and Configuration of virtualization using KVM.

You might also like