简单CXF操作(一)
2016-01-21 15:41
253 查看
服务器端
接口
命令:wsdl2java -client -p test.cxf.client -d e:/ http://localhost:8080/hellocxf?wsdl
生成客户端,放到项目里,运行xxxx_Client.java,可看到运行结果
生成的客户端的java文件:
所用jar包
接口
package test.cxf.server; import javax.jws.WebService; @WebService public interface HelloCXF { public String say(String name); }实现
package test.cxf.server; import javax.jws.WebService; @WebService(endpointInterface="test.cxf.server.HelloCXF") public class HelloCXFImpl implements HelloCXF { public String say(String name) { String str="hello,"+name+",this is my first cxf!"; return str; } }发布
package test.cxf.server; import javax.xml.ws.Endpoint; public class ServerMain { public static void main(String[] args) { HelloCXFImpl implementor = new HelloCXFImpl(); String address = "http://localhost:8080/hellocxf"; Endpoint.publish(address, implementor); System.out.println("started"); } }
命令:wsdl2java -client -p test.cxf.client -d e:/ http://localhost:8080/hellocxf?wsdl
生成客户端,放到项目里,运行xxxx_Client.java,可看到运行结果
生成的客户端的java文件:
所用jar包
相关文章推荐
- MySQL存储过程的动态行转列
- websphere建立概要时指定端口号
- HDFS 设计目标
- Unreal Engine4学习笔记--2制作别人可以加入的多人游戏
- shell小记:lsdev
- Multiple Return Values
- COM组件 IDispatch 及双接口的调用
- android APP清除缓存功能
- c++ 封装 (下)
- Android学习历程7-Activity详解
- android代码集锦
- 关于tomcat部署应用的三种方式
- arp包win32下链接出错问题
- variadic functions
- Hadoop 2.0 – HA功能中ZKFC对NN状态的控制
- 装饰者模式
- AndroidManifest.xml配置文件详解
- Android Studio 图片资源引用杂谈
- HDU4349--Xiao Ming's Hope(数论)
- sql的case when;以及在thinkphp中的使用