Feature
The SOAP component is a Binding Component (BC) which enables to interact with external Web Services and to expose JBI services as Web Services.
In provider role, when a JBI MessageExchange is sent to a ServiceEndpoint (mapped to a Web Service), it is transformed into a SOAP message and sent to the linked external Web Service. In consumer role, when a SOAP message is received on an exposed Web Service, transformed into a JBI MessageExchange and sent to the corresponding JBI ServiceEndpoint.
The SOAP component is based on Apache Axis2 v1.4.1 (http://ws.apache.org/axis2/) and Mortbay Jetty v6.1.9 (http://jetty.codehaus.org/jetty/). It provides the following features :
- Expose JBI Services as Web Services
- Expose Web Services as JBI Services
- Handle SOAP attachments. The attachments of the incoming SOAP message are placed into the JBI message as attachments; the JBI attachments are placed in the outgoing SOAP message as attachments.
| All attachment are processed by using XOP rules.(XML-binary Optimized Packaging : http://www.w3.org/TR/xop10/ ) |
Exposing an external Web Service as a JBI service endpoint
In provide mode, the component exposes an external Web Service in the JBI environment to send SOAP requests to the external Web Service.
Usage
Configuration
| Parameter | Description |
Default |
Required |
|---|---|---|---|
| provides | Describe the JBI service that will be exposed into the JBI bus. Interface (QName), Service (QName) and Endpoint (String) attributes are required. | - | Yes |
| Attribute | Description | Default value | Required | ||
|---|---|---|---|---|---|
| soap-version | The SOAP version used to create SOAP messages. Possible values are 1.1 and 1.2. |
1.1
|
Yes
|
||
| address | Address of the external Web Service to send JBI messages to. | Yes
|
|||
| chunked-mode | Activate the HTTP chunked mode on Web Service calls. Possible values are: true, false. |
false
|
Yes
|
||
| synchronous-timeout | The timeout value when invoking a external service.
|
No
|
|||
| cleanup-transport | Cleanup the transport after the call of the external Web Service. Not cleaning up the transport can cause timeouts on large number of calls. Possible values are: true, false. |
true
|
Yes
|
||
| mode | The mode to be used to send SOAP message to the specified address. Possible values are: SOAP for basic Web Service calls, JSON for JSON service calls and REST for REST service calls. |
SOAP
|
Yes
|
||
| enable-compatibility-for | Enables the compatibility with a specified Web Service stack. Possible values are: AXIS1 for Axis 1 Web Service stack. |
No
|
|||
| proxy-host | The proxy host name. If it is not set, the proxy mode will be disabled and all others proxy parameters are ignored. |
No
|
|||
| proxy-port | The proxy host port. | No
|
|||
| proxy-user | The proxy user. | No
|
|||
| proxy-password | The proxy password. | No
|
|||
| proxy-domain | The proxy domain. | No
|
|||
| rest-http-method | The HTTP method to be used in REST mode. Possible values are: GET for the HTTP method GET, POST for the HTTP method POST, PUT for the HTTP method PUT and DELETE for the HTTP method DELETE. |
No
|
| Attribute | Description | Default value | Required |
|---|---|---|---|
| wsa-to | Default address of the external Web Service to send JBI messages to. | No
|
|
| wsa-replyto | Address of an external Web Service to add to the WSA header wsa:ReplyTo. | No
|
|
| wsa-from | Address of an external Web Service to add to the WSA header wsa:From. | No
|
|
| wsa-faultto | Address of an external Web Service to add to the WSA header wsa:FaultTo. | No
|
|
| headers-filter | A value used to filter Normalized Message properties to be added to the outgoing SOAP message. All the normalized message properties which are org.w3c.dom.DocumentFragment instances. These values can be filtered at the Service Unit level with the headers-filter property. If the headers-filter property is set to 'org.ow2.petals.foo., org.ow2.petals.soap.bar', all the DocumentFragment properties which are starting with 'org.ow2.petals.soap.foo.' and with 'org.ow2.petals.soap.bar' will be added to the outgoing SOAP Header (as children). | No
|
|
| inject-headers | Inject some additional headers to the outgoing SOAP message. All the elements of the org.w3c.dom.DocumentFragment Map which is available in the javax.jbi.messaging.protocol.headers message properties will be added if the Service Unit level property inject-headers is set to true. | No
|
Service Unit attributes to provide services
Service Unit descriptor
The service unit is configurable via its extensions in the jbi.xml file:
Service Unit content
The Service Unit has to contain the following elements, packaged in an archive:
- The META-INF/jbi.xml descriptor file, has described above,
- An optional imported WSDL file describing the partner service
Exposing an internal JBI service endpoint as a Web Service
In consumer mode, the component exposes an internal JBI service outside the bus to transfer incoming SOAP requests to the internal service.
Usage
Configuration
| Parameter | Description | Default | Required |
|---|---|---|---|
| consumes | Refer JBI service to invoke into the JBI bus. You can define an explicit endpoint: interface (QName) / Service (QName) / Endpoint (String) attributes. Or define implicit endpoint, to let the container routing according to QOS configurations (HA...): -by Interface attribute (QName) -by Service attribute (QName) |
- | Yes |
| Parameter | Description | Default | Required |
|---|---|---|---|
| mep | Message exchange pattern abbreviation. This parameter can be used in conjunction with the method of the CDK Listeners: createMessageExchange(Extensions extensions). This method returns a CDK Exchange corresponding to the type of the specified pattern. |
- | Yes |
| operation | Operation to call on a service. This parameter can be used in conjunction with the sending methods of the Listeners. If no operation is specified in the Message Exchange to send, this parameter will be used. | - | No |
| timeout | Timeout in milliseconds of a synchronous send. This parameter can be used in conjunction with the sendSync(Exchange exchange) method of the Listeners. Set 0 for an infinite timeout. | 30000 | No |
| Attribute | Description | Default value | Required | ||
|---|---|---|---|---|---|
| service-name | Web Service name to expose. | No
|
|||
| soap-action | The SOAP action QName to be used for the Web Service, will override the JBI message operation. | No
|
|||
| synchronous-timeout | The timeout value when inoking a service in the JBI bus.
The value is expressed in milliseconds. |
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 | Enables the compatibility with a specified Web Service stack. Possible values are: AXIS1 for Axis 1 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-jms-transport | Enable the JMS transport layer to receive SOAP messages. Possible values are: true, false. |
false
|
No
|
||
| http-services-redirection | HTTP redirection alias(es) for exposed Web Service. | No
|
|||
| service-parameters | Additional XML configuration for created Axis2 service as CDATA, same as the Axis 2 services.xml file one. | No
|
|||
| modules | A list of Axis2 modules names to engage (separated by comas). | No
|
|||
| address | Same as service-name.
|
No
|
|||
| rest-add-namespace-uri | The namespace URI to be used in the the generated JBI message payload. | No
|
|||
| rest-add-namespace-prefix | The namespace prefix to be used in the the generated JBI message payload (used when NS URI is defined). | soapbc
|
No
|
||
| rest-remove-prefix-on-response | A list of NS prefixes to remove from the JBI message response (Coma Separated Values) | No
|
Service Unit attributes to consume services
Service Unit descriptor
The service unit is configurable via its extensions in the jbi.xml file:
Service Unit content
The Service Unit has to contain the following elements, packaged in an archive:
- The META-INF/jbi.xml descriptor file, has described above
Component Configuration
The following attributes can be set during the installation phase to configure the component, using the params element of the jbi-install-component ANT task:
| Attribute | Description | Default value | Required |
|---|---|---|---|
| http-port | Port of the embedded Jetty HTTP server. | 8084
|
No
|
| http-host | Local Hostname to be used, can be hostname or host IP address. If this parameter is not set, all interfaces are listen. |
localhost
|
No
|
| http-service-list | Enables to display the available Web Service list. Possible values are: true, false. |
true
|
No
|
| http-service-context | The URL context. | petals
|
No
|
| http-service-mapping | The URL service mapping. | services
|
No
|
| http-thread-pool-size-min | The minimum size of the HTTP thread pool. | 2
|
No
|
| http-thread-pool-size-max | The maximum size of the HTTP thread pool. | 255
|
No
|
| http-acceptors | Number of HTTP acceptors. | 4
|
No
|
| java-naming-factory-initial | The initial context factory class needed to access the JNDI server where the JMS connection factory can be found. | No
|
|
| java-naming-provider-url | The JNDI provider URL where the JMS connection factory can be found. | No
|
|
| jms-connection-factory-jndiname | Name of the default JMS connection factory in the JNDI. | No
|
Configuration of the component
Definition of CDK parameter scope :
- Installation: The parameter can be set during the installation of the component, by using the installation MBean (see JBI specifications for details about the installation sequence). If the parameter is optional and has not been defined during the development of the component, it is not available at installation time.
- Runtime: The paramater can be set during the installation of the component and during runtime. The runtime configuration can be changed using the CDK custom MBean named RuntimeConfiguration. If the parameter is optional and has not been defined during the development of the component, it is not available at installation and runtime times.