Вы находитесь на странице: 1из 10

FACULTY OF COMPUTER SCIENCE AND

INFORMATION TECHNOLOGY

COURSE NAME

: TECHNOLOGY OF WEB

COURSE CODE

SERVICES
: BIW 20404 (SECTION 1)

PROGRAMME

: 2 BIW

INSTRUCTOR
NAME OF

: SITI SALWANI BINTI YAACOB


: VIMEL RAJ A/L

STUDENTS

MUNIESBARARAJAN

CI
130121

Java Web Service Using Eclipse

Application Development steps


a. Create a Dynamic Web Project

Figure 1.1
To create a new project, select File->New->Dynamic Web Project from the menu bar of the
Eclipse IDE.

BIW20404 WEB SERVICE

Page 2

Java Web Service Using Eclipse

Figure 1.2
Next we need to specify the name for the web service project as shown in figure 1.2. Then give a
project name and select a target runtime (Apache Tomcat v8.0) and leave all other default values
and click next to finish.
BIW20404 WEB SERVICE

Page 3

Java Web Service Using Eclipse

b. Create Web Service Provider Java Class

BIW20404 WEB SERVICE

Page 4

Java Web Service Using Eclipse

Figure 1.3
Create a new package under Java Resources -> src named bmi. Then, create a new java class
under that package. This is the web services service provider class.

BIW20404 WEB SERVICE

Page 5

Java Web Service Using Eclipse

Figure 1.4
Use the code in figure 1.4 for the service. This is a simple service which will return the bmi value
based on the argument passed. Save all the work and with this step everything is over. The
Eclipse IDE it will take care of all the remaining work like creating web service, generating
wsdl, skeleton, service client, stub and etc.

BIW20404 WEB SERVICE

Page 6

Java Web Service Using Eclipse

c. Create Web Service

Figure 1.5
To create a web service using this java class, right click on Java Resources -> New and select
Web Service under Web Services folder from the wizard. Click Next button.

BIW20404 WEB SERVICE

Page 7

Java Web Service Using Eclipse

Figure 1.6
In this Web Service wizard, use the browse button and select the java class written earlier. This is
our service implementation java class. Then, drag the slider bar to upper most in both service and
client part. Then, enable the Publish the Web service check box.

BIW20404 WEB SERVICE

Page 8

Java Web Service Using Eclipse

Figure 1.7
Click next till the Server Starup wizard and then click Start Server. This step will start the
associated runtime Tomcat. Just wait for this step to complete and we will be able to see the web
service client application generated

BIW20404 WEB SERVICE

Page 9

Java Web Service Using Eclipse

d. Test Client

Figure 1.8
Figure 1.8 shows the web service application which has been successfully generated. You can now test
your web service and see if it is working according to the way you want it.

BIW20404 WEB SERVICE

Page 10