Skip to content

Instantly share code, notes, and snippets.

@gbzarelli
Last active October 23, 2018 13:29
Show Gist options
  • Save gbzarelli/1dfb0491eadcb552cc5b59e368828192 to your computer and use it in GitHub Desktop.
Save gbzarelli/1dfb0491eadcb552cc5b59e368828192 to your computer and use it in GitHub Desktop.
Como consumir um WSDL com o Maven / Generating a client from WSDL
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.helpdev</groupId>
<artifactId>TestWSDLConsumer</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<!-- Plugin para gerar e consumir um WSDL -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<packageName>br.com.helpdev.webservice</packageName>
<wsdlUrls>
<wsdlUrl>http://helpdev.com.br/test/Operations?wsdl</wsdlUrl>
</wsdlUrls>
</configuration>
</execution>
<!-- Para configurar outro WSDL em package diferente no mesmo projeto basta inserir outro execution -->
</executions>
<configuration>
<sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsimport</sourceDestDir>
<xnocompile>true</xnocompile>
<verbose>true</verbose>
<extension>true</extension>
<catalog>${basedir}/src/jax-ws-catalog.xml</catalog>
</configuration>
<!-- if you want to use a specific version of JAX-WS, you can do so like this -->
<dependencies>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-tools</artifactId>
<version>2.2.5</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment