1. Trang chủ
  2. » Công Nghệ Thông Tin

Web Service tutorials

10 258 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 10
Dung lượng 1,31 MB

Nội dung

Create a web service application with axis2.. Step 1:Create a dynamic web project with project name is AddServerServer Result project and create more two class as figure below :... Then

Trang 1

Web service

1 Create a web service application with axis2.

Note :Elipse must install axis2

Step 1:Create a dynamic web project with project name is AddServerServer

Result project and create more two class as figure below :

Trang 2

Step 2 :New->web service

Next :

Trang 3

Then click next->next ….

Do one again with Calculator.java class

Step 3:Run that project in server tomcat with links as below

Trang 4

Step 4 :Create a dynamic web project have name is AddServerClient similarly as at step 1

Step 5:Create 1 web server client

Trang 5

Bổ sung:

Trang 6

Do similarly with link :

http://localhost:1900/AddServerServer/services/HelloWorld?wsdl

Result :In project have name is AddServerClient created automatic four class

Trang 7

Step 5:create Test.java class to test.

package org.operator;

import java.rmi.RemoteException;

import org.operator.CalculatorStub.Add;

public class Test {

public static void main(String[] args) throws RemoteException{

//Print int type

CalculatorStub calculatorStub=new CalculatorStub();

Add add0=new Add();

add0.setA(10);

add0.setB(9);

System.out.println((calculatorStub.add(add0).get_return()));

//Print String type

HelloWorldStub helloWorldStub=new HelloWorldStub();

HelloWorldStub.SaidHello param=new HelloWorldStub.SaidHello(); param.setMsg("Ngô Văn Thảo");

HelloWorldStub.SaidHelloResponse response=helloWorldStub.saidHello(param);

System.out.println(response.get_return());

}

}

Trang 8

Step 6:Run in Java application.

Result in console :

19

Hello world Ngô Văn Thảo

Reference :

Video (Path : F:\Study\JAVA\Java Web\Web service\Video tutorial\ Create a web service +axis2+ java + Eclipse + tomcat.FLV)

Ngày đăng: 06/05/2014, 13:55

TỪ KHÓA LIÊN QUAN

w