Service interface - 7.0

Talend ESB Development Guide

EnrichVersion
7.0
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
task
Design and Development
EnrichPlatform
Talend ESB

Within Eclipse:

  1. Create a Maven project, following the same steps as CXF Maven Archetypes, and call it "locator_common" for the purposes of this example.

  2. Remove all default sources, as well as test source folder.

  3. Create a package named "demo.common", and create an interface Greeter.java:

    package demo.common;
    
    import javax.jws.WebService;
    
    @WebService(targetNamespace = "http://talend.org/esb/examples/", 
            name = "Greeter")
    public interface Greeter {
        String greetMe(String requestType);
    }

    Greeter.java will be the service interface. Now, the project structure will look like the following:

  4. The common application will be deployed as an OSGi bundle. So you will need to edit the pom.xml. (Please refer to Making SOAP calls with soapUI for details.)

    <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.talend.liugang.cxf</groupId>
        <artifactId>locator_common</artifactId>
        <version>1.0.0</version>
        <packaging>bundle</packaging>
        <name>locator_common</name>
        <url>http://maven.apache.org</url>
    
        <dependencies>
            <dependency>
                <groupId>org.apache.felix</groupId>
                <artifactId>org.osgi.core</artifactId>
                <version>1.4.0</version>
            </dependency>
        </dependencies>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <extensions>true</extensions>
                    <version>2.3.7</version>
                    <configuration>
                        <instructions>
                            <Bundle-SymbolicName>
                                ${project.artifactId}
                            </Bundle-SymbolicName>
                            <Export-Package>
                                demo.common
                            </Export-Package>
                        </instructions>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </project>
    
  5. Now that you have finished the definition of the service, select Run As > Maven Install from the M2Eclipse Popup menu on the pom.xml to install the application into your Maven repository.

    The next step is to implement of this service.