Annotating the SEI - 8.0

Talend ESB Service Developer Guide

Version
8.0
Language
English
Product
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
Module
Talend ESB
Talend Runtime
Content
Design and Development
Installation and Upgrade
Last publication date
2023-11-06

About this task

The SEI requires that you add the @WebService annotation. Since the SEI is the contract that defines the service, you should specify as much detail as you can about the service in the @WebService annotation's properties.

The below shows the interface defined in above with the @WebService annotation.

Interface with the @WebService Annotation

package com.mycompany.demo;

import javax.jws.*;

@WebService(name="quoteUpdater",
   targetNamespace="http://cxf.apache.org",
   wsdlLocation="http://somewhere.com/quoteExampleService?wsdl")
public interface QuoteReporter {
   public Quote getQuote(@WebParam(name="ticker") String ticker);
}

The @WebService annotation above does the following:

Procedure

  1. Specifies that the value of the name attribute of the wsdl:portType element defining the service interface is quoteUpdater .
  2. Specifies that the target namespace of the service is http://cxf.apache.org.
  3. Specifies that the service will use the pre-defined WSDL contract published at http://somewhere.com/quoteExampleService?wsdl.

Results

The @WebParam annotation is necessary as java interfaces do not store the Parameter name in the .class file. So if you leave out the annotation your parameter will be named arg0.