Aggiunta client per il servizio SOAP
This commit is contained in:
4
.idea/compiler.xml
generated
4
.idea/compiler.xml
generated
@@ -9,10 +9,12 @@
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="cdidemo" />
|
||||
<module name="jpademo" />
|
||||
<module name="xmlandjsondemo" />
|
||||
<module name="beanvalidationdemo" />
|
||||
<module name="jmsdemo" />
|
||||
<module name="xmlandjsondemo" />
|
||||
<module name="jaxwsdemo-client" />
|
||||
<module name="jaxwsdemoservice" />
|
||||
<module name="jaxwsdemo-service" />
|
||||
<module name="ejbdemo" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
|
||||
1
.idea/encodings.xml
generated
1
.idea/encodings.xml
generated
@@ -4,6 +4,7 @@
|
||||
<file url="file://$PROJECT_DIR$/beanvalidationdemo" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/cdidemo" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/ejbdemo" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/jaxwsdemo-client" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/jaxwsdemo-service" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/jmsdemo" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/jpademo" charset="UTF-8" />
|
||||
|
||||
96
jaxwsdemo-client/pom.xml
Normal file
96
jaxwsdemo-client/pom.xml
Normal file
@@ -0,0 +1,96 @@
|
||||
<?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>
|
||||
<artifactId>jaxwsdemo-client</artifactId>
|
||||
<name>jaxwsdemo-client</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<artifactId>jeedemo</artifactId>
|
||||
<groupId>it.plague.jeedemo</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<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>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.main.extras</groupId>
|
||||
<artifactId>glassfish-embedded-all</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add-source</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>add-source</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>${project.build.directory}/generated-sources/wsimport/</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<configuration>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>it.plague.jeedemo.WebServiceConsumer</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jvnet.jax-ws-commons</groupId>
|
||||
<artifactId>jaxws-maven-plugin</artifactId>
|
||||
<version>2.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>wsimport</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<wsdlUrls>
|
||||
<wsdlUrl>
|
||||
http://localhost:8080/jaxwsdemo-service-1.0-SNAPSHOT/CardValidatorService?wsdl
|
||||
</wsdlUrl>
|
||||
</wsdlUrls>
|
||||
<keep>true</keep>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,20 @@
|
||||
package it.plague.jeedemo;
|
||||
|
||||
import javax.xml.ws.WebServiceRef;
|
||||
|
||||
public class WebServiceConsumer {
|
||||
|
||||
@WebServiceRef
|
||||
private static CardValidatorService cardValidatorService;
|
||||
|
||||
public static void main(String[] args) {
|
||||
CreditCard creditCard = new CreditCard();
|
||||
creditCard.setNumber("12341234");
|
||||
creditCard.setExpiryDate("10/12");
|
||||
creditCard.setType("VISA");
|
||||
creditCard.setControlNumber(1234);
|
||||
|
||||
Validator cardValidator = cardValidatorService.getCardValidatorPort();
|
||||
System.out.println(cardValidator.validate(creditCard));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user