Petals-BC-SOAP 5.1.0+

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (63)

View Page History
h1. Exposing an internal JBI service endpoint

h2. As a web-service SOAP over HTTP(S)

In consumer mode, the component exposes an internal JBI service outside the bus to transfer incoming SOAP requests to the internal service.

{info}
The HTTPS configuration is located at the component level because only one certificat is needed to expose the Petals service as a HTTPS web-service.
{info}
h2. Usage

h3. Usage

The petals-bc-soap component can listen incoming SOAP messages and send messages to a JBI service endpoint by deploying a Service Unit on it. The component consumes the JBI service:
\\
\\
The Petals BC SOAP can listen incoming SOAP messages and send messages to a JBI service endpoint by deploying a Service Unit on it. The component consumes the JBI service through HTTP(S) and JMS:
* consumes a JBI service on a HTTP(S)/SOAP message:
{center}
*Consumes a JBI service on a SOAP message*
\\ !petals-bc-soap-x.x-consumer.png|border=0,width=500,height=285!
!petals-bc-soap-x.x-consumer.png|border=0,width=500,height=285!
{center}
* onsumes a JBI service on JMS message (containing SOAP envelope)
{center}
!petals-bc-soap-x.x-soap_over_jms.png|border=1,width=500,height=285!
{center}

The service-name Service Unit extension value will be used as Axis2 service name.

