Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (1.26 MB, 10 trang )
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 :
Step 2 :New->web service
Next :
Then click next->next ….
Do one again with Calculator.java class.
Step 3:Run that project in server tomcat with links as below.
Step 4 :Create a dynamic web project have name is AddServerClient similarly as at
step 1.
Step 5:Create 1 web server client.
Bổ sung:
Do similarly with link :
http://localhost:1900/AddServerServer/services/HelloWorld?wsdl
Result :In project have name is AddServerClient created automatic four class .
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();