Skip to content

Instantly share code, notes, and snippets.

@KomanRudden
Last active August 29, 2015 14:23
Show Gist options
  • Save KomanRudden/d840697defb4ae353ac2 to your computer and use it in GitHub Desktop.
Save KomanRudden/d840697defb4ae353ac2 to your computer and use it in GitHub Desktop.
Apache CXF
If the above "wsdlLocation" doesn't work add "classpath:" before wsdl/adpetra.wsdl.
The above plugin creates the atrefact as below
@WebServiceClient(name = "Adeptra",
wsdlLocation = "wsdl/adeptra.wsdl",
targetNamespace = "http://www.adeptra.net/Adeptra/")
public class Adeptra_Service extends Service {
public final static URL WSDL_LOCATION;
public final static QName SERVICE = new QName("http://www.adeptra.net/Adeptra/", "Adeptra");
public final static QName AdeptraSOAP = new QName("http://www.adeptra.net/Adeptra/", "AdeptraSOAP");
static {
URL url = Adeptra_Service.class.getResource("wsdl/adeptra.wsdl");
if (url == null) {
url = Adeptra_Service.class.getClassLoader().getResource("wsdl/adeptra.wsdl");
}
if (url == null) {
java.util.logging.Logger.getLogger(Adeptra_Service.class.getName())
.log(java.util.logging.Level.INFO,
"Can not initialize the default wsdl from {0}", "wsdl/adeptra.wsdl");
}
WSDL_LOCATION = url;
}
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.7.5</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.directory}/generated-sources/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${project.basedir}/src/main/resources/wsdl/adeptra.wsdl</wsdl>
<wsdlLocation>wsdl/adeptra.wsdl</wsdlLocation>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment