1.idea安装插件 Jakarta EE: Web Services (JAX-WS)
2.新建java maven项目,pom文件加入相关依赖文件文章来源:https://www.toymoban.com/news/detail-618231.html
<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.2</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.3</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>
- 选择生成代码的文件,点击Tools->XML Webservice and WSDL->Generate Java Code
4.填写wsdl访问路径及生成文件的包名,点击ok生成相关文件
5.编写代码进行调用文章来源地址https://www.toymoban.com/news/detail-618231.html
URL endpoint = new URL("http://ip:端口/xxxx");
WSExportMaterialFacadeSrvProxy materialFacadeSrvProxy = new WSExportMaterialFacadeSrvProxyServiceLocator().getWSExportMaterialFacade(endpoint);
Object[] matetialData = materialFacadeSrvProxy.exportMatetialData(0,1000);
System.out.println(matetialData);
到了这里,关于idea生成wsdl客户端文件的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!