Skip to content

Instantly share code, notes, and snippets.

@daoudabeye
Forked from uttesh/POM.xaml
Created February 17, 2017 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daoudabeye/d0b2f4fa7ea150c855580973be27a665 to your computer and use it in GitHub Desktop.
Save daoudabeye/d0b2f4fa7ea150c855580973be27a665 to your computer and use it in GitHub Desktop.
Maven for generating the web service client stub classes.
<?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>com.uttesh</groupId>
<artifactId>wsclient</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>1.9</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
<phase>generate-sources</phase>
</execution>
</executions>
<configuration>
<!-- Keep generated files -->
<keep>true</keep>
<!-- Package name -->
<packageName>org.example.echo.service.skeleton</packageName>
<!-- generated source files destination-->
<sourceDestDir>src/main/java</sourceDestDir>
<wsdlUrls>
<wsdlUrl>
https://ec.europa.eu/taxation_customs/tin/checkTinService.wsdl
</wsdlUrl>
</wsdlUrls>
</configuration>
</plugin>
</plugins>
</build>
</project>
package com.uttesh.wsclient;
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.ws.Holder;
import org.example.echo.service.skeleton.CheckTinPortType;
import org.example.echo.service.skeleton.CheckTinService;
/**
*
* @author Uttesh Kumar T.H.
*/
public class WsTest {
public static void main(String[] args) {
try {
CheckTinService checkTinService = new CheckTinService();
CheckTinPortType portType = checkTinService.getPort(CheckTinPortType.class);
Holder<String> code = new Holder<String>("DE");
Holder<String> tin = new Holder<String>("12346789");
Holder<XMLGregorianCalendar> requestDate = new Holder<>();
Holder<Boolean> validStructure = new Holder<>();
Holder<Boolean> validSyntax = new Holder<>();
portType.checkTin(code, tin, requestDate, validStructure, validSyntax);
System.out.println("requestDate : " + requestDate.value);
System.out.println("validStructure : " + validStructure.value);
System.out.println("validSyntax : " + validSyntax.value);
} catch (Exception e) {
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment