|
Key
This line was removed.
This word was removed. This word was added.
This line was added.
|
Changes (11)
View Page History* The headers present in the protocol header JBI message property are added to the HTTP headers.
For example the following JBI message:
For example the following JBI message will produces the URI {{http://localhost:8088/library/My+Documents/documents/6/metadata}}:
{code:lang=xml}
<consulter xmlns="http://petals.ow2.org/bc/rest/unit-test/ged">
<consulter xmlns="http://petals.ow2.org/bc/rest/unit-test/ged">
{code}
produces the URI {{http://localhost:8088/library/My+Documents/documents/6/metadata}}
The external resource is called and the REST response is processed and returned to the JBI environment.
The REST response is transformed into a JBI message like this:
The REST response is transformed into a JBI message like this:
* In case of error (HTTP status different from 20x) a JBI error is created.
* The JBI message content and attachment are created differently according the Content-Type HTTP header:
* The JBI message content and attachment are created differently according the Content-Type HTTP header:
* In case of normal response (HTTP status as 20x), the JBI output message content and attachment are created differently according the Content-Type HTTP header:
** XML content types: The JBI message content is created from the HTTP body,
** JSON content types: The JBI message content is created from the JSON body converted into XML,
** JSON content types: The JBI message content is created from the JSON body converted into XML,
** Non XML content types: The JBI message content is a reference (cf SOAP) to a JBI attachment which contains the HTTP body.
* The HTTP headers are added to the protocol header JBI message property
* In case of error (HTTP status different from 20x) a JBI error is created, the JBI output message is built according to the following rules:
** if the HTTP status is catched by a configuration element '{{on-http-status}}', the return depends on the message exchange pattern:
*** '{{InOnly}}', a status DONE is returned,
*** '{{RobustInOnly}}', a fault generated from the given XSL is returned,
*** '{{InOut}}', a fault or normal response, both generated from the given XSL, is returned according to the value of the attribute '{{as-fault}}',
** if the HTTP status is not catched by a configuration element '{{on-http-status}}', a status 'ERROR' is returned.
In all cases, the HTTP headers are added to the protocol header JBI message property.
** if the HTTP status is catched by a configuration element '{{on-http-status}}', the return depends on the message exchange pattern:
*** '{{InOnly}}', a status DONE is returned,
*** '{{RobustInOnly}}', a fault generated from the given XSL is returned,
*** '{{InOut}}', a fault or normal response, both generated from the given XSL, is returned according to the value of the attribute '{{as-fault}}',
** if the HTTP status is not catched by a configuration element '{{on-http-status}}', a status 'ERROR' is returned.
In all cases, the HTTP headers are added to the protocol header JBI message property.
h3. With no description of the RESTful resource
<rest:xpath-param name="library">//*[local-name()='library']</rest:xpath-param>
<rest:xpath-param name="reference">//*[local-name()='reference']</rest:xpath-param>
<rest:xpath-param name="reference">//*[local-name()='reference']</rest:xpath-param>
<rest:on-http-status code="404">
<rest:xsl as-fault="true">404.xsl</rest:xsl>
</rest:on-http-status>
<rest:xsl as-fault="true">404.xsl</rest:xsl>
</rest:on-http-status>
</rest:operation>
<rest:operation name="ged:metadata">
<rest:operation name="ged:metadata">
<rest:xpath-param name="reference">//*[local-name()='reference']</rest:xpath-param>
<rest:json-xml-mapping-convention>MAPPED_CONVENTION</rest:json-xml-mapping-convention>
<rest:json-xml-mapping-convention>MAPPED_CONVENTION</rest:json-xml-mapping-convention>
<rest:on-http-status code="404">
<rest:xsl as-fault="true">404.xsl</rest:xsl>
</rest:on-http-status>
<rest:xsl as-fault="true">404.xsl</rest:xsl>
</rest:on-http-status>
</rest:operation>
</rest:mapping>
</rest:mapping>
| uri | URI template of the external resource. | - | {center}Yes\*{center} |
| xpath-param | Define how to retrieve an URI template parameter as an XPath expression executed on the incoming payload. The attribute {{name}} is the name of the parameter in the URI template, and the value is the XPath expression to apply. | - | {center}Yes, if at least one parameter is included into the URI template{center} |
| xpath-param | Define how to retrieve an URI template parameter as an XPath expression executed on the incoming payload. The attribute {{name}} is the name of the parameter in the URI template, and the value is the XPath expression to apply. | - | {center}Yes, if at least one parameter is included into the URI template{center} |
| on-http-status | Define how to process a given HTTP status. The attribute {{code}} is the HTTP code associated to this processing. The sub-element '{{xsl}}' is the XSL generating the content of the reply to return. The reply type (fault or normal response) is defined according to the value of the attribute '{{as-fault}}'. | - | {center}No{center} |
| wadl | WADL which defines the partner service | - | {center}Yes\*{center} |
| wsdl2 | WSDL2 which defines the partner service | - | {center}Yes\*{center} |
| wsdl2 | WSDL2 which defines the partner service | - | {center}Yes\*{center} |