Difference between revisions of "GVAdapterHttpConfiguration"
Line 1: | Line 1: | ||
==Description== | ==Description== | ||
− | The HTTP inbound adapter works defining a mapping between | + | The HTTP inbound adapter works identifying an Action and then defining a mapping between the Action and a Formatter. |
+ | |||
+ | The Action is defined by the value of the request parameter '''GV_ACTION''' '''(REMOVED in v3.4)'''. | ||
+ | |||
The formatter defines how to parse the request parameters and how to build the response in case of successful or failed ESB's invocation. | The formatter defines how to parse the request parameters and how to build the response in case of successful or failed ESB's invocation. | ||
+ | |||
The client can send HTTP requests at two url: | The client can send HTTP requests at two url: | ||
− | * <pre>http://<host>:<port>/gvhttp/inbound</pre> | + | * <pre>http://<host>:<port>/gvhttp/inbound/<action></pre> |
− | * <pre>http://<host>:<port>/gvhttp/secure/inbound (requires authentication)</pre> | + | * <pre>http://<host>:<port>/gvhttp/secure/inbound/<action> (requires authentication)</pre> |
Line 29: | Line 33: | ||
===ActionMappings=== | ===ActionMappings=== | ||
− | This element can contain more sub-elements ''' | + | This element can contain more sub-elements: |
+ | * [[#ActionMapping|ActionMapping]] '''(REMOVED in v3.4)''' | ||
+ | <div class="version_ge3.4"> | ||
+ | * [[#GVCoreActionMapping|GVCoreActionMapping]] | ||
+ | * [[#ForwardActionMapping|ForwardActionMapping]] | ||
+ | </div> | ||
+ | |||
+ | ====ActionMapping==== | ||
+ | |||
An '''ActionMapping''' defines a mapping between a request Action and a configured Formatter. | An '''ActionMapping''' defines a mapping between a request Action and a configured Formatter. | ||
Line 57: | Line 69: | ||
* [[#RetCodeConversionIn|RetCodeConversionIn]] | * [[#RetCodeConversionIn|RetCodeConversionIn]] | ||
* [[#RetCodeConversionOut|RetCodeConversionOut]] | * [[#RetCodeConversionOut|RetCodeConversionOut]] | ||
+ | |||
+ | |||
+ | ====GVCoreActionMapping==== | ||
+ | |||
+ | An '''GVCoreActionMapping''' defines a mapping between a request Action and a configured Formatter in order to invoke a {{GVESB}} service. | ||
+ | |||
+ | The following table shows the '''GVCoreActionMapping''' attributes: | ||
+ | {|class="gvtable" | ||
+ | ! Attribute !! Type !! Description | ||
+ | |- | ||
+ | | type || fixed || This attribute must assume the value '''action-mapping'''. | ||
+ | |- | ||
+ | | class || fixed || This attribute must assume the value '''it.greenvulcano.gvesb.adapter.http.mapping.GVCoreHttpServletMapping''' | ||
+ | |- | ||
+ | | Action || required || Defines the action name, must match or be a prefix in <action> part of request URL. The attribute's value cannot be null. | ||
+ | |- | ||
+ | | FormatterID || required || References a [[#Formatters|Formatter]] to be used to marshall/unmarshall the data. The attribute's value cannot be null. | ||
+ | |- | ||
+ | | RespContentType || optional || ContentType to be declared while handling HTTP responses to the external system. Default to text/html and is used only if not defined by the formatter. | ||
+ | The possible values are: | ||
+ | * text/html | ||
+ | * text/xml | ||
+ | * text/json | ||
+ | * text/javascript | ||
+ | * application/xml | ||
+ | * application/json | ||
+ | * application/x-www-form-urlencoded | ||
+ | |- | ||
+ | | enabled || required || This parameter defines if an action must be processed. | ||
+ | |- | ||
+ | | dump-in-out || optional || If true enable the dump of the input/output HTTP data. Default false. | ||
+ | |} | ||
+ | |||
+ | Each '''GVCoreActionMapping''' can contain the following sub-elements: | ||
+ | * [[Description]] | ||
+ | * [[#RetCodeConversionIn|RetCodeConversionIn]] | ||
+ | * [[#RetCodeConversionOut|RetCodeConversionOut]] | ||
+ | |||
+ | |||
+ | ====ForwardActionMapping==== | ||
+ | |||
+ | An '''ForwardActionMapping''' defines a mapping to a request Action in order to forward the request to a remote HTTP server. | ||
+ | |||
+ | The following table shows the '''ForwardActionMapping''' attributes: | ||
+ | {|class="gvtable" | ||
+ | ! Attribute !! Type !! Description | ||
+ | |- | ||
+ | | type || fixed || This attribute must assume the value '''action-mapping'''. | ||
+ | |- | ||
+ | | class || fixed || This attribute must assume the value '''it.greenvulcano.gvesb.adapter.http.mapping.ForwardHttpServletMapping''' | ||
+ | |- | ||
+ | | Action || required || Defines the action name, must match or be a prefix in <action> part of request URL. The attribute's value cannot be null. | ||
+ | |- | ||
+ | | enabled || required || This parameter defines if an action must be processed. | ||
+ | |- | ||
+ | | dump-in-out || optional || If true enable the dump of the input/output HTTP data. Default false. | ||
+ | |} | ||
+ | |||
+ | Each '''ForwardActionMapping''' can contain the following sub-elements: | ||
+ | * [[Description]] | ||
+ | * [[Http-call#endpoint|endpoint]] | ||
+ | |||
====RetCodeConversionIn==== | ====RetCodeConversionIn==== | ||
Line 101: | Line 175: | ||
| service || required || The service name. The attribute's value can't be null. | | service || required || The service name. The attribute's value can't be null. | ||
|- | |- | ||
− | | system || | + | | system || optional || Default is ALL. |
|- | |- | ||
| transacted || required || This parameter defines if a service must be executed in transaction. | | transacted || required || This parameter defines if a service must be executed in transaction. |
Revision as of 14:09, 14 May 2014
Contents
Description
The HTTP inbound adapter works identifying an Action and then defining a mapping between the Action and a Formatter.
The Action is defined by the value of the request parameter GV_ACTION (REMOVED in v3.4).
The formatter defines how to parse the request parameters and how to build the response in case of successful or failed ESB's invocation.
The client can send HTTP requests at two url:
http://<host>:<port>/gvhttp/inbound/<action>
http://<host>:<port>/gvhttp/secure/inbound/<action> (requires authentication)
GreenVulcano® ESB Configuration
The GVAdapterHttpConfiguration Element is used by: GVAdapters.
The following table shows the GVAdapterHttpConfiguration attributes:
Attribute | Type | Description |
---|---|---|
type | fixed | This attribute must assume the value module. |
name | fixed | Module Id always set to HTTP_ADAPTER. |
Contains the sub-elements InboundConfiguration Formatters.
InboundConfiguration
Contains the sub-elements:
ActionMappings
This element can contain more sub-elements:
- ActionMapping (REMOVED in v3.4)
ActionMapping
An ActionMapping defines a mapping between a request Action and a configured Formatter.
The following table shows the ActionMapping attributes:
Attribute | Type | Description |
---|---|---|
Action | required | Defines the action name, referenced by the request parameter GV_ACTION. The attribute's value cannot be null. |
FormatterID | required | References a Formatter to be used to marshall/unmarshall the data. The attribute's value cannot be null. |
RespContentType | optional | ContentType to be declared while handling HTTP responses to the external system. Default to text/html and is used only if not defined by the formatter.
The possible values are:
|
enabled | required | This parameter defines if an action must be processed. |
Each ActionMapping can contain the following sub-elements:
GVCoreActionMapping
An GVCoreActionMapping defines a mapping between a request Action and a configured Formatter in order to invoke a GreenVulcano® ESB service.
The following table shows the GVCoreActionMapping attributes:
Attribute | Type | Description |
---|---|---|
type | fixed | This attribute must assume the value action-mapping. |
class | fixed | This attribute must assume the value it.greenvulcano.gvesb.adapter.http.mapping.GVCoreHttpServletMapping |
Action | required | Defines the action name, must match or be a prefix in <action> part of request URL. The attribute's value cannot be null. |
FormatterID | required | References a Formatter to be used to marshall/unmarshall the data. The attribute's value cannot be null. |
RespContentType | optional | ContentType to be declared while handling HTTP responses to the external system. Default to text/html and is used only if not defined by the formatter.
The possible values are:
|
enabled | required | This parameter defines if an action must be processed. |
dump-in-out | optional | If true enable the dump of the input/output HTTP data. Default false. |
Each GVCoreActionMapping can contain the following sub-elements:
ForwardActionMapping
An ForwardActionMapping defines a mapping to a request Action in order to forward the request to a remote HTTP server.
The following table shows the ForwardActionMapping attributes:
Attribute | Type | Description |
---|---|---|
type | fixed | This attribute must assume the value action-mapping. |
class | fixed | This attribute must assume the value it.greenvulcano.gvesb.adapter.http.mapping.ForwardHttpServletMapping |
Action | required | Defines the action name, must match or be a prefix in <action> part of request URL. The attribute's value cannot be null. |
enabled | required | This parameter defines if an action must be processed. |
dump-in-out | optional | If true enable the dump of the input/output HTTP data. Default false. |
Each ForwardActionMapping can contain the following sub-elements:
RetCodeConversionIn
The following table shows the RetCodeConversionIn element's attributes:
Attribute | Type | Description |
---|---|---|
RetCodeConversion | optional | The attribute's admitted values are:
|
RetCodeConversionOut
The following table shows the RetCodeConversionOut element's attributes:
Attribute | Type | Description |
---|---|---|
RetCodeConversion | optional | The attribute's admitted values are:
|
InboundTransactions
This element contains the transaction definitions for the managed services.
Can contain the sub-element Transaction.
Transaction
This element contains the transaction definitions for a given service.
All service managed by the GVAdapterHttpConfiguration should have a Transaction element that defines the transaction requirements.
The following table shows the Transactionattributes:
Attribute | Type | Description |
---|---|---|
service | required | The service name. The attribute's value can't be null. |
system | optional | Default is ALL. |
transacted | required | This parameter defines if a service must be executed in transaction.
The attribute's admitted values are:
|
timeout | optional | This parameter defines the transaction timeout in seconds. Default is 30s. |
close-on-response | optional | This parameter defines when transaction must be committed: before or after sending the response to the client. The default is before.
The attribute's admitted values are:
|
Can contain the sub-element Description.
Formatters
The Formatters are responsible for decoding the client request's parameters in order to create the input for a GreenVulcano® ESB service and to convert the service's output into a HTTP response.
Can contain the sub-elements: