Web Service tutorials

10 257 0
Web Service tutorials

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

Thông tin tài liệu

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(); 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()); } } 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

Mục lục

  • 1. Create a web service application with axis2.

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan