
| 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}
h3. Service Unit content
The Service Unit has to contain the following elements, packaged in an archive:
* The META-INF/jbi.xml descriptor file as described above
h1. Provide a HTTPS Web Service access in the ESB (SOAP over HTTPS)
In provide mode, the component exposes an external Web Service in the JBI environment to send SOAP requests to the external HTTPS Web Service.
{info}
The HTTPS configuration is located at the service-unit level to be able to use different certificates with different external webservices.
{info}
{warning}
Only JKS keystore and truststore are supported in the provider role.
The key password and the keystore passwords must be the same.
{warning}
h2. Usage
The SOAP component can expose an external Web Service as a JBI service endpoint by deploying a Service Unit on it:
\\
{center}
*Provides an external Web Service as a JBI service*
\\ !petals-bc-soap-x.x-provider..png|border=0,width=500,height=285!
{center}
When a message is received on a SOAP linked endpoint from the JBI environment, it is transformed into a SOAP message and sent to the HTTPS Web Service. The address of the HTTPS Web Service to send the SOAP message to is defined in the address extension of the deployed Service Unit.
The SOAP message is created like this:
* The JBI message payload is wrapped in the SOAP body
* The JBI message attachments are used to create SOAP ones
* The JBI message exchange operation is used to create the SOAP action
* The JBI MEP is used to determine the SOAP MEP
The external HTTPS Web Service is called and the SOAP response is processed and returned to the JBI environment.
h2. Configuration
h3. Service Unit descriptor
An example of a Service Unit descriptor that provides a Web Service:
{code:lang=xml}
<?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">
<jbi:services binding-component="true">
<jbi:provides
interface-name="generatedNs:IntegrationService"
service-name="generatedNs:IntegrationService"
endpoint-name="IntegrationServiceSOAP">
<!-- CDK specific elements -->
<petalsCDK:timeout>1000</petalsCDK:timeout>
<petalsCDK:validate-wsdl>true</petalsCDK:validate-wsdl>
<petalsCDK:forward-security-subject>false</petalsCDK:forward-security-subject>
<petalsCDK:forward-message-properties>false</petalsCDK:forward-message-properties>
<petalsCDK:forward-attachments>false</petalsCDK:forward-attachments>
<petalsCDK:wsdl>IntegrationService.wsdl</petalsCDK:wsdl>
<!-- Component specific elements -->
<soap:address>https://localhost:8088/mockIntegrationServiceSOAP</soap:address>
<soap:soap-version>1.1</soap:soap-version>
<soap:chunked-mode>false</soap:chunked-mode>
<soap:cleanup-transport>true</soap:cleanup-transport>
<soap:mode>SOAP</soap:mode>
<soap:https-truststore-file>../https/clientTruststore.jks</soap:https-truststore-file>
<soap:https-truststore-password>passwordClientTruststore</soap:https-truststore-password>
<soap:https-keystore-file>../https/clientKeystore.jks</soap:https-keystore-file>
<soap:https-keystore-password>passwordClientKeystore</soap:https-keystore-password>
</jbi:provides>
</jbi:services>
</jbi:jbi>
{code}
h3. Service Unit content
The Service Unit has to contain the following elements, packaged in an archive:
* The META-INF/jbi.xml descriptor file as described above,
* An optional imported WSDL file describing the partner service
h1. Exposing an internal JBI service endpoint as a HTTPS Web Service (SOAP over HTTPS)
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
The petals-bc-soap component can listen incoming SOAP messages on a HTTPS port and send messages to a JBI service endpoint by deploying a Service Unit on it. The component consumes the JBI service:
\\
\\
{center}
*Consumes a JBI service on a SOAP message*
\\ !petals-bc-soap-x.x-consumer.png|border=0,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]).
* 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.
By default, the component is configured to handle URI with the [https://localhost:8083/petals/services/|http://localhost:8084/petals/services/]<service-name> pattern (this URI can be configured in the [SOAP component configuration|Petals-BC-SOAP 4.1.x & 4.2.x#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 HTTPS services is available at [https://localhost:8083/petals/services/listServices|http://localhost:8084/petals/services/listServices] URI (it can also be configured in the [SOAP component configuration|Petals-BC-SOAP 4.1.x & 4.2.x#componentConfiguration]).
{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.
{warning}
h2. Configuration
h3. Component descriptor
The HTTPS transport layer must be set in the component jbi.xml file (cf [SOAP component configuration|Petals-BC-SOAP 4.1.x & 4.2.x#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>
...
<!-- 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>
...
</jbi:component>
</jbi:jbi>
{code}
h3. Service Unit descriptor
An example of a Service Unit descriptor that consumes a Web Service:
{code:lang=xml}
<?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">
<jbi:services binding-component="true">
<jbi:consumes
interface-name="generatedNs:IntegrationService"
service-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>
<soap:enable-http-transport>true</soap:enable-http-transport>
<soap:enable-https-transport>true</soap:enable-https-transport>
<soap:enable-jms-transport>false</soap:enable-jms-transport>
</jbi:consumes>
</jbi:services>
</jbi:jbi>
{code}
h3. Service Unit content
The Service Unit has to contain the following elements, packaged in an archive:
* The META-INF/jbi.xml descriptor file as described above
h1. SOAP over JMS
By configuring the SOAP component and a Service Unit, it is possible to consume an internal JBI service.
{warning:title=Warning}
This feature is currently only supported in consumer mode with the operation with the MEP InOnly.
{warning}
h2. 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.
h2. Configuration
h3. JMS server
A JMS server must be started before starting the BC SOAP component (if the JMS transport layer is configured). The compatible JMS servers are Joram and Apache ActiveMQ.
h3. Shared library
A shared library corresponding to the JMS server (SL-JMS-Joram or SL-JMS-ActimeMQ) must be installed in Petals ESB before installing the BC SOAP component in Petals ESB.
h3. Component descriptor
The JMS transport layer must be set in the component jbi.xml file (cf [SOAP component configuration|Petals-BC-SOAP 4.1.x & 4.2.x#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>
...
<!-- SOAP Component Parameters -->
...
<!-- JMS transport layer -->
<soap:java-naming-factory-initial>org.apache.activemq.jndi.ActiveMQInitialContextFactory</soap:java-naming-factory-initial>
<soap:java-naming-provider-url>tcp://localhost:61616</soap:java-naming-provider-url>
<soap:jms-connection-factory-jndiname>QueueConnectionFactory</soap:jms-connection-factory-jndiname>
</jbi:component>
</jbi:jbi>
{code}
h3. Service Unit descriptor
The JMS transport must be enabled in the Service Unit jbi.xml file:
{code:lang=xml}
<?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">
<!-- Import a Service into Petals or Expose a Petals Service => use a BC. -->
<jbi:services binding-component="true">
<!-- Expose a Petals Service => consumes a Service. -->
<jbi:consumes
interface-name="generatedNs:JMSService"
service-name="generatedNs:JMSService"
endpoint-name="JMSServiceSOAP">
...
<soap:enable-jms-transport>true</soap:enable-jms-transport>
</jbi:consumes>
</jbi:services>
</jbi:jbi>
{code}
When the SU is started, a queue is created on the JMS server by the SOAP component if it does not exist. The name of the queue is the value of the parameter soap:address or soap:service-name.
When a message is sent to the JMS queue, it is received and treated by the SOAP component.
h1. Exposing an internal JBI service endpoint as a Web Service with WS-Security (UsernameToken)
h2. Configuration
h3. Service Unit descriptor
An example of a Service Unit descriptor that consumes a Web Service with UsernameToken:
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<!--
JBI descriptor for the Petals' "petals-bc-soap" component (SOAP).
Originally created for the version 4.1 of the component.
-->
<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-5"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- Import a Service into Petals or Expose a Petals Service => use a BC. -->
<jbi:services binding-component="true">
<!-- Expose a Petals Service => consumes a Service. -->
<jbi:consumes
interface-name="generatedNs:IntegrationService"
service-name="generatedNs:IntegrationService"
endpoint-name="IntegrationServiceSOAP">
<!-- CDK specific elements -->
<petalsCDK:timeout>60000</petalsCDK:timeout>
<petalsCDK:mep xsi:nil="true" />
<!-- Component specific elements -->
<soap:address>IntegrationServiceSOAPByPetalsUsernameToken</soap:address>
<soap:remove-root>false</soap:remove-root>
<soap:mode>SOAP</soap:mode>
<soap:enable-http-transport>true</soap:enable-http-transport>
<soap:modules>rampart</soap:modules>
<soap:service-parameters>
<![CDATA[
<parameter name="InflowSecurity">
<action>
<items>UsernameToken</items>
<passwordCallbackClass>org.ow2.petals.test.PWCBHandler</passwordCallbackClass>
</action>
</parameter>
]]>
</soap:service-parameters>
</jbi:consumes>
</jbi:services>
</jbi:jbi>
{code}
h3. Service Unit content
The Service Unit has to contain the following elements, packaged in an archive:
* The META-INF/jbi.xml descriptor file as described above
* the pcwbhandler.jar containing org.ow2.petals.test.PWCBHandler (quoted in the jbi.xml - necessary to check the user and the password of the token)
h1. Exposing an internal JBI service endpoint as a Web Service with WS-Security (Timestamp, Signature and Encryption)
h2. Configuration
h3. Service Unit descriptor
An example of a Service Unit descriptor that consumes a Web Service with Timestamp, Signature and Encryption:
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<!--
JBI descriptor for the Petals' "petals-bc-soap" component (SOAP).
Originally created for the version 4.1 of the component.
-->
<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-5"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- Import a Service into Petals or Expose a Petals Service => use a BC. -->
<jbi:services binding-component="true">
<!-- Expose a Petals Service => consumes a Service. -->
<jbi:consumes
interface-name="generatedNs:IntegrationService"
service-name="generatedNs:IntegrationService"
endpoint-name="IntegrationServiceSOAP">
<!-- CDK specific elements -->
<petalsCDK:timeout>60000</petalsCDK:timeout>
<petalsCDK:mep xsi:nil="true" />
<!-- Component specific elements -->
<soap:address>IntegrationServiceSOAPByPetalsChiffrementSignature</soap:address>
<soap:remove-root>false</soap:remove-root>
<soap:mode>SOAP</soap:mode>
<soap:enable-http-transport>true</soap:enable-http-transport>
<soap:modules>rampart</soap:modules>
<soap:service-parameters>
<![CDATA[
<parameter name="InflowSecurity">
<action>
<items>Timestamp Encrypt Signature</items>
<passwordCallbackClass>org.ow2.petals.test.PWCBHandler</passwordCallbackClass>
<signaturePropFile>service.properties</signaturePropFile>
</action>
</parameter>
<parameter name="OutflowSecurity">
<action>
<items>Timestamp Encrypt Signature</items>
<user>servercert</user>
<passwordCallbackClass>org.ow2.petals.test.PWCBHandler</passwordCallbackClass>
<signaturePropFile>service.properties</signaturePropFile>
<signatureKeyIdentifier>DirectReference</signatureKeyIdentifier>
<encryptionKeyIdentifier>SKIKeyIdentifier</encryptionKeyIdentifier>
<encryptionUser>servercert</encryptionUser>
</action>
</parameter>
]]>
</soap:service-parameters>
</jbi:consumes>
</jbi:services>
</jbi:jbi>
{code}
h3. Service Unit content
The Service Unit has to contain the following elements, packaged in an archive:
* The META-INF/jbi.xml descriptor file as described above
* the service.properties properties file (quoted in the jbi.xml)
{code}
org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
org.apache.ws.security.crypto.merlin.keystore.type=jks
org.apache.ws.security.crypto.merlin.keystore.password=serverKeystorePassword
org.apache.ws.security.crypto.merlin.file=serverKeystore.jks
{code}
* the serverKeystore.jks keystore file (quoted in the service.properties)
* the pcwbhandler.jar containing org.ow2.petals.test.PWCBHandler (quoted in the jbi.xml - necessary to get the private key pair from the keystore to decrypt the incoming message and to get the public/private key pair to sign the outcoming message)
h1. Provide a Web Service access in the ESB with WS-Security (Timestamp, Signature and Encryption)
h2. Configuration
h3. Service Unit descriptor
An example of a Service Unit descriptor that provides a Web Service with Timestamp, Signature and Encryption:
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<!--
JBI descriptor for the Petals' "petals-bc-soap" component (SOAP).
Originally created for the version 4.1 of the component.
-->
<jbi:jbi version="1.0"
xmlns:generatedNs="http://petals.ow2.org/test/"
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">
<!-- Import a Service into Petals or Expose a Petals Service => use a BC. -->
<jbi:services binding-component="true">
<!-- Import a Service into Petals => provides a Service. -->
<jbi:provides
interface-name="generatedNs:TestServiceAxisWSS"
service-name="generatedNs:TestServiceAxisWSS"
endpoint-name="TestServiceAxisWSSSOAP">
<!-- CDK specific elements -->
<petalsCDK:timeout>30000</petalsCDK:timeout>
<petalsCDK:validate-wsdl>true</petalsCDK:validate-wsdl>
<petalsCDK:forward-security-subject>false</petalsCDK:forward-security-subject>
<petalsCDK:forward-message-properties>false</petalsCDK:forward-message-properties>
<petalsCDK:forward-attachments>false</petalsCDK:forward-attachments>
<petalsCDK:wsdl>TestServiceAxisWSS.wsdl</petalsCDK:wsdl>
<!-- Component specific elements -->
<soap:address>http://192.168.1.161:8080/axis2/services/TestServiceAxisWSS/</soap:address>
<soap:soap-version>1.1</soap:soap-version>
<soap:chunked-mode>false</soap:chunked-mode>
<soap:cleanup-transport>true</soap:cleanup-transport>
<soap:mode>SOAP</soap:mode>
<soap:modules>rampart</soap:modules>
<soap:service-parameters>
<![CDATA[
<parameter name="InflowSecurity">
<action>
<items>Timestamp Encrypt Signature</items>
<passwordCallbackClass>org.ow2.petals.test.PWCBHandler</passwordCallbackClass>
<signaturePropFile>service.properties</signaturePropFile>
</action>
</parameter>
<parameter name="OutflowSecurity">
<action>
<items>Timestamp Encrypt Signature</items>
<user>servercert</user>
<passwordCallbackClass>org.ow2.petals.test.PWCBHandler</passwordCallbackClass>
<signaturePropFile>service.properties</signaturePropFile>
<signatureKeyIdentifier>DirectReference</signatureKeyIdentifier>
<encryptionKeyIdentifier>SKIKeyIdentifier</encryptionKeyIdentifier>
<encryptionUser>servercert</encryptionUser>
</action>
</parameter>
]]>
</soap:service-parameters>
</jbi:provides>
</jbi:services>
</jbi:jbi>
{code}
h3. Service Unit content
The Service Unit has to contain the following elements, packaged in an archive:
* The META-INF/jbi.xml descriptor file as described above
* the service.properties properties file (quoted in the jbi.xml)
{code}
org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
org.apache.ws.security.crypto.merlin.keystore.type=jks
org.apache.ws.security.crypto.merlin.keystore.password=serverKeystorePassword
org.apache.ws.security.crypto.merlin.file=serverKeystore.jks
{code}
* the serverKeystore.jks keystore file (quoted in the service.properties)
* the pcwbhandler.jar containing org.ow2.petals.test.PWCBHandler (quoted in the jbi.xml - necessary to get the public/private key pair to sign the outcoming message and to get the private key pair from the keystore to decrypt the incoming message)
{anchor:componentConfiguration}
h1. Component Configuration