ajm
ajm

Reputation: 13213

Generating web service client in netbeans in web application using maven

I have a web application which has web services clients. When I right click on the client in netbeans I get option to edit web service attribute like below.

enter image description here

When I add maven to the same application, I do not get -wsimport options tab while editing the web service attributes. See following image.

enter image description here

Everything else is same in the application with just the maven used for dependency management in later application.

Please help.

Upvotes: 1

Views: 3490

Answers (1)

Charlee Chitsuk
Charlee Chitsuk

Reputation: 9059

The WSIMPORT is inside the Maven plugin named jaxws-maven-plugin. You may be noticed that the Netbeans automatically add it as a build plugin at your project POM file.

It can be configured in the Maven way as the following example: -

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>jaxws-maven-plugin</artifactId>
  <version>1.12</version>
  <executions>
    <execution>
      <goals>
        <goal>wsimport</goal>
      </goals>
      <configuration>
        <wsdlUrls>
          <wsdlUrl>http://MY_DOMAIN/MY_SERVICE?wsdl</wsdlUrl>
        </wsdlUrls>
        <packageName>com.my.package.ws</packageName>
      </configuration>
      <phase>generate-sources</phase>
    </execution>
  </executions>
  <dependencies>
    <dependency>
      <groupId>com.sun.xml.ws</groupId>
      <artifactId>jaxws-tools</artifactId>
      <version>2.2.5</version>
    </dependency>
  </dependencies>
  <configuration>
    <verbose>true</verbose>
    <sourceDestDir>${basedir}/src/main/java</sourceDestDir>
  </configuration>
</plugin>

You may see further information about the jaxws:wsimport and some usage example.

I hope this may help.

Regards,

Charlee Ch.

Upvotes: 2

Related Questions