Petals-BC-REST 1.x

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

Changes (15)

View Page History
{info}
REST is a style of software architecture not a standard. If you want more details about REST, you can consult the Wikipedia page: [http://en.wikipedia.org/wiki/Representational_State_Transfer]

{info}


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


The REST response is transformed into a JBI message like this:
* In case of error (HTTP status different from 200x) a JBI fault is created.
* The HTTP body if it is present is used to create a JBI attachment (the HTTP body is not a XML fragment in all the cases).
* The JBI payload is empty.
* The HTTP headers are added to the protocol header JBI message property



|| Attribute || Description || Default value || Required ||
| address | Address of the external Web Service to send JBI messages to. | | {center}Yes\*{center} |

The JBI message is created like this:
* The JBI operation is created from the operation present in the REST URI operation
* The JBI payload is created according to the HTTP method of the incoming REST request:
** GET: The JBI payload is created from the REST URI path and 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)
** POST/PUT/DELETE: There is no JBI payload
* A JBI attachment is created from the HTTP body if the HTTP method is PUT
* A JBI attachment is created according to the HTTP method of the incoming REST request:
** GET/DELETE: There is no JBI attachment created
** POST/PUT: The JBI attachment is created from the HTTP body
* The HTTP headers are added to the the protocol header JBI message property
* The MEP is defined by the petalsCDK:mep extension.



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