idea生成wsdl客户端文件
1.idea安装插件 Jakarta EE: Web Services (JAX-WS)
2.新建java maven项目,pom文件加入相关依赖文件
<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.编写代码进行调用
URL endpoint = new URL("http://ip:端口/xxxx");
WSExportMaterialFacadeSrvProxy materialFacadeSrvProxy = new WSExportMaterialFacadeSrvProxyServiceLocator().getWSExportMaterialFacade(endpoint);
Object[] matetialData = materialFacadeSrvProxy.exportMatetialData(0,1000);
System.out.println(matetialData);