Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Talend/tesb-rt-se
Browse files Browse the repository at this point in the history
  • Loading branch information
ilazebny committed Sep 26, 2012
2 parents 4756ed9 + 69d70d2 commit 579e6a5
Show file tree
Hide file tree
Showing 13 changed files with 404 additions and 0 deletions.
53 changes: 53 additions & 0 deletions examples/cxf/dev-guide-java-first/client/pom.xml
@@ -0,0 +1,53 @@
<?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/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.talend.cxf-examples.java-first-tutorial</groupId>
<artifactId>java-first-tutorial</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>java-first-tutorial-client</artifactId>
<name>-- SOAP Client</name>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>org.talend.cxf-examples.java-first-tutorial</groupId>
<artifactId>java-first-tutorial-service</artifactId>
<!-- Classifier below used with Maven Assembly Plugin to specify
subset of above artifact needed. -->
<classifier>jaxws</classifier>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>java</executable>
<arguments>
<argument>-classpath</argument>
<classpath />
<argument>
client.WSClient
</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
</project>

@@ -0,0 +1,36 @@
package client;

import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.soap.SOAPBinding;
import java.net.URL;

import service.DoubleItPortType;

public class WSClient {
private static final QName SERVICE_NAME
= new QName("http://www.example.org/contract/DoubleIt", "DoubleItService");
private static final QName PORT_NAME
= new QName("http://www.example.org/contract/DoubleIt", "DoubleItPort");

public static void main (String[] args) throws Exception {
// Use below line for Talend ESB deployment of web service provider
String endpointAddress = "http://localhost:8040/services/doubleit";
// Use below instead for servlet deployment
// String endpointAddress = "http://localhost:8080/doubleit/services/doubleit";
Service service = Service.create(new URL(endpointAddress +"?wsdl"), SERVICE_NAME);
DoubleItPortType port = service.getPort(DoubleItPortType.class);

doubleIt(port, 10);
doubleIt(port, 0);
doubleIt(port, -10);
}

public static void doubleIt(DoubleItPortType port,
int numToDouble) {
int resp = port.doubleIt(numToDouble);
System.out.println("The number " + numToDouble + " doubled is "
+ resp);
}
}

62 changes: 62 additions & 0 deletions examples/cxf/dev-guide-java-first/pom.xml
@@ -0,0 +1,62 @@
<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/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>org.talend.cxf-examples.java-first-tutorial</groupId>
<artifactId>java-first-tutorial</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Dev Guide Tutorial: Java-First Web Service</name>
<packaging>pom</packaging>
<url>http://www.jroller.com/gmazza/entry/java_first_web_service</url>

<modules>
<module>service</module>
<module>war</module>
<module>client</module>
</modules>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<cxf.version>2.7.0-SNAPSHOT</cxf.version>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
<configuration>
<downloadSources>true</downloadSources>
<!--downloadJavadocs>true</downloadJavadocs-->
<!--useProjectReferences>false</useProjectReferences-->
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
</dependencies>

</project>

81 changes: 81 additions & 0 deletions examples/cxf/dev-guide-java-first/service/pom.xml
@@ -0,0 +1,81 @@
<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/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.talend.cxf-examples.java-first-tutorial</groupId>
<artifactId>java-first-tutorial</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>java-first-tutorial-service</artifactId>
<name>-- Web Service Provider</name>
<packaging>bundle</packaging>

<build>
<plugins>
<!-- Below plugin provides a separate JAR for the JAX-WS artifacts
(i.e., the objects created by running java2ws), as this JAR will also be
used by the SOAP client.
More info: http://maven.apache.org/plugins/maven-assembly-plugin/ -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<descriptors>
<descriptor>src/assembly/jaxws-jar.xml</descriptor>
</descriptors>
<appendAssemblyId>true</appendAssemblyId>
<attach>true</attach>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-java2ws-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>process-classes</id>
<phase>process-classes</phase>
<configuration>
<className>service.DoubleItPortTypeImpl
</className>
<genWsdl>true</genWsdl>
<verbose>true</verbose>
</configuration>
<goals>
<goal>java2ws</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.5</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Require-Bundle>org.apache.cxf.bundle,org.springframework.beans</Require-Bundle>
<Export-Package>service</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
<!-- Name of the generated WAR file -->
<finalName>doubleit</finalName>
</build>

</project>

@@ -0,0 +1,14 @@
<assembly>
<id>jaxws</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<files>
<file>
<source>target/classes/service/DoubleItPortType.class
</source>
<outputDirectory>/service</outputDirectory>
</file>
</files>
</assembly>
@@ -0,0 +1,8 @@
package service;

import javax.jws.WebService;

@WebService
public interface DoubleItPortType {
public int doubleIt(int numberToDouble);
}
@@ -0,0 +1,15 @@
package service;

import javax.jws.WebService;

@WebService(targetNamespace = "http://www.example.org/contract/DoubleIt",
endpointInterface = "service.DoubleItPortType",
serviceName = "DoubleItService",
portName = "DoubleItPort")
public class DoubleItPortTypeImpl implements DoubleItPortType {

public int doubleIt(int numberToDouble) {
return numberToDouble * 2;
}

}
@@ -0,0 +1,19 @@
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
xmlns:jaxws="http://cxf.apache.org/blueprint/jaxws"
xmlns:cxf="http://cxf.apache.org/blueprint/core"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://cxf.apache.org/blueprint/jaxws
http://cxf.apache.org/schemas/blueprint/jaxws.xsd
http://cxf.apache.org/blueprint/core
http://cxf.apache.org/schemas/blueprint/core.xsd
">

<jaxws:endpoint id="doubleit" implementor="service.DoubleItPortTypeImpl"
address="/doubleit">
</jaxws:endpoint>

</blueprint>
63 changes: 63 additions & 0 deletions examples/cxf/dev-guide-java-first/war/pom.xml
@@ -0,0 +1,63 @@
<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/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.talend.cxf-examples.java-first-tutorial</groupId>
<artifactId>java-first-tutorial</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>java-first-tutorial-war</artifactId>
<name>-- Service WAR file</name>
<packaging>war</packaging>
<url>http://maven.apache.org</url>

<dependencies>
<dependency>
<groupId>org.talend.cxf-examples.java-first-tutorial</groupId>
<artifactId>java-first-tutorial-service</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.0.6.RELEASE</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.1</version>
<configuration>
<server>myTomcat</server>
<url>http://localhost:8080/manager/text</url>
<path>/${project.build.finalName}</path>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<webXml>src/main/webapp/WEB-INF/web.xml</webXml>
<webResources>
<resource>
<directory>../service/src/main/resources</directory>
<targetPath>WEB-INF/wsdl</targetPath>
<includes>
<include>*.wsdl</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
<!-- Name of the generated WAR file -->
<finalName>doubleit</finalName>
</build>

</project>
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:soap="http://cxf.apache.org/bindings/soap"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd">

<jaxws:endpoint
id="doubleit"
implementor="service.DoubleItPortTypeImpl"
address="/doubleit">
</jaxws:endpoint>
</beans>

0 comments on commit 579e6a5

Please sign in to comment.