Proper way to develop a WS client using JAX-WS and Maven's jaxws-maven-plugin
Hello,
I'm using "jaxws-maven-plugin" to generate WS stub classes, as shown below:
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>1.12</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<packageName>my.company.zte</packageName>
<wsdlUrls>
<wsdlUrl>http://192.168.14.31:9180/ZTE/ProvisionPortTypeService?wsdl</wsdlUrl>
</wsdlUrls>
<keep>true</keep>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
This plugin binds to the "install" phase of the lifecycle. Sources and class files are generated properly, however IntelliJ didn't recognize them in the editor. So I added the WS classes directory in Module Settings / Dependencies. However, IDE still gives me "Incompatible types" errors on occassions, e.g. in this one:
ProvisionPortType provisionPort = this.zteService.getProvisionPort()
gives "Incompatible types. Required my.company.zte.ProvisionPortType, found my.company.zte.ProvisionPortType"
Am I doing something wrong here? Is this the proper way to do this?
请先登录再写评论。