WebService发布服务例子
import javax.jws.WebMethod; import javax.jws.WebService; @WebService public interface WebServiceI { @WebMethod String sayHello(String name); }
import javax.jws.WebService; @WebService public class WebServiceImpl implements WebServiceI{ @Override public String sayHello(String name) { // TODO Auto-generated method stub return "你好-"+name; } }
发布
import javax.xml.ws.Endpoint; public class WebServicePublish { public static void main(String[] args) { String address = "http://192.168.1.53:12345/UserService/getService"; Endpoint.publish(address, new WebServiceImpl()); System.out.println("webService发布成功"); } }
http://cxf.apache.org/download.html下载cfx项目解压,配置系统环境
maven web项目里添加cfx
怎么调用这些方法参考 https://www.cnblogs.com/tk55/p/11298435.html
--------------------------------------------------------------------------------------------------------------------------------------------
作者:Honey_Badger —— 觉得这文章好,点一下左下角
出处:http://tk55.cnblogs.com/
posted on 2019-08-04 17:36 Honey_Badger 阅读(408) 评论(0) 编辑 收藏 举报