|
Key
This line was removed.
This word was removed. This word was added.
This line was added.
|
Changes (2)
View Page History
Finally a good way to conceive an extended service is to start from a formal description of its interface, with a WSDL definition for example.
Then, the corresponding Java interface can be generated thanks to CXF wsdl2java facilities.
{code:xml|title="Maven plugin to generate Java from wsdl."}
<!-- CXF plugin -->
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>
${basedir}/target/generated-sources-cxf
</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>
${basedir}/src/main/resources/description/MyServiceDescription.wsdl
</wsdl>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
{code}
{code:xml|title="Maven plugin to generate Java from wsdl."}
<!-- CXF plugin -->
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>
${basedir}/target/generated-sources-cxf
</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>
${basedir}/src/main/resources/description/MyServiceDescription.wsdl
</wsdl>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
{code}
Then, the corresponding Java interface can be generated thanks to CXF wsdl2java facilities. The interface of {{MyExtendedService}} is then extending the EasyVIPER service and the description interface:
{code:title=MyExtendedService.java|borderStyle=solid}
import com.ebmwebsourcing.easyviper.core.api.engine.thread.service.Service;
import com.ebmwebsourcing.easyviper.core.api.engine.thread.service.Service;
