|
Key
This line was removed.
This word was removed. This word was added.
This line was added.
|
Changes (19)
View Page HistoryThis service engine allows to create a Petals service from an annotated Java class.
The annotations are the ones defined by the [JSR-181 specification|http://jcp.org/en/jsr/detail?id=181|http://jcp.org/en/jsr/detail?id=181], although most of the JAX-WS annotations are supported, Apache Axis2 being is used by the component.
\\
h1. Creating a native Petals an hard-coded service
This section explains how to create a native Petals hard-coded service, that will run on the JSR-181 component.
We speak of native service because this service is coded in Java and runs inside Petals. It does not need any container or third-party server.
h2. Service-Unit content
JSR-181 proposes an easy way to define the service you want to expose via Java annotations.
h2. Service-Unit content
A service-unit for this component must contain:
* One or several JAR files, containing at least one Java annotated class.
* One or several JAR files, containing at least one Java annotated class.
h2. The Service implementation
The native service is implemented by Java class which must be annotated with JSR-181 annotations (@WebService to be exact).
Every parameter must be a Java bean, with a public zero-argument constructor.
The important thing to take care is the way objects will be marshalled and unmarshalled, i.e. the transformation between the XML messages than come from and to Petals, and the Java objects the service implementation will deal with. This is why all your parameters should respect the Java bean conventions.
The important thing to take care is the way objects will be marshalled and unmarshalled, i.e. the transformation between the XML messages than come from and to Petals, and the Java objects the service implementation will deal with. This is why all your parameters should respect the Java bean conventions.
It is not possible to only provide the Java class.
The component needs the annotated class, the associated WSDL and a JBI descriptor.
The component needs the annotated class, the associated WSDL and a JBI descriptor.
This descriptor references WSDL elements. You mandatory need to have generated the WSDL.
{table-plus}
|| Parameter \\ || Description \\ || Default \\ || Required \\ ||
|| Parameter || Description || Default || Required ||
| class \\ | The JSR-181 annotated class which will provide the Service. This class must be available in the Service-Unit class loader. | \- \\ {center}\-{center} | Yes \\ {center}Yes{center} |
{table-plus}
{include:0 CDK SU Interceptor configuration|]}
h2. Data-binding
xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"
xmlns:jsr181="http://petals.ow2.org/components/jsr181/version-1">
xmlns:jsr181="http://petals.ow2.org/components/jsr181/version-1">
<jbi:component type="service-engine"
bootstrap-class-loader-delegation="parent-first">
bootstrap-class-loader-delegation="parent-first">
<jbi:bootstrap-class-name>org.ow2.petals.se.jsr181.Jsr181Bootstrap</jbi:bootstrap-class-name>
<jbi:bootstrap-class-path><jbi:path-element/></jbi:bootstrap-class-path>
<jbi:bootstrap-class-path><jbi:path-element/></jbi:bootstrap-class-path>
<petalsCDK:acceptor-pool-size>5</petalsCDK:acceptor-pool-size>
<petalsCDK:processor-pool-size>10</petalsCDK:processor-pool-size>
<petalsCDK:processor-pool-size>10</petalsCDK:processor-pool-size>
{code}
\\
{include:0 CDK Component Configuration Table 2.1}
\\
This component has no specific parameter.
This component has no specific parameter.
{include:0 CDK Parameter scope}
{include:0 CDK Component Interceptor configuration}
{include:0 CDK Component Interceptor configuration}