You are on page 1of 3

WEB SERVICE SECURITY LAB

Student Name: Tushar Chouhan UID: 18BCS3051


Branch: CSE Section/Group: IS-11(c)
Semester: 7th Date of Performance:
Subject Name: WEB SERVICE SECURITY LAB Subject Code: CSB-422

1. Aim: The program to create a simple web service that converts the temperature from
Fahrenheit to Celsius (using HTTP Post Protocol)

2. SOFTWARE/APPARATUS REQUIRED: - Net Beans, Personal computer.

3. Task to be done:Here in this Practical we create a simple Web Service Hello Service to check how the
temperature is converted using different method used in a Testing.java program

4. CODE OF PROGRAM:
package org.me.temperature;

import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;

/**
*
* NehaPuri
* 17BCS1671
*/
@WebService(serviceName = "TempConvertWS")
public class TempConvertWS {

/**
* This is a sample web service operation
*/
@WebMethod(operationName = "FtoC")

public float FtoC(@WebParam(name = "parameter") float faren)


{

float cel = (float)5/9*(faren-32);

return cel;

}
5. OUTPUT

6. Writing Summary:

·      
  Web Service: A Service which is used over the web is known as web service.A web service is any piece of
software that makes itself available over the internet and uses a standardized XML messaging system. XML
is used to encode all communications to a web service.
·        WSDL file: WSDL is an XML format for describing network services as a set of endpoints operating
on messages containing either document-oriented or procedure-oriented information. The operations and
messages are described abstractly, and then bound to a concrete network protocol and message format to
define an endpoint
·       Here we will see how the two different methods work that is celciusToFarenheit and
farenheiToCelcius and see there functioning over the local server Apache Tomcat
6. Learning outcomes (What I have learnt):
1. From this I have learned that how to make our own methods to be used in web service according to
our requirement and use their functionalities
2. To know about the WSDL file and mapping of each parameters
3. To easily convert the temperature from Celcius to Farenheit and Vice versa.

You might also like