|
Key
This line was removed.
This word was removed. This word was added.
This line was added.
|
Changes (11)
View Page HistoryThe JBI message is created like this:
* The JBI operation is created differently from the operation present in the REST URI operation
* The JBI service operation invoked is selected from the HTTP methode and path of the REST request,
* The JBI message content is created according to the HTTP method of the incoming REST request:
** GET: The JBI message content is created from the REST URI path and parameters
** GET: The JBI message content is created from the REST URI path and parameters
** PUT: A JBI attachment is created from the HTTP body
* The HTTP headers are added to the the protocol header JBI message property
* The HTTP headers are added to the the protocol header JBI message property
* The MEP is defined by the petalsCDK:mep extension.
* The MEP is defined by the exchange pattern defined in the service provider contract (ie. WSDL of the service provider).
A WADL is available at the following URL: (TBC)
h2. Configuration
All needed information must be defined in the service-unit. See [Service Unit attributes to consume services|#service-unit-attributes-consume] for more information :
All needed information must be defined in the service-unit JBI descriptor. This JBI descriptor is configured through parameters divided in following groups:
* *JBI parameters* that defines the service provider identification,
* *CDK parameters* that are parameters driving the service consumer implementation at CDK layer,
* *CDK interceptor parameters* that are parameters driving interceptors at CDK layer,
* *Dedicated parameters* that are parameters driving the service consumer implementation at component layer.
h3. CDK parameters defining service consumer implementation
The following parameters correspond to the CDK configuration of the service consumer implementation.
{include:0 CDK SU BC Consume Configuration 5.8.0}
h3. CDK parameters driving interceptors
The following parameters drive interceptors at CDK layer.
{include:0 CDK SU Interceptor configuration 5.8.0}
h3. Dedicated configuration
{anchor:service-unit-attributes-consume}
{table-plus}
|| Attribute || Description || Default value || Required || Support of placeholders ||
| {{http-method}} | HTTP method to use. Possible values are: GET, PATCH, POST, PUT and DELETE. | {center}-{center} | {center}Yes{center} | {center}Not applicable{center} |
| {{path-template}} | URI template of the resource exposed. Java regular expressions are supported into parameter part of URI template as following:
* /blah/\{ver:v\[12\]}/ep,
* /\{id : (\d+)}. | {center}-{center} | {center}Yes{center} | {center}Yes{center} |
| {{incoming-payload}} | If set, a transformation will be applied on XML extracted from HTTP body (eventually resulting from JSON conversion). Only XSL transformation is supported through the sub-element '{{xsl}}'.
{tip}
each URI parameter is available as XSL parameter (without namespace).
{tip} | {center}-{center} | {center}No{center} | {center}No{center} |
| {{http-body-from-json-multiple-pi}} | This parameter drives the conversion of JSON to XML. See https://github.com/beckchr/staxon/wiki/Factory-Configuration | {center}false{center} | {center}No{center} | {center}Not applicable{center} |
| {{http-body-from-json-virtual-root}} | This parameter drives the conversion of JSON to XML. See https://github.com/beckchr/staxon/wiki/Factory-Configuration | {center}-{center} | {center}No{center} | {center}Not applicable{center} |
| {{on-jbi-response}} | Defines the REST response that will be generated according to the JBI service response:
* the sub-elements '{{on-out}}', '{{on-fault}}' or '{{on-error}} define conditional transformations to apply on the service provider response, fault or error. The first condition evaluated to '{{true}}' determine the transformation that will be applied. The result of the transformation will be used as HTTP response. Several conditional transformations can be defined:
** the attribute '{{order-id}}' permits to order condition evaluations,
** the sub-element '{{condition}}' defines the condition to evaluate. Now, only XPath conditions are supported through the sub-element '{{xpath}}'. XPath condition supports placeholders,
** the sub-element '{{transformation}}' defines a preliminar transformation to apply on the XML payload of the response service if the condition matches, before to eventually be converted into JSON through the declaration '{{http-response}}'. Now, only XSL transformations are supported through the sub-element 'xsl'. Placeholders are supported neither to define XSL stylesheet nor into the XSL stylesheet,
{tip}
If the service response has no XML payload, the XML payload of the service request is used to be transformed instead of the service response XML payload.
{tip}
** the sub-element '{{http-response}}' defines the transformation to apply if the condition matches to generate the HTTP REST response:
*** the attribute '{{http-code}}' defines the HTTP code returned. Placeholder not supported,
*** headers can be added through sub-elements '{{header}}''. The header name is provided through attribute '{{name}}'. Header name does not support placeholder, but they are supported at header value level,
*** the sub-element {{http-body-to-json-multiple-pi}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. Default value: {{false}}, placeholder not supported,
*** the sub-element {{http-body-to-json-virtual-root}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. No default virtual root, placeholder not supported,
*** the sub-element {{http-body-to-json-auto-array}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. Default value: {{false}}, placeholder not supported,
*** the sub-element {{http-body-to-json-auto-primitive}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. Default value: {{false}}, placeholder not supported,
*** the sub-element {{http-body-to-json-pretty-print}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. Default value: {{false}}, placeholder not supported,
*** the sub-element {{http-body-to-json-ns-declarations}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. Default value: {{false}}, placeholder not supported.
{tip}
The content type of the HTTP response is defined according to the header '{{Accept}}' of the incoming HTTP REST request. The content-type used for the HTTP response is the first one contained in the header value and compliant with XML or JSON.
{tip}
* the sub-elements '{{on-default-out}}' defines the default HTTP response to generate on a nominal response of service provider when no condition matches it,
* the sub-elements '{{on-default-fault}}' defines the default HTTP response to generate on a fault returned by the service provider when no condition matches it,
* the sub-elements '{{on-default-error}}' defines the default HTTP response to generate on an error returned by the service provider when no condition matches it. | {center}-{center} | {center}Yes{center}| {center}Check sub-element{center} |
h3. Service unit content
The service unit has to contain the following elements, packaged in the archive:
* the META-INF/jbi.xml descriptor file as described above,
* XSL files referenced in the JBI descriptor.
{code}
service-unit.zip
+ META-INF
- jbi.xml (as defined above)
- stylesheet-1.xsl
- stylesheet-2.xsl
{code}
h3. Example
* *JBI parameters* that defines the service provider identification,
* *CDK parameters* that are parameters driving the service consumer implementation at CDK layer,
* *CDK interceptor parameters* that are parameters driving interceptors at CDK layer,
* *Dedicated parameters* that are parameters driving the service consumer implementation at component layer.
h3. CDK parameters defining service consumer implementation
The following parameters correspond to the CDK configuration of the service consumer implementation.
{include:0 CDK SU BC Consume Configuration 5.8.0}
h3. CDK parameters driving interceptors
The following parameters drive interceptors at CDK layer.
{include:0 CDK SU Interceptor configuration 5.8.0}
h3. Dedicated configuration
{anchor:service-unit-attributes-consume}
{table-plus}
|| Attribute || Description || Default value || Required || Support of placeholders ||
| {{http-method}} | HTTP method to use. Possible values are: GET, PATCH, POST, PUT and DELETE. | {center}-{center} | {center}Yes{center} | {center}Not applicable{center} |
| {{path-template}} | URI template of the resource exposed. Java regular expressions are supported into parameter part of URI template as following:
* /blah/\{ver:v\[12\]}/ep,
* /\{id : (\d+)}. | {center}-{center} | {center}Yes{center} | {center}Yes{center} |
| {{incoming-payload}} | If set, a transformation will be applied on XML extracted from HTTP body (eventually resulting from JSON conversion). Only XSL transformation is supported through the sub-element '{{xsl}}'.
{tip}
each URI parameter is available as XSL parameter (without namespace).
{tip} | {center}-{center} | {center}No{center} | {center}No{center} |
| {{http-body-from-json-multiple-pi}} | This parameter drives the conversion of JSON to XML. See https://github.com/beckchr/staxon/wiki/Factory-Configuration | {center}false{center} | {center}No{center} | {center}Not applicable{center} |
| {{http-body-from-json-virtual-root}} | This parameter drives the conversion of JSON to XML. See https://github.com/beckchr/staxon/wiki/Factory-Configuration | {center}-{center} | {center}No{center} | {center}Not applicable{center} |
| {{on-jbi-response}} | Defines the REST response that will be generated according to the JBI service response:
* the sub-elements '{{on-out}}', '{{on-fault}}' or '{{on-error}} define conditional transformations to apply on the service provider response, fault or error. The first condition evaluated to '{{true}}' determine the transformation that will be applied. The result of the transformation will be used as HTTP response. Several conditional transformations can be defined:
** the attribute '{{order-id}}' permits to order condition evaluations,
** the sub-element '{{condition}}' defines the condition to evaluate. Now, only XPath conditions are supported through the sub-element '{{xpath}}'. XPath condition supports placeholders,
** the sub-element '{{transformation}}' defines a preliminar transformation to apply on the XML payload of the response service if the condition matches, before to eventually be converted into JSON through the declaration '{{http-response}}'. Now, only XSL transformations are supported through the sub-element 'xsl'. Placeholders are supported neither to define XSL stylesheet nor into the XSL stylesheet,
{tip}
If the service response has no XML payload, the XML payload of the service request is used to be transformed instead of the service response XML payload.
{tip}
** the sub-element '{{http-response}}' defines the transformation to apply if the condition matches to generate the HTTP REST response:
*** the attribute '{{http-code}}' defines the HTTP code returned. Placeholder not supported,
*** headers can be added through sub-elements '{{header}}''. The header name is provided through attribute '{{name}}'. Header name does not support placeholder, but they are supported at header value level,
*** the sub-element {{http-body-to-json-multiple-pi}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. Default value: {{false}}, placeholder not supported,
*** the sub-element {{http-body-to-json-virtual-root}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. No default virtual root, placeholder not supported,
*** the sub-element {{http-body-to-json-auto-array}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. Default value: {{false}}, placeholder not supported,
*** the sub-element {{http-body-to-json-auto-primitive}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. Default value: {{false}}, placeholder not supported,
*** the sub-element {{http-body-to-json-pretty-print}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. Default value: {{false}}, placeholder not supported,
*** the sub-element {{http-body-to-json-ns-declarations}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. Default value: {{false}}, placeholder not supported.
{tip}
The content type of the HTTP response is defined according to the header '{{Accept}}' of the incoming HTTP REST request. The content-type used for the HTTP response is the first one contained in the header value and compliant with XML or JSON.
{tip}
* the sub-elements '{{on-default-out}}' defines the default HTTP response to generate on a nominal response of service provider when no condition matches it,
* the sub-elements '{{on-default-fault}}' defines the default HTTP response to generate on a fault returned by the service provider when no condition matches it,
* the sub-elements '{{on-default-error}}' defines the default HTTP response to generate on an error returned by the service provider when no condition matches it. | {center}-{center} | {center}Yes{center}| {center}Check sub-element{center} |
h3. Service unit content
The service unit has to contain the following elements, packaged in the archive:
* the META-INF/jbi.xml descriptor file as described above,
* XSL files referenced in the JBI descriptor.
{code}
service-unit.zip
+ META-INF
- jbi.xml (as defined above)
- stylesheet-1.xsl
- stylesheet-2.xsl
{code}
h3. Example
{code:xml}
<jbi:jbi version="1.0" ..>
<jbi:jbi version="1.0" ..>
{code}
The Service Unit has to contain the following elements, packaged in the archive:
* the META-INF/jbi.xml descriptor file as described above,
* XSL files referenced in the JBI descriptor.
* the META-INF/jbi.xml descriptor file as described above,
* XSL files referenced in the JBI descriptor.
{include:0 CDK SU Consume Configuration 5.7.0}
{anchor:service-unit-attributes-consume}
{center}{*}Service Unit attributes to consume services{*}{center}
{table-plus}
|| Attribute || Description || Default value || Required || Support of placeholders ||
| {{http-method}} | HTTP method to use. Possible values are: GET, PATCH, POST, PUT and DELETE. | {center}-{center} | {center}Yes{center} | {center}Not applicable{center} |
| {{path-template}} | URI template of the resource exposed. Java regular expressions are supported into parameter part of URI template as following:
* /blah/\{ver:v\[12\]}/ep,
* /\{id : (\d+)}. | {center}-{center} | {center}Yes{center} | {center}Yes{center} |
| {{incoming-payload}} | If set, a transformation will be applied on XML extracted from HTTP body (eventually resulting from JSON conversion). Only XSL transformation is supported through the sub-element '{{xsl}}'.
{tip}
each URI parameter is available as XSL parameter (without namespace).
{tip} | {center}-{center} | {center}No{center} | {center}No{center} |
| {{http-body-from-json-multiple-pi}} | This parameter drives the conversion of JSON to XML. See https://github.com/beckchr/staxon/wiki/Factory-Configuration | {center}false{center} | {center}No{center} | {center}Not applicable{center} |
| {{http-body-from-json-virtual-root}} | This parameter drives the conversion of JSON to XML. See https://github.com/beckchr/staxon/wiki/Factory-Configuration | {center}-{center} | {center}No{center} | {center}Not applicable{center} |
| {{on-jbi-response}} | Defines the REST response that will be generated according to the JBI service response:
* the sub-elements '{{on-out}}', '{{on-fault}}' or '{{on-error}} define conditional transformations to apply on the service provider response, fault or error. The first condition evaluated to '{{true}}' determine the transformation that will be applied. The result of the transformation will be used as HTTP response. Several conditional transformations can be defined:
** the attribute '{{order-id}}' permits to order condition evaluations,
** the sub-element '{{condition}}' defines the condition to evaluate. Now, only XPath conditions are supported through the sub-element '{{xpath}}'. XPath condition supports placeholders,
** the sub-element '{{transformation}}' defines a preliminar transformation to apply on the XML payload of the response service if the condition matches, before to eventually be converted into JSON through the declaration '{{http-response}}'. Now, only XSL transformations are supported through the sub-element 'xsl'. Placeholders are supported neither to define XSL stylesheet nor into the XSL stylesheet,
{tip}
If the service response has no XML payload, the XML payload of the service request is used to be transformed instead of the service response XML payload.
{tip}
** the sub-element '{{http-response}}' defines the transformation to apply if the condition matches to generate the HTTP REST response:
*** the attribute '{{http-code}}' defines the HTTP code returned. Placeholder not supported,
*** headers can be added through sub-elements '{{header}}''. The header name is provided through attribute '{{name}}'. Header name does not support placeholder, but they are supported at header value level,
*** the sub-element {{http-body-to-json-multiple-pi}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. Default value: {{false}}, placeholder not supported,
*** the sub-element {{http-body-to-json-virtual-root}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. No default virtual root, placeholder not supported,
*** the sub-element {{http-body-to-json-auto-array}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. Default value: {{false}}, placeholder not supported,
*** the sub-element {{http-body-to-json-auto-primitive}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. Default value: {{false}}, placeholder not supported,
*** the sub-element {{http-body-to-json-pretty-print}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. Default value: {{false}}, placeholder not supported,
*** the sub-element {{http-body-to-json-ns-declarations}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. Default value: {{false}}, placeholder not supported.
{tip}
The content type of the HTTP response is defined according to the header '{{Accept}}' of the incoming HTTP REST request. The content-type used for the HTTP response is the first one contained in the header value and compliant with XML or JSON.
{tip}
* the sub-elements '{{on-default-out}}' defines the default HTTP response to generate on a nominal response of service provider when no condition matches it,
* the sub-elements '{{on-default-fault}}' defines the default HTTP response to generate on a fault returned by the service provider when no condition matches it,
* the sub-elements '{{on-default-error}}' defines the default HTTP response to generate on an error returned by the service provider when no condition matches it. | {center}-{center} | {center}Yes{center}| {center}Check sub-element{center} |
{center}{*}Service Unit attributes to consume services{*}{center}
{table-plus}
|| Attribute || Description || Default value || Required || Support of placeholders ||
| {{http-method}} | HTTP method to use. Possible values are: GET, PATCH, POST, PUT and DELETE. | {center}-{center} | {center}Yes{center} | {center}Not applicable{center} |
| {{path-template}} | URI template of the resource exposed. Java regular expressions are supported into parameter part of URI template as following:
* /blah/\{ver:v\[12\]}/ep,
* /\{id : (\d+)}. | {center}-{center} | {center}Yes{center} | {center}Yes{center} |
| {{incoming-payload}} | If set, a transformation will be applied on XML extracted from HTTP body (eventually resulting from JSON conversion). Only XSL transformation is supported through the sub-element '{{xsl}}'.
{tip}
each URI parameter is available as XSL parameter (without namespace).
{tip} | {center}-{center} | {center}No{center} | {center}No{center} |
| {{http-body-from-json-multiple-pi}} | This parameter drives the conversion of JSON to XML. See https://github.com/beckchr/staxon/wiki/Factory-Configuration | {center}false{center} | {center}No{center} | {center}Not applicable{center} |
| {{http-body-from-json-virtual-root}} | This parameter drives the conversion of JSON to XML. See https://github.com/beckchr/staxon/wiki/Factory-Configuration | {center}-{center} | {center}No{center} | {center}Not applicable{center} |
| {{on-jbi-response}} | Defines the REST response that will be generated according to the JBI service response:
* the sub-elements '{{on-out}}', '{{on-fault}}' or '{{on-error}} define conditional transformations to apply on the service provider response, fault or error. The first condition evaluated to '{{true}}' determine the transformation that will be applied. The result of the transformation will be used as HTTP response. Several conditional transformations can be defined:
** the attribute '{{order-id}}' permits to order condition evaluations,
** the sub-element '{{condition}}' defines the condition to evaluate. Now, only XPath conditions are supported through the sub-element '{{xpath}}'. XPath condition supports placeholders,
** the sub-element '{{transformation}}' defines a preliminar transformation to apply on the XML payload of the response service if the condition matches, before to eventually be converted into JSON through the declaration '{{http-response}}'. Now, only XSL transformations are supported through the sub-element 'xsl'. Placeholders are supported neither to define XSL stylesheet nor into the XSL stylesheet,
{tip}
If the service response has no XML payload, the XML payload of the service request is used to be transformed instead of the service response XML payload.
{tip}
** the sub-element '{{http-response}}' defines the transformation to apply if the condition matches to generate the HTTP REST response:
*** the attribute '{{http-code}}' defines the HTTP code returned. Placeholder not supported,
*** headers can be added through sub-elements '{{header}}''. The header name is provided through attribute '{{name}}'. Header name does not support placeholder, but they are supported at header value level,
*** the sub-element {{http-body-to-json-multiple-pi}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. Default value: {{false}}, placeholder not supported,
*** the sub-element {{http-body-to-json-virtual-root}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. No default virtual root, placeholder not supported,
*** the sub-element {{http-body-to-json-auto-array}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. Default value: {{false}}, placeholder not supported,
*** the sub-element {{http-body-to-json-auto-primitive}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. Default value: {{false}}, placeholder not supported,
*** the sub-element {{http-body-to-json-pretty-print}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. Default value: {{false}}, placeholder not supported,
*** the sub-element {{http-body-to-json-ns-declarations}} drives the conversion of XML to JSON. See https://github.com/beckchr/staxon/wiki/Factory-Configuration. Default value: {{false}}, placeholder not supported.
{tip}
The content type of the HTTP response is defined according to the header '{{Accept}}' of the incoming HTTP REST request. The content-type used for the HTTP response is the first one contained in the header value and compliant with XML or JSON.
{tip}
* the sub-elements '{{on-default-out}}' defines the default HTTP response to generate on a nominal response of service provider when no condition matches it,
* the sub-elements '{{on-default-fault}}' defines the default HTTP response to generate on a fault returned by the service provider when no condition matches it,
* the sub-elements '{{on-default-error}}' defines the default HTTP response to generate on an error returned by the service provider when no condition matches it. | {center}-{center} | {center}Yes{center}| {center}Check sub-element{center} |
h3. Service Unit descriptor
The service unit is configurable via its extensions in the jbi.xml file:
{code:lang=xml}
<jbi:jbi version="1.0"
xmlns:jbi="http://java.sun.com/xml/ns/jbi"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cdk="http://petals.ow2.org/components/extensions/version-5"
xmlns:rest="http://petals.ow2.org/components/rest/version-1"
xmlns:inscription-cantine="http://municipalite.fr/demarches-administratives/inscription-cantine/1.0">
<jbi:services binding-component="true">
<jbi:consumes interface-name="inscription-cantine:inscriptionCantine">
<cdk:timeout />
<cdk:mep xsi:nil="true" />
<rest:service-base-path>/api</rest:service-base-path>
<rest:mapping>
<rest:operation name="inscription-cantine:new">
<!-- REST request part -->
<rest:http-method>POST</rest:http-method>
<rest:path-template>/demarches-administratives/cantine</rest:path-template>
<rest:http-body-from-json-virtual-root>new</rest:http-body-from-json-virtual-root>
<rest:incoming-payload>
<rest:transformation>
<rest:xsl>new-request.xsl</rest:xsl>
</rest:transformation>
</rest:incoming-payload>
<rest:xml-template>
<!-- TODO: Should be removed. Not needed here -->
<dummy />
</rest:xml-template>
<!-- REST request part -->
<rest:http-body-to-json-virtual-root>newResponse</rest:http-body-to-json-virtual-root>
</rest:operation>
<rest:operation name="inscription-cantine:validate">
<!-- REST request part -->
<rest:http-method>PUT</rest:http-method>
<rest:path-template>/demarches-administratives/cantine/{numero-demande}</rest:path-template>
<rest:http-body-from-json-virtual-root>validate</rest:http-body-from-json-virtual-root>
<rest:xml-template>
<!-- TODO: Should be removed. Not needed here -->
<dummy />
</rest:xml-template>
<!-- REST request part -->
<rest:http-body-to-json-virtual-root>validateResponse</rest:http-body-to-json-virtual-root>
</rest:operation>
</rest:mapping>
</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
* XSLs required by transformations
{code:lang=xml}
<jbi:jbi version="1.0"
xmlns:jbi="http://java.sun.com/xml/ns/jbi"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cdk="http://petals.ow2.org/components/extensions/version-5"
xmlns:rest="http://petals.ow2.org/components/rest/version-1"
xmlns:inscription-cantine="http://municipalite.fr/demarches-administratives/inscription-cantine/1.0">
<jbi:services binding-component="true">
<jbi:consumes interface-name="inscription-cantine:inscriptionCantine">
<cdk:timeout />
<cdk:mep xsi:nil="true" />
<rest:service-base-path>/api</rest:service-base-path>
<rest:mapping>
<rest:operation name="inscription-cantine:new">
<!-- REST request part -->
<rest:http-method>POST</rest:http-method>
<rest:path-template>/demarches-administratives/cantine</rest:path-template>
<rest:http-body-from-json-virtual-root>new</rest:http-body-from-json-virtual-root>
<rest:incoming-payload>
<rest:transformation>
<rest:xsl>new-request.xsl</rest:xsl>
</rest:transformation>
</rest:incoming-payload>
<rest:xml-template>
<!-- TODO: Should be removed. Not needed here -->
<dummy />
</rest:xml-template>
<!-- REST request part -->
<rest:http-body-to-json-virtual-root>newResponse</rest:http-body-to-json-virtual-root>
</rest:operation>
<rest:operation name="inscription-cantine:validate">
<!-- REST request part -->
<rest:http-method>PUT</rest:http-method>
<rest:path-template>/demarches-administratives/cantine/{numero-demande}</rest:path-template>
<rest:http-body-from-json-virtual-root>validate</rest:http-body-from-json-virtual-root>
<rest:xml-template>
<!-- TODO: Should be removed. Not needed here -->
<dummy />
</rest:xml-template>
<!-- REST request part -->
<rest:http-body-to-json-virtual-root>validateResponse</rest:http-body-to-json-virtual-root>
</rest:operation>
</rest:mapping>
</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
* XSLs required by transformations
h1. Configuring the component