idea生成wsdl客户端文件

1.idea安装插件 Jakarta EE: Web Services ​(JAX-WS)​
idea生成wsdl客户端文件_第1张图片

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>
  1. 选择生成代码的文件,点击Tools->XML Webservice and WSDL->Generate Java Code
    idea生成wsdl客户端文件_第2张图片

4.填写wsdl访问路径及生成文件的包名,点击ok生成相关文件
idea生成wsdl客户端文件_第3张图片
5.编写代码进行调用

URL endpoint = new URL("http://ip:端口/xxxx");
WSExportMaterialFacadeSrvProxy materialFacadeSrvProxy = new WSExportMaterialFacadeSrvProxyServiceLocator().getWSExportMaterialFacade(endpoint);
Object[] matetialData = materialFacadeSrvProxy.exportMatetialData(0,1000);
System.out.println(matetialData);

你可能感兴趣的:(intellij-idea,java,ide)