Eclipse + Axis 編寫WebService

環境:Eclipse 4.7 + Axis + Tomcat8.5java

1、建立Dynamic Web Project並編寫HelloService.java瀏覽器

package com.demo.axistest.service;

public class HelloService {

	public String sayHello(String name) {
		return "Hello, " + name;
	}
}

2、右鍵項目-New-Others,選擇Web Servicecode

在Service Implementation填入HelloService的路徑,以下圖圖片

輸入圖片說明

啓動Serverip

輸入圖片說明

3、在瀏覽器中輸入http://localhost:8080/axistest/services,就能夠看到發佈的Web Service了get

輸入圖片說明

相關文章
相關標籤/搜索