myeclipse web service 示例(java project 转 web service)

来源:互联网 发布:linux rm -rf 作死 编辑:程序博客网 时间:2024/05/21 13:57

RClient server

1、新建Web Service Project

输入项目名RClientWS


finish。

2、从RClient项目中拷贝需要的包及引用到的jar包到RClientWS中:


选中src,右键--new--other,新建web service



选择要共享的类:



将RClientWS项目部署到tomcat


运行该项目


浏览器中输入http://127.0.0.1:8080/RClientWS/PublicClientPort,测试


server端完成

RClient client

本机使用:

选中src,右键-new-other,新建web service client




输入上面的WSDL:http://127.0.0.1:8080/RClientWS/PublicClientPort?wsdl




finish即可。

测试

新建测试类ClientTest测试:



其他机器使用

使用时和本机差不多,只需在建Web service Client 时 ,WSDL URL 输入http://serverip:8080/RClientWS/PublicClientPort?wsdl 即可(注意server端防火墙)。




原创粉丝点击