29
Ex.No:03 CREATION OF WEB SERVICE CLIENT FOR FINDING FACTORIAL NUMBER AIM: To create a web service client for finding factorial of given number using Net Beans 7.3.1. PROCEDURE: 1. In the Net Beans7.3.1 IDE create a project for factorial in server side using file->new project. 2. After creating the project right click the project and select new->web service 3. Then right click the web service name and select add operation. 4. Include all variable and the data type then click ok. 5. Then write the code for factorial. 6. After again create a project for factorial in client side using file->new project. 7. After creating the project right click the project and select new->web service client. 8. Then browse and choose the factorial server project then click ok. 9. Again right click the client project and choose new->jsp file then give the name for jsp file. 10. In the JSP file right click and choose web service client resource->call web service operation. 11. Then select server project click ok. 12. In the index file create a form and include jsp file as action.

Lab Programs

Embed Size (px)

DESCRIPTION

Lab Programs

Citation preview

Ex.No:03 CREATION OF WEB SERVICE CLIENT FOR FINDING FACTORIAL NUMBERAIM: To create a web service client for finding factorial of given number using Net Beans 7.3.1. PROCEDURE:

1. In the Net Beans7.3.1 IDE create a project for factorial in server side using file->new project.

2. After creating the project right click the project and select new->web service

3. Then right click the web service name and select add operation.

4. Include all variable and the data type then click ok.

5. Then write the code for factorial.

6. After again create a project for factorial in client side using file->new project.

7. After creating the project right click the project and select new->web service client.

8. Then browse and choose the factorial server project then click ok.

9. Again right click the client project and choose new->jsp file then give the name for jsp file. 10. In the JSP file right click and choose web service client resource->call web service operation. 11. Then select server project click ok.

12. In the index file create a form and include jsp file as action.

13. Finally deploy the client project and run the file to get the output.

PROGRAM:Fact.java package fact;

import javax.jws.WebMethod;

import javax.jws.WebParam;

import javax.jws.WebService;

@WebService()

public class Fact {

@WebMethod(operationName = "f1")

public int f1(@WebParam(name = "a")

int a) {

int fact=1;

for(int i=1;i