When a SOAP message is handled by the component, it is transformed into a JBI Message and sent to the JBI service endpoint configured in the Service Unit. The JBI message is created like this:
* The JBI operation is resolved (see [Operation Resolving|#op-resolving]).
* Put the SOAP headers into the protocol header JBI message property.

By default, the component is configured to handle URI with the [http://localhost:8084/petals/services/]<service-name> (or 8083 for HTTPS) pattern (this URI can be configured in the [SOAP component configuration|#componentConfiguration]). It also handles ?wsdl calls; the WSDL description is retrieved from the endpoint and sent back to the consumer.
h2. As a web-service SOAP over HTTP(S)

By default, the list of HTTP services is available at [http://localhost:8084/petals/services/listServices] (or 8083 for HTTPS) URI (it can also be configured in the [SOAP component configuration|#componentConfiguration]).
{info}
The HTTPS configuration is located at the component level because only one certificat is needed to expose the Petals service as a HTTPS web-service.
{info}

By default, the component is configured to handle URI with the pattern: http://localhost:8084/petals/services/<service-name> (or 8083 for HTTPS). This URI can be configured at [component configuration|#componentConfiguration] level, see [SOAP component configuration|#componentConfiguration]). It also handles "?wsdl" calls, the WSDL description is retrieved from the endpoint and sent back to the consumer.

By default, the list of HTTP services is available at [http://localhost:8084/petals/services/listServices] (or 8083 for HTTPS) URI. It can also be configured at [component configuration|#componentConfiguration] level.

The HTTPS transport is activated at [component configuration|#componentConfiguration] level.

{warning}
If you plan tests with JAX-WS Reference Implementation, please use the JDK one (not the JRE one), otherwise MTOM attachments will not be handled properly.
h3. Configuration

h4. Service Unit descriptor
All needed information must be defined in the service-unit JBI descriptor. This JBI descriptor is configured through parameters divided in following groups:
* *JBI parameters* that defines the service provider identification,
* *CDK parameters* that are parameters driving the service consumer implementation at CDK layer,
* *CDK interceptor parameters* that are parameters driving interceptors at CDK layer,
* *Dedicated parameters* that are parameters driving the service consumer implementation at component layer.

h4. CDK parameters defining service consumer implementation
The following parameters correspond to the CDK configuration of the service consumer implementation.

{include:0 CDK SU BC Consume Configuration 5.8.0}

{note}
The configuration of the flow tracing (ie. value of parameter '{{activate-flow-tracing}}') can be overridden on HTTP(S) web-service invocation setting the HTTP header '{{org.ow2.petals.monitoring.activate-flow-tracing}}':
* not set: the parameter '{{activate-flow-tracing}}' configured at service unit level is applied,
* '{{true}}': the flow tracing is activated,
* '{{false}}': the flow tracing is deactivated.
{note}

h4. CDK parameters driving interceptors
The following parameters drive interceptors at CDK layer.

{include:0 CDK SU Interceptor configuration 5.8.0}

h4. Dedicated configuration

{table-plus:columnAttributes=,,style="text-align:center;",style="text-align:center;"}
|| Parameter || Description || Default || Required ||
| service-name | Web-service name to expose. This value appears on URL used to expose the service | \- | Yes |
| soap-action | The SOAP action QName to be used for the Web Service, will override the JBI message operation. | \- | No |
| mode | The mode to be used to receive messages. Possible values are: SOAP for basic Web Service messages, JSON for JSON service messages and REST for REST service messages. | SOAP | Yes |
| enable-compatibility-for | Enable the compatibility with a specified Web Service stack. Possible values are: AXIS1 for Axis1 Web Service stack. | \- | No |
| enable-http-transport | Enable the HTTP transport layer to send or receive SOAP messages. Possible values are: true, false. | true | No |
| enable-https-transport | Enable the HTTPS transport layer to send or receive SOAP messages. Possible values are: true, false. | false | No |
| http-services-redirection | HTTP redirection alias(es) for exposed Web Service. | \- | No |
| address | Same as service-name. {warning:title=Warning}This parameter must not be used any more. service-name must be used.{warning} | \- | No |
{table-plus}

{petalslink}
{table-plus:columnAttributes=,,style="text-align:center;",style="text-align:center;"}
|| Parameter || Description || Default || Required ||
| service-parameters | Additional XML configuration for created Axis2 service as CDATA, same as the Axis2 services.xml file one. | | No |
| enable-wsa \\ | Enable WSA-Addressing. Enable/disable Axis WSA-Addressing processing for incoming SOAP messages. \\
Possible values are: true, false. \\ | false \\ | No \\ |
| modules | A list of Axis2 modules names to engage (separated by comas). | | No |
{table-plus}
{petalslink}

h4. Service unit content

The service unit has to contain the following elements, packaged in the archive:
* the META-INF/jbi.xml descriptor file as described above

{code}
service-unit.zip
+ META-INF
- jbi.xml (as defined above)
{code}

h4. Example

An example of a Service Unit service unit descriptor that exposes a Web Service web-service over HTTP:
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>

<jbi:services binding-component="true">

<jbi:consumes
interface-name="generatedNs:IntegrationService"
endpoint-name="IntegrationServiceSOAP">

<!-- CDK specific elements -->
<petalsCDK:timeout>500</petalsCDK:timeout>
<petalsCDK:mep xsi:nil="true" />

<!-- Component specific elements -->
<soap:address>IntegrationServiceSOAPByPetals</soap:address>
<soap:mode>SOAP</soap:mode>
{code}

The HTTPS transport layer must be set in the component jbi.xml file (cf [SOAP component configuration|#componentConfiguration]):
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<jbi:jbi version="1.0" xmlns:jbi="http://java.sun.com/xml/ns/jbi"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"
xmlns:soap="http://petals.ow2.org/components/soap/version-4">
<jbi:component type="binding-component"
bootstrap-class-loader-delegation="parent-first">
<jbi:identification>
<jbi:name>petals-bc-soap</jbi:name>
<jbi:description>The SOAP Binding Component (based on Axis2 + Jetty)</jbi:description>
</jbi:identification>
...
h2. As a web-service SOAP over JMS

<!-- SOAP Component Parameters -->
...
<!-- HTTPS support -->
<soap:https-enabled>true</soap:https-enabled>
<soap:https-port>8083</soap:https-port>
<soap:https-keystore-type>JKS</soap:https-keystore-type>
<soap:https-keystore-file>../https/serverKeystore.jks</soap:https-keystore-file>
<soap:https-keystore-password>passwordServerKeystore</soap:https-keystore-password>
<soap:https-key-password>petalsServerK</soap:https-key-password>
<soap:https-truststore-type>JKS</soap:https-truststore-type>
<soap:https-truststore-file>../https/serverTruststore.jks</soap:https-truststore-file>
<soap:https-truststore-password>passwordServerTruststore</soap:https-truststore-password>
...
By configuring the SOAP component and a Service Unit, it is possible to consume an internal JBI service.

</jbi:component> {warning:title=Warning}
This feature is currently only supported in consumer mode with the operation with the MEP InOnly.
</jbi:jbi> {warning}
{code}

{include:0 CDK SU Consume Configuration 5.7.0}
\\
{center}{*}Configuration of a Service Unit to consume a service (SOAP)*{center}
{table-plus:columnAttributes=,,style="text-align:center;",style="text-align:center;"}
h3. Usage

The petals-bc-soap component can receive JMS messages from a JMS queue and send SOAP messages (contained in the JMS body message) to a JBI service endpoint by deploying a Service Unit on it. The component consumes the JBI service.

It enables to support the following scenario: A JMS publisher sends a message to a JMS server and the SOAP component consumes the JMS message which contains a SOAP envelope in its body:

{center}
!petals-bc-soap-x.x-soap_over_jms.png|border=1,width=500,height=285!
*Consumes a JBI service on JMS message (containing SOAP envelope)*
{center}

The service-name Service Unit extension value will be used as Axis2 service name.

When a JMS message is handled by the component, the SOAP envelope (in its body) is extracted by Axis, is transformed into a JBI Message and sent to the JBI service endpoint configured in the Service Unit. The JBI message is created like this:
* The JBI operation is created from the SOAP action.
* Copy the SOAP body into the JBI one.
* Put the SOAP attachments into JBI ones.
* Put the SOAP headers into the protocol header JBI message property.

h3. Configuration

h3. Configuration

All needed information must be defined in the service-unit JBI descriptor. This JBI descriptor is configured through parameters divided in following groups:
* *JBI parameters* that defines the service provider identification,
* *CDK parameters* that are parameters driving the service consumer implementation at CDK layer,
* *CDK interceptor parameters* that are parameters driving interceptors at CDK layer,
* *Dedicated parameters* that are parameters driving the service consumer implementation at component layer.

h4. CDK parameters defining service consumer implementation
The following parameters correspond to the CDK configuration of the service consumer implementation.

{include:0 CDK SU BC Consume Configuration 5.8.0}

{note}
The configuration of the flow tracing (ie. value of parameter '{{activate-flow-tracing}}') can be overridden on HTTP(S) web-service invocation setting the HTTP header '{{org.ow2.petals.monitoring.activate-flow-tracing}}':
* not set: the parameter '{{activate-flow-tracing}}' configured at service unit level is applied,
* '{{true}}': the flow tracing is activated,
* '{{false}}': the flow tracing is deactivated.
{note}

h4. CDK parameters driving interceptors
The following parameters drive interceptors at CDK layer.

{include:0 CDK SU Interceptor configuration 5.8.0}

h4. Dedicated configuration

{table-plus:columnAttributes=,,style="text-align:center;",style="text-align:center;"}
|| Parameter || Description || Default || Required ||
| wsdl | Path to the WSDL document describing services and operations called by the JBI consumes defined in the SU. \\
The value of this parameter is :
- an URL
- a file relative to the root of the SU package | \- | No |
| service-name | Web Service name to expose. | \- | Yes |
| soap-action | The SOAP action QName to be used for the Web Service, will override the JBI message operation. | \- | No |
| mode | The mode to be used to receive messages. \\
| mode | The mode to be used to receive messages. Possible values are: SOAP for basic Web Service messages, JSON for JSON service messages and REST for REST service messages. | SOAP | Yes |
| enable-compatibility-for | Enable the compatibility with a specified Web Service stack. \\
| enable-compatibility-for | Enable the compatibility with a specified Web Service stack. Possible values are: AXIS1 for Axis1 Web Service stack. | \- | No |
| enable-http-transport | Enable the HTTP transport layer to send or receive SOAP messages. \\
Possible values are: true, false. | true | No |
| enable-https-transport \\ | Enable the HTTPS transport layer to send or receive SOAP messages. \\
Possible values are: true, false. \\ | false \\ | No \\ |
| enable-jms-transport | Enable the JMS transport layer to receive SOAP messages. \\ Possible values are: true, false. | false | No |
Possible values are: true, false. | false | No |
| http-services-redirection | HTTP redirection alias(es) for exposed Web Service. | \- | No |
| address | Same as service-name. \\ {warning:title=Warning}This parameter must not be used any more. service-name must be used.{warning} | \- | No |
{table-plus}

{petalslink}
{table-plus:columnAttributes=,,style="text-align:center;",style="text-align:center;"}

|| Parameter || Description || Default || Required ||
| service-parameters | Additional XML configuration for created Axis2 service as CDATA, same as the Axis2 services.xml file one. | | No |
{petalslink}

h4. Service Uunit content

The Service Unit service unit has to contain the following elements, packaged in an the archive:
* Tthe META-INF/jbi.xml descriptor file as described above

h2. As a web-service SOAP over JMS
{code}
service-unit.zip
+ META-INF
- jbi.xml (as defined above)
{code}

By configuring the SOAP component and a Service Unit, it is possible to consume an internal JBI service.
h4. Example

An example of a service unit descriptor that exposes a web-service over JMS:
{warning:title=Warning} {code:lang=xml}
This feature is currently only supported in consumer mode with the operation with the MEP InOnly.
{warning}
<?xml version="1.0" encoding="UTF-8"?>
<jbi:jbi version="1.0"
xmlns:generatedNs="http://petals.ow2.org/"
xmlns:jbi="http://java.sun.com/xml/ns/jbi"
xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"
xmlns:soap="http://petals.ow2.org/components/soap/version-4"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

h3. Usage
<jbi:services binding-component="true">
<jbi:consumes
interface-name="generatedNs:IntegrationService"
service-name="generatedNs:IntegrationService"
endpoint-name="IntegrationServiceSOAP">

The petals-bc-soap component can receive JMS messages from a JMS queue and send SOAP messages (contained in the JMS body message) to a JBI service endpoint by deploying a Service Unit on it. The component consumes the JBI service.
<petalsCDK:timeout>500</petalsCDK:timeout>
<petalsCDK:mep xsi:nil="true" />

It enables to support the following scenario: A JMS publisher sends a message to a JMS server and the SOAP component consumes the JMS message which contains a SOAP envelope in its body:
<soap:address>IntegrationServiceSOAPByPetals</soap:address>
<soap:mode>SOAP</soap:mode>
<soap:enable-http-transport>false</soap:enable-http-transport>
<soap:enable-jms-transport>true</soap:enable-jms-transport>
</jbi:consumes>
</jbi:services>
</jbi:jbi>
{code}

{center}
!petals-bc-soap-x.x-soap_over_jms.png|border=1,width=500,height=285!
*Consumes a JBI service on JMS message (containing SOAP envelope)*
{center}

The service-name Service Unit extension value will be used as Axis2 service name.

When a JMS message is handled by the component, the SOAP envelope (in its body) is extracted by Axis, is transformed into a JBI Message and sent to the JBI service endpoint configured in the Service Unit. The JBI message is created like this:
* The JBI operation is created from the SOAP action.
* Copy the SOAP body into the JBI one.
* Put the SOAP attachments into JBI ones.
* Put the SOAP headers into the protocol header JBI message property.

h3. Configuration

h4. JMS server