Petals-BC-REST 1.x

compared with
Version 7 by Nicolas Oddoux
on Sep 22, 2010 11:22.

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

Changes (26)

View Page History
{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 request is created like this:
* The REST request URI is created differently according the HTTP method to used:
* GET:
** GET: The REST URI is created from the address extension, JBI operation and JBI payload (only the children of the XML root of the JBI payload are used, the local name is the URI parameter name and the content of the tag is the URI parameter value).
** POST/PUT/DELETE: The REST URI is created from the address extension and the JBI operation
* The HTTP body is created differently according the HTTP method to used:
** GET/DELETE: There is no HTTP body
* POST:
** The REST URI is created from the address extension and the JBI operation.
** POST: The HTTP body is created from the JBI payload (The value of the XML root of the JBI payload is used)
* PUT:
** The REST URI is created from the address extension and the JBI operation.
** PUT: The HTTP body is created from an attachment (the first attachment found in the JBI message is used if there is one)
* DELETE:
** The REST URI is created from the address extension and the JBI operation.
** There is no HTTP body
* The headers present in the protocol header JBI message property are added to the HTTP headers.

For all the HTTP methods, the headers present in the protocol header JBI message property are added to the HTTP headers.

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

h3. With no description of the RESTful Web Service

The address of the RESTful Web Service is defined in the address extension of the deployed Service Unit.
The HTTP method is defined in the http-method SU extension.

h3. With a WADL

The address of the RESTful Web Service is found in the WADL.
The REST operation corresponding to the JBI operation is found in the WADL.
The HTTP method is defined in the WADL for the operation.
h3. With a WSDL 2.0

The address of the RESTful Web Service is found in the WSDL 2.0.
The REST operation corresponding to the JBI operation is found in the WSDL 2.0.
The HTTP method is defined in the WSDL 2.0 for the operation.



|| Attribute || Description || Default value || Required ||
| address | Address of the external Web Service to send JBI messages to. | | {center}Yes\*{center} |
| http-method | HTTP method to use. \\
\\
{table-plus}

\*Only one of these extensions must be used and is required in a specific SU.
\*Either address and http-method extensions or wadl or wsdl2 must be present in a specific SU.

h3. Service Unit descriptor
The service-name Service Unit extension value will be used as 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 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.

The JBI message is created like this:
* The JBI operation is created from the operation present in the REST URI
* The JBI payload is created according to the HTTP method of the incoming REST request:
** GET: The JBI payload is created from the URI parameters
** POST: The JBI payload is created from the HTTP body (The value of the XML root of the JBI payload contains the HTTP body)
** PUT/DELETE: There is no JBI payload
* A JBI attachment is created from the HTTP body if the HTTP method is PUT
* The HTTP headers are added to the the protocol header JBI message property
* The MEP is defined by the petalsCDK:mep extension.

A WADL is available at the following URL: (TBC)
A WSDL 2.0 is available at the following URL: (TBC)

h2. Configuration




|| Attribute || Description || Default value || Required ||
| service-name | Web Service name to expose. | | {center}No{center} |