当前位置: 移动技术网 > IT编程>软件设计>领域驱动 > WebService发布服务例子

WebService发布服务例子

2019年08月04日  | 移动技术网IT编程  | 我要评论
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

 

 

 


 

 


 

怎么调用这些方法参考

 

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网