java WSDL接口webService实现方式
2017-04-27 11:13
696 查看
一、使用JDK生成WSDL的对象类
1、cmd进入JDK的bin文件中
执行命令 wsimport -keep -p com.demo.client http://localhost:8080/Demo/services/MyService?wsdl
比较常用的[options]有:
1). -d <directory>
在指定的目录生成class文件
2). -clientjar <jarfile>
在当前目录生成jar文件,结合-d <directory>可以在指定的目录生成jar文件
3). -s <directory>
在指定的目录生成java源文件
4). -p <pkg>
指定生成文件的包结构
5). -keep
在生成class文件,或者jar包时,同时保留java源文件
2、eclipse生成WSDL文件
在Eclipse中生成webservice客户端代码,New---->Other---->Webservice---->Webservice Client,选择之前拷贝到eclipse中的wsdl路径点击finish,这样eclipse就帮我们自动生成了webservice的客户端,接下来只需在程序中调用即可,在程序中调用 eclipse自动生成的webservice客户端;
3、MyEclipse 生成 WSDL 文件
在项目上右键,选择New->Other->Web Service->Web Service Client->Next,会看到以下界面:
4、WSDL Maven支持的jar包
1、cmd进入JDK的bin文件中
执行命令 wsimport -keep -p com.demo.client http://localhost:8080/Demo/services/MyService?wsdl
比较常用的[options]有:
1). -d <directory>
在指定的目录生成class文件
2). -clientjar <jarfile>
在当前目录生成jar文件,结合-d <directory>可以在指定的目录生成jar文件
3). -s <directory>
在指定的目录生成java源文件
4). -p <pkg>
指定生成文件的包结构
5). -keep
在生成class文件,或者jar包时,同时保留java源文件
2、eclipse生成WSDL文件
在Eclipse中生成webservice客户端代码,New---->Other---->Webservice---->Webservice Client,选择之前拷贝到eclipse中的wsdl路径点击finish,这样eclipse就帮我们自动生成了webservice的客户端,接下来只需在程序中调用即可,在程序中调用 eclipse自动生成的webservice客户端;
3、MyEclipse 生成 WSDL 文件
在项目上右键,选择New->Other->Web Service->Web Service Client->Next,会看到以下界面:
4、WSDL Maven支持的jar包
<dependencies> <!-- ==================== WSDL 依赖文件 start=================== --> <dependency> <groupId>org.apache.axis</groupId> <artifactId>axis</artifactId> <version>1.4</version> </dependency> <dependency> <groupId>commons-discovery</groupId> <artifactId>commons-discovery</artifactId> <version>0.5</version> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>javax.xml</groupId> <artifactId>jaxrpc</artifactId> <version>1.1</version> </dependency> <dependency> <groupId>javax.xml.soap</groupId> <artifactId>saaj-api</artifactId> <version>1.3.5</version> </dependency> <dependency> <groupId>wsdl4j</groupId> <artifactId>wsdl4j</artifactId> <version>1.6.3</version> </dependency> <!-- ==================== WSDL 依赖文件 end====================== --> </dependencies>
相关文章推荐
- java WSDL接口webService实现方式
- Java 调用C# webservice接口 生成java客户端 实现方式
- java调用webservice WSDL形式接口之apache axis方式调用(一)
- java调用webservice WSDL形式接口之apache axis方式调用(一)
- java调用webservice WSDL形式接口之apache axis方式调用(一)
- java调用webservice WSDL形式接口之apache axis方式调用(一)
- java cxf实现webservice接口方式之不依赖spring
- 将Java编写的WebService接口转换成WSDL文件(CXF)
- JAVA学习第二十三课(多线程(二))- (多线程的创建方式二 :实现Runnable接口(常用))
- JAVA 多线程的简单实现(runnable接口方式)
- Java常用类集接口以及实现方式总结
- java 用cxf方式实现的webservice,java客户端,C#客户端调用
- Java【多线程知识总结(5)】比较继承Thread类创建线程和实现Runnable接口创建线程这两种方式
- java简单实现webservice接口
- java 实现WebService 以及不同的调用方式
- java基础知识回顾之java Thread类--java线程实现常见的两种方式实现Runnable接口(二)
- 纯java实现简单的webservice方式
- 【Java多线程学习】Java多线程的两种实现方式:继承Thread类 & 实现Runable接口
- java 实现WebService 以及不同的调用方式
- Java 以post请求方式通过json格式调用Webservice接口