Last active
August 28, 2019 22:50
Maven for generating the web service client stub classes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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