1.eclipse创建webservice服务
1.1 创建一个web project
[img]http://dl2.iteye.com/upload/attachment/0123/1183/95f75462-b31e-303c-a9fe-c5f6dc2c3b79.png[/img]
[img]http://dl2.iteye.com/upload/attachment/0123/1185/fbbbe9d6-4017-3335-835e-910ed2f0ea8f.png[/img]
1.2 新建包com.bill.ws,并新建简单的类HelloWorld
结构图如下:
[img]http://dl2.iteye.com/upload/attachment/0123/1205/b2fa32d8-6d74-330c-98a2-26bee9f50667.png[/img]
1.3 将应用部署到tomcat下,并启动
[img]http://dl2.iteye.com/upload/attachment/0123/1207/2e17cbe5-2b5a-3068-930d-2e7d3a89dc7c.png[/img]
1.4 为HelloWorld.java创建webservice
[img]http://dl2.iteye.com/upload/attachment/0123/2788/06eec5e0-1da9-3ab1-8b41-d95c46fc75d5.png[/img]
[img]http://dl2.iteye.com/upload/attachment/0123/1211/5dad8760-4c1b-35f6-a130-d635c90b508c.png[/img]
[img]http://dl2.iteye.com/upload/attachment/0123/1215/1805c7fd-ebec-3469-bfca-337476e29e91.png[/img]
[img]http://dl2.iteye.com/upload/attachment/0123/1221/95068875-b552-317a-bbf5-eb7c023d03d1.png[/img]
[img]http://dl2.iteye.com/upload/attachment/0123/1223/40adc922-698d-36e5-857f-2432f278fda2.png[/img]
1.5 测试webservice是否创建成功
[img]http://dl2.iteye.com/upload/attachment/0123/1225/b6f2942e-8af2-3e6e-9a80-c62c93e5ff9d.png[/img]
点击sayHello链接
[img]http://dl2.iteye.com/upload/attachment/0123/1227/89018ba9-31fb-377d-8cea-43dc0083d736.png[/img]
输入名称并点击go测试
[img]http://dl2.iteye.com/upload/attachment/0123/1229/4d105294-cd94-3d56-a9de-8b4968b4289c.png[/img]
返回成功
1.1 创建一个web project
[img]http://dl2.iteye.com/upload/attachment/0123/1183/95f75462-b31e-303c-a9fe-c5f6dc2c3b79.png[/img]
[img]http://dl2.iteye.com/upload/attachment/0123/1185/fbbbe9d6-4017-3335-835e-910ed2f0ea8f.png[/img]
1.2 新建包com.bill.ws,并新建简单的类HelloWorld
package com.bill.ws;
public class HelloWorld {
public String sayHello(String name) {
return "Hello " + name;
}
}
结构图如下:
[img]http://dl2.iteye.com/upload/attachment/0123/1205/b2fa32d8-6d74-330c-98a2-26bee9f50667.png[/img]
1.3 将应用部署到tomcat下,并启动
[img]http://dl2.iteye.com/upload/attachment/0123/1207/2e17cbe5-2b5a-3068-930d-2e7d3a89dc7c.png[/img]
1.4 为HelloWorld.java创建webservice
[img]http://dl2.iteye.com/upload/attachment/0123/2788/06eec5e0-1da9-3ab1-8b41-d95c46fc75d5.png[/img]
[img]http://dl2.iteye.com/upload/attachment/0123/1211/5dad8760-4c1b-35f6-a130-d635c90b508c.png[/img]
[img]http://dl2.iteye.com/upload/attachment/0123/1215/1805c7fd-ebec-3469-bfca-337476e29e91.png[/img]
[img]http://dl2.iteye.com/upload/attachment/0123/1221/95068875-b552-317a-bbf5-eb7c023d03d1.png[/img]
[img]http://dl2.iteye.com/upload/attachment/0123/1223/40adc922-698d-36e5-857f-2432f278fda2.png[/img]
1.5 测试webservice是否创建成功
[img]http://dl2.iteye.com/upload/attachment/0123/1225/b6f2942e-8af2-3e6e-9a80-c62c93e5ff9d.png[/img]
点击sayHello链接
[img]http://dl2.iteye.com/upload/attachment/0123/1227/89018ba9-31fb-377d-8cea-43dc0083d736.png[/img]
输入名称并点击go测试
[img]http://dl2.iteye.com/upload/attachment/0123/1229/4d105294-cd94-3d56-a9de-8b4968b4289c.png[/img]
返回成功