View Source

{section}
{column}

h1. Features

The SOAP component is a Binding Component (BC) which enables to interact with external SOAP Web Services and to expose JBI services as SOAP 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, it is 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/|http://ws.apache.org/axis2/]) and Mortbay Jetty v6.1.9 ([http://jetty.codehaus.org/jetty/|http://jetty.codehaus.org/jetty/]). It provides the following features:
* Expose JBI Services as SOAP Web Services
* Expose SOAP Web Services as JBI Services
* Expose JBI Services as RESTful Web Services
* Expose RESTful Web Services as JBI Services
* Handle SOAP attachments (MTOM). 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.

{info}
If you want more details about SOAP, you can consult this W3C specification: [http://www.w3.org/TR/soap/|http://www.w3.org/TR/soap/].

All attachment are processed by using XOP rules. (XML-binary Optimized Packaging: [http://www.w3.org/TR/xop10/])
{info}
{column}
{column:width=35%}
{panel:title=Table of contents}{toc}{panel}
{panel:title=Contributors}{contributors:order=name|mode=list}{panel}
{column}
{section}

h1. Provide a Web Service access in the ESB (SOAP over HTTP)

In provide mode, the component exposes an external Web Service in the JBI environment to send SOAP requests to the external Web Service.

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 Web Service. The address of the 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 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>http://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>
</jbi:provides>
</jbi:services>
</jbi:jbi>
{code}

{include:0 CDK SU Provide Configuration}
\\
{center}{*}Configuration of a Service Unit to provide a service (SOAP)*{center}
{table-plus:columnAttributes=,,style="text-align:center;",style="text-align:center;"}









|| Parameter || Description || Default || 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 an external service. \\ {info:title=Note}This value overrides the CDK value.{info} \\
The value is expressed in milliseconds. It must be provided in multiples of 100. | 30000 | 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 | Enable the compatibility with a specified Web Service stack. \\
Possible values are: AXIS1 for Axis1 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 |
{table-plus}

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









|| Parameter || Description || Default || 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 Headers (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 |
| headers-to-inject | Set of XML headers (CDATA) to be injected into the outgoing SOAP message (in SOAP Headers). | \- | 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,
* An optional imported WSDL file describing the partner service


h1. Exposing an internal JBI service endpoint as a Web Service (SOAP over HTTP)

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

h2. 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:
\\
\\
{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 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.

By default, the component is configured to handle URI with the [http://localhost:8084/petals/services/]<service-name> pattern (this URI can be configured in the [SOAP component configuration|Petals-BC-SOAP 4.0.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 services is available at [http://localhost:8084/petals/services/listServices] URI (it can also be configured in the [SOAP component configuration|Petals-BC-SOAP 4.0.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. 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-jms-transport>false</soap:enable-jms-transport>
</jbi:consumes>
</jbi:services>
</jbi:jbi>
{code}

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









|| Parameter || Description || Default || 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 invoking a service in the JBI bus. \\ {info:title=Note}This value overrides the CDK value.{info} \\
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 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-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 |
| 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 |
| 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 Web Service access in the ESB with WS-Security

The Petals BC SOAP is compliant with the specificatio *WS-Security 1.1*

h2. Configuration

To enable WS-Security, the module *Rampart* must be engaged.
{code:lang=xml}
<soap:modules>rampart</soap:modules>
{code}

The WS-Security header is generated from the WS-Policy declared in the service-unit
{code:lang=xml}
<soap:policy-path>policy</soap:policy-path>
{code}

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:policy-path>policy</soap:policy-path>

</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 WS-Policy file, named "policy.xml" and located in the directory defined by the parameter 'policy-path', relative to the service-unit root directory.

h1. Provide a REST Service access in the ESB

In provide mode, the component exposes an external Web Service in the JBI environment to send REST requests to the external Web Service.

{warning:title=Warning}
This feature is currently only supported with the MEP InOut.
{warning}

h2. Usage

The petals-bc-soap component can expose an external Web Service as a JBI service endpoint by deploying a Service Unit on it:

{center}

!petals-bc-soap-x.x-provider..png|border=1,width=500,height=285!
*Provides an external Web Service as a JBI service*
{center}

When a message is received on a REST linked endpoint from the JBI environment, it is transformed into a REST message and sent to the Web Service. The address of the Web Service to send the REST message to is defined in the address extension of the deployed Service Unit.

The REST message is created like this:
* The JBI message payload and the exchange operation are used to create the HTTP body
* The address extension is used to create the REST URI
* The rest-http-method extension is used to choose the HTTP method (if it is not defined, the method POST is used)

The external Web Service is called and the REST response is processed and returned to the JBI environment.

The address extension can be configured with placeholders. The placeholder will be replaced by the result of the XPath expression defined inside of the placeholder. The XPath expression is performed on the content of the incoming JBI message. The placeholders will be replaced in the address extension to build the final URI according to the result of the XPath expression.

For example the following JBI message:
{code:lang=xml}
<weat:getWeather xmlns:weat="http://petals.ow2.org/services/weather">
<citycode>FRXX0099</citycode>
<unit>c</unit>
</weat:getWeather>
{code}
is associated with the address parameter value:
{code}
http://weather.yahooapis.com/forecastrss?p={/*[localname()='getWeather'][1]/*[local-name()='citycode']
[1]}&amp;u={/*[local-name()='getWeather'][1]/*[local-name()='unit'][1]}
{code}
and produces the URI [http://weather.yahooapis.com/forecastrss?p=FRXX0099&u=c].

The JBI message response returned by the Yahoo Weather REST service corresponding to the previous URI is:
{code:lang=xml}
<rss version="2.0" xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0"
xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
<channel>
<title>Yahoo! Weather - Toulouse, FR</title>
<link>http://us.rd.yahoo.com/dailynews/rss/weather/Toulouse__FR/*http://weather.yahoo.com/forecast/
FRXX0099_c.html</link>
<description>Yahoo! Weather for Toulouse, FR</description>
<language>en-us</language>
<lastBuildDate>Thu, 06 Mar 2008 3:00 pm CET</lastBuildDate>
<ttl>60</ttl>
<yweather:location city="Toulouse" country="FR" region=""/>
<yweather:units distance="km" pressure="mb" speed="kph" temperature="C"/>
<yweather:wind chill="3" direction="310" speed="37"/>
<yweather:atmosphere humidity="37" pressure="0" rising="0" visibility="999"/>
<yweather:astronomy sunrise="7:22 am" sunset="6:50 pm"/>
<image>
<title>Yahoo! Weather</title>
<width>142</width>
<height>18</height>
<link>http://weather.yahoo.com/</link>
<url>http://l.yimg.com/us.yimg.com/i/us/nws/th/main_142b.gif</url>
</image>
<item>
<title>Conditions for Toulouse, FR at 3:00 pm CET</title>
<geo:lat>43.61</geo:lat>
<geo:long>1.45</geo:long>
<link>http://us.rd.yahoo.com/dailynews/rss/weather/Toulouse__FR/*http://weather.yahoo.com/forecast/
FRXX0099_c.html</link>
<pubDate>Thu, 06 Mar 2008 3:00 pm CET</pubDate>
<yweather:condition code="28" date="Thu, 06 Mar 2008 3:00 pm CET" temp="8" text="Mostly
Cloudy"/>
<description>
<![CDATA[<img src="http://l.yimg.com/us.yimg.com/i/us/we/52/28.gif" /><br />
<b>Current Conditions:</b><br />
Mostly Cloudy, 8 C<BR /><BR />
<b>Forecast:</b><BR />
Thu - Mostly Cloudy. High: 10 Low: 4<br />
Fri - Cloudy. High: 10 Low: 4<br />
<br />
<a
href="http://us.rd.yahoo.com/dailynews/rss/weather/Toulouse__FR/*http://weather.yahoo.com/forecast/
FRXX0099_c.html">Full Forecast at Yahoo! Weather</a><BR/>
(provided by The Weather Channel)<br/>]]>
</description>
<yweather:forecast code="27" date="06 Mar 2008" day="Thu" high="10" low="4" text="Mostly
Cloudy"/>
<yweather:forecast code="26" date="07 Mar 2008" day="Fri" high="10" low="4" text="Cloudy"/>
<guid isPermaLink="false">FRXX0099_2008_03_06_15_0_CET</guid>
</item>
</channel>
</rss>
{code}

h2. Configuration

h3. Service Unit descriptor

An example of a Service Unit descriptor that provides a REST service:
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<jbi:jbi version="1.0"
xmlns:generatedNs="http://petals.ow2.org/GenericREST/"
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:RestInterface"
service-name="generatedNs:YahooWeather"
endpoint-name="YahooWeatherEndpoint">

<!-- 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>RestService.wsdl</petalsCDK:wsdl>

<!-- Component specific elements -->
<soap:address>http://weather.yahooapis.com/forecastrss?p={/*[local-name()='getWeather'][1]/*[local-name()='citycode'][1]}&amp;u={/*[local-name()='getWeather'][1]/*[local-name()='unit'][1]}</soap:address>
<soap:mode>REST</soap:mode>
</jbi:provides>
</jbi:services>
</jbi:jbi>
{code}

{include:0 CDK SU Provide Configuration}
\\
{center}{*}Configuration of a Service Unit to provide a service (REST)*{center}
{table-plus:columnAttributes=,,style="text-align:center;",style="text-align:center;"}









|| Parameter || Description || Default || Required ||
| address | Address of the external Web Service to send JBI messages to. | \- | Yes |
| synchronous-timeout | The timeout value when invoking an external service. \\ {info:title=Note}This value overrides the CDK value.{info} The value is expressed in milliseconds. It must be provided in multiples of 100. | 30000 | No |
| 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 |
| 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. | POST | No |
{table-plus}


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









|| Parameter || Description || Default || Required ||
| wsa-to | Default address of the external Web Service to send JBI messages to. It is the same use than soap:address for the REST mode and it is overridden by soap:address if the both are specified. | | 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
* A "generic" WSDL:
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
name="RestService"
targetNamespace="http://petals.ow2.org/GenericREST/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://petals.ow2.org/GenericREST/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">

<wsdl:types>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://petals.ow2.org/GenericREST/"
elementFormDefault="qualified"
targetNamespace="http://petals.ow2.org/GenericREST/"
version="1.0">

<xs:element name="delete" type="tns:delete" />
<xs:element name="deleteResponse" type="tns:deleteResponse" />
<xs:element name="get" type="tns:get" />
<xs:element name="getResponse" type="tns:getResponse" />
<xs:element name="post" type="tns:post" />
<xs:element name="postResponse" type="tns:postResponse" />
<xs:element name="put" type="tns:put" />
<xs:element name="putResponse" type="tns:putResponse" />

<xs:complexType name="delete">
<xs:sequence />
</xs:complexType>
<xs:complexType name="deleteResponse">
<xs:sequence>
<xs:element minOccurs="0" name="DeleteOutParam" type="xs:anyType" />
</xs:sequence>
</xs:complexType>

<xs:complexType name="get">
<xs:sequence />
</xs:complexType>
<xs:complexType name="getResponse">
<xs:sequence>
<xs:element minOccurs="0" name="GetOutParam" type="xs:anyType" />
</xs:sequence>
</xs:complexType>

<xs:complexType name="put">
<xs:sequence>
<xs:element minOccurs="0" name="PutInParam" type="xs:anyType" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="putResponse">
<xs:sequence>
<xs:element minOccurs="0" name="PutOutParam" type="xs:anyType" />
</xs:sequence>
</xs:complexType>

<xs:complexType name="post">
<xs:sequence>
<xs:element minOccurs="0" name="PostInParam" type="xs:anyType" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="postResponse">
<xs:sequence>
<xs:element minOccurs="0" name="PostOutParam" type="xs:anyType" />
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>

<wsdl:message name="get">
<wsdl:part name="parameters" element="tns:get" />
</wsdl:message>
<wsdl:message name="putResponse">
<wsdl:part name="parameters" element="tns:putResponse" />
</wsdl:message>
<wsdl:message name="deleteResponse">
<wsdl:part name="parameters" element="tns:deleteResponse" />
</wsdl:message>
<wsdl:message name="post">
<wsdl:part name="parameters" element="tns:post" />
</wsdl:message>
<wsdl:message name="put">
<wsdl:part name="parameters" element="tns:put" />
</wsdl:message>
<wsdl:message name="postResponse">
<wsdl:part name="parameters" element="tns:postResponse" />
</wsdl:message>
<wsdl:message name="delete">
<wsdl:part name="parameters" element="tns:delete" />
</wsdl:message>
<wsdl:message name="getResponse">
<wsdl:part name="parameters" element="tns:getResponse" />
</wsdl:message>

<wsdl:portType name="RestInterface">
<wsdl:operation name="delete">
<wsdl:input name="delete" message="tns:delete" />
<wsdl:output name="deleteResponse" message="tns:deleteResponse" />
</wsdl:operation>

<wsdl:operation name="get">
<wsdl:input name="get" message="tns:get" />
<wsdl:output name="getResponse" message="tns:getResponse" />
</wsdl:operation>

<wsdl:operation name="put">
<wsdl:input name="put" message="tns:put" />
<wsdl:output name="putResponse" message="tns:putResponse" />
</wsdl:operation>

<wsdl:operation name="post">
<wsdl:input name="post" message="tns:post" />
<wsdl:output name="postResponse" message="tns:postResponse" />
</wsdl:operation>
</wsdl:portType>

<wsdl:binding name="GenericRestServiceSoapBinding" type="tns:RestInterface">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />

<wsdl:operation name="delete">
<soap:operation soapAction="" style="document" />
<wsdl:input name="delete">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="deleteResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>

<wsdl:operation name="get">
<soap:operation soapAction="" style="document" />
<wsdl:input name="get">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="getResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>

<wsdl:operation name="put">
<soap:operation soapAction="" style="document" />
<wsdl:input name="put">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="putResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>

<wsdl:operation name="post">
<soap:operation soapAction="" style="document" />
<wsdl:input name="post">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="postResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>

<wsdl:service name="YahooWeather">
<wsdl:port name="YahooWeatherEndpoint" binding="tns:GenericRestServiceSoapBinding">
<soap:address location="http://localhost:9090/GenericRestEndpoint" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
{code}

h1. Exposing an internal JBI service endpoint as a REST Service

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

h2. Usage

The petals-bc-soap component can listen incoming REST messages and send messages to a JBI service endpoint by deploying a Service Unit on it. The component consumes the JBI service:

{center}
!petals-bc-soap-x.x-consumer.png|border=1,width=500,height=285!
*Consumes a JBI service on a REST message*
{center}

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

When a REST 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 created from the incoming REST query. A URL like http://<host>:<port>/petals/services/<service-name>/operation?param1=value1&param2=value2 produces the 'operation' JBI operation.
* The JBI payload depends on the HTTP method used in the incoming request:
** GET: The JBI message is created from the URL parameters
** POST/PUT/DELETE: The JBI message is copied from the HTTP body (only XML contents are supported)

By default, the component is configured to handle URI with the [http://localhost:8084/petals/services/]<service-name> pattern (this URI can be configured in the [SOAP component configuration|Petals-BC-SOAP 4.0.x#componentConfiguration]). It also handles ?wsdl calls; the WSDL description is retrieved from the endpoint and sent back to the consumer.

h2. Configuration

h3. Service Unit descriptor

An example of a Service Unit descriptor that consumes a REST 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>30000</petalsCDK:timeout>
<petalsCDK:mep xsi:nil="true" />

<!-- Component specific elements -->
<soap:address>RESTService</soap:address>
<soap:mode>REST</soap:mode>
<soap:rest-add-namespace-uri>http://petals.ow2.org/</soap:rest-add-namespace-uri>
<soap:rest-add-namespace-prefix>ns1</soap:rest-add-namespace-prefix>
</jbi:consumes>
</jbi:services>
</jbi:jbi>
{code}

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









|| Parameter || Description || Default || Required ||
| service-name | Web Service name to expose. | \- | No |
| synchronous-timeout | The timeout value when invoking a service in the JBI bus. \\ {info:title=Note}This value overrides the CDK value.{info}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 |
| 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 |
| {anchor:rest-add-namespace-uri}rest-add-namespace-uri | The namespace URI to be used in the the generated JBI message payload (cf [rest-add-namespace-prefix extension|petalsesb:Petals-BC-SOAP 4.x#rest-add-namespace-prefix] for the example). | \- | No |
| {anchor:rest-add-namespace-prefix}rest-add-namespace-prefix | The namespace prefix to be used in the the generated JBI message payload (used when [rest-add-namespace-uri extension|petalsesb:Petals-BC-SOAP 4.x#rest-add-namespace-uri] is defined). \\
Suppose that the XML message obtained from the URL parameters or from the HTTP body is:
{code:lang=xml}
<myOperation>
<param1>value1</param1>
<param2>value2</param2>
</myOperation>
{code} \\
With rest.add-namespace-uri parameter set to 'http://petals.ow2.org/sample' and rest.add-namespace-prefix parameter set to 'ns1', the JBI message is like:
{code:lang=xml}
<ns1:myOperation xmlns:ns1="http://petals.ow2.org/sample">
<ns1:param1>value1</ns1:param1>
<ns1:param2>value2</ns1:param2>
</ns1:myOperation>
{code} | soapbc | No |
| rest-remove-prefix-on-response | A list of NS prefixes to remove from the JBI message response (Coma Separated Values) \\
Suppose that the JBI service returns a JBI response like:
{code:lang=xml}
<ns1:Response xmlns:ns1="http://petals.ow2.org/sample1"
xmlns:ns2="http://petals.ow2.org/sample2"
xmlns:ns3="http://petals.ow2.org/sample3">
<ns1:param1>value1</ns1:param1>
<ns2:param2>value2</ns2:param2>
<ns3:param3>value3</ns3:param3>
</ns1:Response>
{code} \\
If the parameter is set to 'ns1,ns2', the message returned to the REST service consumer is:
{code:lang=xml}
<Response xmlns:ns1="http://petals.ow2.org/sample1"
xmlns:ns2="http://petals.ow2.org/sample2"
xmlns:ns3="http://petals.ow2.org/sample3">
<param1>value1</param1>
<param2>value2</param2>
<ns3:param3>value3</ns3:param3>
</Response>
{code} \\
If the parameter is set to '*', the message returned to the REST service consumer is:
{code:lang=xml}
<Response xmlns:ns1="http://petals.ow2.org/sample1"
xmlns:ns2="http://petals.ow2.org/sample2"
xmlns:ns3="http://petals.ow2.org/sample3">
<param1>value1</param1>
<param2>value2</param2>
<param3>value3</param3>
</Response>
{code} | \- | 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 |
| 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 REST Service access in the ESB

In provide mode, the component exposes an external Web Service in the JBI environment to send REST requests to the external Web Service.

{warning:title=Warning}
This feature is currently only supported with the MEP InOut.
{warning}

h2. Usage

The petals-bc-soap component can expose an external Web Service as a JBI service endpoint by deploying a Service Unit on it:

{center}

!petals-bc-soap-x.x-provider..png|border=1,width=500,height=285!
*Provides an external Web Service as a JBI service*
{center}

When a message is received on a REST linked endpoint from the JBI environment, it is transformed into a REST message and sent to the Web Service. The address of the Web Service to send the REST message to is defined in the address extension of the deployed Service Unit.

The REST message is created like this:
* The JBI message payload and the exchange operation are used to create the HTTP body
* The address extension is used to create the REST URI
* The rest-http-method extension is used to choose the HTTP method (if it is not defined, the method POST is used)

The external Web Service is called and the REST response is processed and returned to the JBI environment.

The address extension can be configured with placeholders. The placeholder will be replaced by the result of the XPath expression defined inside of the placeholder. The XPath expression is performed on the content of the incoming JBI message. The placeholders will be replaced in the address extension to build the final URI according to the result of the XPath expression.

For example the following JBI message:
{code:lang=xml}
<weat:getWeather xmlns:weat="http://petals.ow2.org/services/weather">
<citycode>FRXX0099</citycode>
<unit>c</unit>
</weat:getWeather>
{code}
is associated with the address parameter value:
{code}
http://weather.yahooapis.com/forecastrss?p={/*[localname()='getWeather'][1]/*[local-name()='citycode']
[1]}&amp;u={/*[local-name()='getWeather'][1]/*[local-name()='unit'][1]}
{code}
and produces the URI [http://weather.yahooapis.com/forecastrss?p=FRXX0099&u=c].

The JBI message response returned by the Yahoo Weather REST service corresponding to the previous URI is:
{code:lang=xml}
<rss version="2.0" xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0"
xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
<channel>
<title>Yahoo! Weather - Toulouse, FR</title>
<link>http://us.rd.yahoo.com/dailynews/rss/weather/Toulouse__FR/*http://weather.yahoo.com/forecast/
FRXX0099_c.html</link>
<description>Yahoo! Weather for Toulouse, FR</description>
<language>en-us</language>
<lastBuildDate>Thu, 06 Mar 2008 3:00 pm CET</lastBuildDate>
<ttl>60</ttl>
<yweather:location city="Toulouse" country="FR" region=""/>
<yweather:units distance="km" pressure="mb" speed="kph" temperature="C"/>
<yweather:wind chill="3" direction="310" speed="37"/>
<yweather:atmosphere humidity="37" pressure="0" rising="0" visibility="999"/>
<yweather:astronomy sunrise="7:22 am" sunset="6:50 pm"/>
<image>
<title>Yahoo! Weather</title>
<width>142</width>
<height>18</height>
<link>http://weather.yahoo.com/</link>
<url>http://l.yimg.com/us.yimg.com/i/us/nws/th/main_142b.gif</url>
</image>
<item>
<title>Conditions for Toulouse, FR at 3:00 pm CET</title>
<geo:lat>43.61</geo:lat>
<geo:long>1.45</geo:long>
<link>http://us.rd.yahoo.com/dailynews/rss/weather/Toulouse__FR/*http://weather.yahoo.com/forecast/
FRXX0099_c.html</link>
<pubDate>Thu, 06 Mar 2008 3:00 pm CET</pubDate>
<yweather:condition code="28" date="Thu, 06 Mar 2008 3:00 pm CET" temp="8" text="Mostly
Cloudy"/>
<description>
<![CDATA[<img src="http://l.yimg.com/us.yimg.com/i/us/we/52/28.gif" /><br />
<b>Current Conditions:</b><br />
Mostly Cloudy, 8 C<BR /><BR />
<b>Forecast:</b><BR />
Thu - Mostly Cloudy. High: 10 Low: 4<br />
Fri - Cloudy. High: 10 Low: 4<br />
<br />
<a
href="http://us.rd.yahoo.com/dailynews/rss/weather/Toulouse__FR/*http://weather.yahoo.com/forecast/
FRXX0099_c.html">Full Forecast at Yahoo! Weather</a><BR/>
(provided by The Weather Channel)<br/>]]>
</description>
<yweather:forecast code="27" date="06 Mar 2008" day="Thu" high="10" low="4" text="Mostly
Cloudy"/>
<yweather:forecast code="26" date="07 Mar 2008" day="Fri" high="10" low="4" text="Cloudy"/>
<guid isPermaLink="false">FRXX0099_2008_03_06_15_0_CET</guid>
</item>
</channel>
</rss>
{code}

h2. Configuration

h3. Service Unit descriptor

An example of a Service Unit descriptor that provides a REST service:
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<jbi:jbi version="1.0"
xmlns:generatedNs="http://petals.ow2.org/GenericREST/"
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:RestInterface"
service-name="generatedNs:YahooWeather"
endpoint-name="YahooWeatherEndpoint">

<!-- 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>RestService.wsdl</petalsCDK:wsdl>

<!-- Component specific elements -->
<soap:address>http://weather.yahooapis.com/forecastrss?p={/*[local-name()='getWeather'][1]/*[local-name()='citycode'][1]}&amp;u={/*[local-name()='getWeather'][1]/*[local-name()='unit'][1]}</soap:address>
<soap:mode>REST</soap:mode>
</jbi:provides>
</jbi:services>
</jbi:jbi>
{code}

{include:0 CDK SU Provide Configuration}
\\
{center}{*}Configuration of a Service Unit to provide a service (REST)*{center}
{table-plus:columnAttributes=,,style="text-align:center;",style="text-align:center;"}
|| Parameter || Description || Default || Required ||
| address | Address of the external Web Service to send JBI messages to. | \- | 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 |
| 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. | POST | No |
{table-plus}


{petalslink}
{table-plus:columnAttributes=,,style="text-align:center;",style="text-align:center;"}
|| Parameter || Description || Default || Required ||
| wsa-to | Default address of the external Web Service to send JBI messages to. It is the same use than soap:address for the REST mode and it is overridden by soap:address if the both are specified. | | 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
* A "generic" WSDL:
{code:lang=xml}
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
name="RestService"
targetNamespace="http://petals.ow2.org/GenericREST/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://petals.ow2.org/GenericREST/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">

<wsdl:types>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://petals.ow2.org/GenericREST/"
elementFormDefault="qualified"
targetNamespace="http://petals.ow2.org/GenericREST/"
version="1.0">

<xs:element name="delete" type="tns:delete" />
<xs:element name="deleteResponse" type="tns:deleteResponse" />
<xs:element name="get" type="tns:get" />
<xs:element name="getResponse" type="tns:getResponse" />
<xs:element name="post" type="tns:post" />
<xs:element name="postResponse" type="tns:postResponse" />
<xs:element name="put" type="tns:put" />
<xs:element name="putResponse" type="tns:putResponse" />

<xs:complexType name="delete">
<xs:sequence />
</xs:complexType>
<xs:complexType name="deleteResponse">
<xs:sequence>
<xs:element minOccurs="0" name="DeleteOutParam" type="xs:anyType" />
</xs:sequence>
</xs:complexType>

<xs:complexType name="get">
<xs:sequence />
</xs:complexType>
<xs:complexType name="getResponse">
<xs:sequence>
<xs:element minOccurs="0" name="GetOutParam" type="xs:anyType" />
</xs:sequence>
</xs:complexType>

<xs:complexType name="put">
<xs:sequence>
<xs:element minOccurs="0" name="PutInParam" type="xs:anyType" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="putResponse">
<xs:sequence>
<xs:element minOccurs="0" name="PutOutParam" type="xs:anyType" />
</xs:sequence>
</xs:complexType>

<xs:complexType name="post">
<xs:sequence>
<xs:element minOccurs="0" name="PostInParam" type="xs:anyType" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="postResponse">
<xs:sequence>
<xs:element minOccurs="0" name="PostOutParam" type="xs:anyType" />
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>

<wsdl:message name="get">
<wsdl:part name="parameters" element="tns:get" />
</wsdl:message>
<wsdl:message name="putResponse">
<wsdl:part name="parameters" element="tns:putResponse" />
</wsdl:message>
<wsdl:message name="deleteResponse">
<wsdl:part name="parameters" element="tns:deleteResponse" />
</wsdl:message>
<wsdl:message name="post">
<wsdl:part name="parameters" element="tns:post" />
</wsdl:message>
<wsdl:message name="put">
<wsdl:part name="parameters" element="tns:put" />
</wsdl:message>
<wsdl:message name="postResponse">
<wsdl:part name="parameters" element="tns:postResponse" />
</wsdl:message>
<wsdl:message name="delete">
<wsdl:part name="parameters" element="tns:delete" />
</wsdl:message>
<wsdl:message name="getResponse">
<wsdl:part name="parameters" element="tns:getResponse" />
</wsdl:message>

<wsdl:portType name="RestInterface">
<wsdl:operation name="delete">
<wsdl:input name="delete" message="tns:delete" />
<wsdl:output name="deleteResponse" message="tns:deleteResponse" />
</wsdl:operation>

<wsdl:operation name="get">
<wsdl:input name="get" message="tns:get" />
<wsdl:output name="getResponse" message="tns:getResponse" />
</wsdl:operation>

<wsdl:operation name="put">
<wsdl:input name="put" message="tns:put" />
<wsdl:output name="putResponse" message="tns:putResponse" />
</wsdl:operation>

<wsdl:operation name="post">
<wsdl:input name="post" message="tns:post" />
<wsdl:output name="postResponse" message="tns:postResponse" />
</wsdl:operation>
</wsdl:portType>

<wsdl:binding name="GenericRestServiceSoapBinding" type="tns:RestInterface">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />

<wsdl:operation name="delete">
<soap:operation soapAction="" style="document" />
<wsdl:input name="delete">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="deleteResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>

<wsdl:operation name="get">
<soap:operation soapAction="" style="document" />
<wsdl:input name="get">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="getResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>

<wsdl:operation name="put">
<soap:operation soapAction="" style="document" />
<wsdl:input name="put">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="putResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>

<wsdl:operation name="post">
<soap:operation soapAction="" style="document" />
<wsdl:input name="post">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="postResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>

<wsdl:service name="YahooWeather">
<wsdl:port name="YahooWeatherEndpoint" binding="tns:GenericRestServiceSoapBinding">
<soap:address location="http://localhost:9090/GenericRestEndpoint" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
{code}

h1. Exposing an internal JBI service endpoint as a REST Service

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

h2. Usage

The petals-bc-soap component can listen incoming REST messages and send messages to a JBI service endpoint by deploying a Service Unit on it. The component consumes the JBI service:

{center}
!petals-bc-soap-x.x-consumer.png|border=1,width=500,height=285!
*Consumes a JBI service on a REST message*
{center}

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

When a REST 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 created from the incoming REST query. A URL like http://<host>:<port>/petals/services/<service-name>/operation?param1=value1&param2=value2 produces the 'operation' JBI operation.
* The JBI payload depends on the HTTP method used in the incoming request:
** GET: The JBI message is created from the URL parameters
** POST/PUT/DELETE: The JBI message is copied from the HTTP body (only XML contents are supported)

By default, the component is configured to handle URI with the [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.

h2. Configuration

h3. Service Unit descriptor

An example of a Service Unit descriptor that consumes a REST 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>30000</petalsCDK:timeout>
<petalsCDK:mep xsi:nil="true" />

<!-- Component specific elements -->
<soap:address>RESTService</soap:address>
<soap:mode>REST</soap:mode>
<soap:rest-add-namespace-uri>http://petals.ow2.org/</soap:rest-add-namespace-uri>
<soap:rest-add-namespace-prefix>ns1</soap:rest-add-namespace-prefix>
</jbi:consumes>
</jbi:services>
</jbi:jbi>
{code}

{include:0 CDK SU Consume Configuration}
\\
{center}{*}Configuration of a Service Unit to consume a service (REST)*{center}
{table-plus:columnAttributes=,,style="text-align:center;",style="text-align:center;"}
|| Parameter || Description || Default || Required ||
| service-name | Web Service name to expose. | \- | 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 |
| 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 |
| {anchor:rest-add-namespace-uri}rest-add-namespace-uri | The namespace URI to be used in the the generated JBI message payload (cf [rest-add-namespace-prefix extension|petalsesb:Petals-BC-SOAP 4.x#rest-add-namespace-prefix] for the example). | \- | No |
| {anchor:rest-add-namespace-prefix}rest-add-namespace-prefix | The namespace prefix to be used in the the generated JBI message payload (used when [rest-add-namespace-uri extension|petalsesb:Petals-BC-SOAP 4.x#rest-add-namespace-uri] is defined). \\
Suppose that the XML message obtained from the URL parameters or from the HTTP body is:
{code:lang=xml}
<myOperation>
<param1>value1</param1>
<param2>value2</param2>
</myOperation>
{code} \\
With rest.add-namespace-uri parameter set to 'http://petals.ow2.org/sample' and rest.add-namespace-prefix parameter set to 'ns1', the JBI message is like:
{code:lang=xml}
<ns1:myOperation xmlns:ns1="http://petals.ow2.org/sample">
<ns1:param1>value1</ns1:param1>
<ns1:param2>value2</ns1:param2>
</ns1:myOperation>
{code} | soapbc | No |
| rest-remove-prefix-on-response | A list of NS prefixes to remove from the JBI message response (Coma Separated Values) \\
Suppose that the JBI service returns a JBI response like:
{code:lang=xml}
<ns1:Response xmlns:ns1="http://petals.ow2.org/sample1"
xmlns:ns2="http://petals.ow2.org/sample2"
xmlns:ns3="http://petals.ow2.org/sample3">
<ns1:param1>value1</ns1:param1>
<ns2:param2>value2</ns2:param2>
<ns3:param3>value3</ns3:param3>
</ns1:Response>
{code} \\
If the parameter is set to 'ns1,ns2', the message returned to the REST service consumer is:
{code:lang=xml}
<Response xmlns:ns1="http://petals.ow2.org/sample1"
xmlns:ns2="http://petals.ow2.org/sample2"
xmlns:ns3="http://petals.ow2.org/sample3">
<param1>value1</param1>
<param2>value2</param2>
<ns3:param3>value3</ns3:param3>
</Response>
{code} \\
If the parameter is set to '*', the message returned to the REST service consumer is:
{code:lang=xml}
<Response xmlns:ns1="http://petals.ow2.org/sample1"
xmlns:ns2="http://petals.ow2.org/sample2"
xmlns:ns3="http://petals.ow2.org/sample3">
<param1>value1</param1>
<param2>value2</param2>
<param3>value3</param3>
</Response>
{code} | \- | 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 |
| 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. 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.0.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. Provide a HTTPS Web Service access in the ESB (SOAP over HTTPS)

{note}Available since BC SOAP 4.0.9{note}

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>http://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)

{note}Available since BC SOAP 4.0.9{note}

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 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.

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.0.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>
<soap:https-client-authentication-enabled>false</soap:https-client-authentication-enabled>
...

</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


{anchor:componentConfiguration}

h1. Component Configuration

h3. Component descriptor

Example of a Component descriptor:
{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>
<jbi:component-class-name>org.ow2.petals.binding.soap.SoapComponent</jbi:component-class-name>
<jbi:component-class-path><jbi:path-element/></jbi:component-class-path>
<jbi:bootstrap-class-name>org.ow2.petals.binding.soap.SoapBootstrap</jbi:bootstrap-class-name>
<jbi:bootstrap-class-path><jbi:path-element/></jbi:bootstrap-class-path>

<!-- Component Development Kit Parameters -->
<petalsCDK:acceptor-pool-size>5</petalsCDK:acceptor-pool-size>
<petalsCDK:processor-pool-size>10</petalsCDK:processor-pool-size>
<petalsCDK:ignored-status>DONE_AND_ERROR_IGNORED</petalsCDK:ignored-status>
<petalsCDK:properties-file />
<petalsCDK:notifications>false</petalsCDK:notifications>
<petalsCDK:jbi-listener-class-name>org.ow2.petals.binding.soap.listener.outgoing.JBIListener</petalsCDK:jbi-listener-class-name>
<petalsCDK:external-listener-class-name>org.ow2.petals.binding.soap.listener.incoming.SoapExternalListener</petalsCDK:external-listener-class-name>

<!-- SOAP Component Parameters -->
<soap:http-port>8084</soap:http-port>
<soap:http-host>localhost</soap:http-host>
<soap:http-services-list>true</soap:http-services-list>
<soap:http-services-context>petals</soap:http-services-context>
<soap:http-services-mapping>services</soap:http-services-mapping>
<soap:http-thread-pool-size-min>2</soap:http-thread-pool-size-min>
<soap:http-thread-pool-size-max>50</soap:http-thread-pool-size-max>
<soap:http-acceptors>4</soap:http-acceptors>

<!-- HTTPS support, -->
<soap:https-enabled>false</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>
<soap:https-client-authentication-enabled>false</soap:https-client-authentication-enabled> -->

<!-- JMS transport layer, default JMS connection factory, uncommented to activate -->
<!--<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}

{include:0 CDK Component Configuration Table 2.1}
{center}{*}Configuration of the component (SOAP)*{center}
{table-plus:columnAttributes=,,style="text-align:center;",style="text-align:center;"}
|| Parameter || Description || Default || 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 the value of the parameter is empty (default configuration), all interfaces are listen. | \- | Yes |
| http-service-list | Enables to display the available Web Service list on http://<http-host>:<http-port>/ \\
<http-service-context>/<http-service-mapping>/listServices. \\
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. Caution, as an acceptor is a thread borrowed from the thread pool, the value of {{http-thread-pool-size-min}} and {{http-thread-pool-size-max}} MUST take into account this value. If {{http-thread-pool-size-max}} < {{http-acceptors}}, no request can be processed | 4 | No |
| https-enabled \\ | Enable the HTTPS support. \\
Possible values are: true, false. \\ | false \\ | No \\ |
| https-port \\ | HTTPS port of the Jetty embedded server | 8083 \\ | No \\ |
| https-keystore-type \\ | Type of the keystore. \\
Possible values are: JKS, PKCS12. \\ | JKS \\ | No |
| https-keystore-file | File path of the keystore. The SSL support is disabled if the keystore file does not exist, and a WARNING is logged.\\ | \- \\ | No |
| https-keystore-password \\ | Password of the keystore. \\ | \- \\ | No |
| https-key-password \\ | Password of the key. \\ | \- \\ | No |
| https-truststore-type \\ | Type of the truststore. \\
Possible values are: JKS, PKCS12. | JKS \\ | No |
| https-truststore-file \\ | File path of the truststore. | \- \\ | No \\ |
| https-truststore-password \\ | Password of the truststore. | \- \\ | No \\ |
| https-client-authentication-enabled \\ | Enable 2-way SSL to authenticate clients. | false | 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 |
{table-plus}

{include:0 CDK Parameter scope}

h1. Know problems

h2. No HTTP/WS request is processed

When you try to invok a web-service with your favorite client, you get a time out instead of a standard response. A possible cause is configuration error of the HTTP thread pool. Check your configuration: the HTTP thread pool max size must be upper than the HTTP acceptor number, see [the component configuration|#componentConfiguration].

h2. Error invoking a service with 2\+ attachments from SoapUI

If you get an error invoking a service with at least two attachments from SoapUI, check that you have enabled the multi-part mode in the SoapUI properties of the request.

h2. NullPointerException getting a service WSDL

If you have the following configuration:
- a service provider running on a component based on a CDK 4
- a service consumer running on the BC SOAP 4.0.x
The BC SOAP will throw a NullPointerException when retrieving the service provider WSDL (see [PETALSBCSOAP-97|http://jira.petalslink.com/browse/PETALSBCSOAP-97]).

To fix the problem, you MUST move your service provider on a component based on the CDK 5.

h2. "sec_error_inadequate_cert_type" appears when trying to get services list available through SSL on the HTTPS client side

If get the error "sec_error_inadequate_cert_type" using a browser to get available services through SSL, check your SSL configuration of your BC SOAP. Probably, you inverse certificates usage: You configure the public key of the server instead its private key.

h2. "sec_error_bad_cert_alert" appears when trying to get services list available through SSL on the HTTPS client side

You get this error on the HTTPS client side when the client authentication is *enabled* on the server side and no or bad certificate is available on the client side.