Difference between revisions of "GVAdapterHttpConfiguration"

From GreenVulcano Wiki
Jump to: navigation, search
Line 1: Line 1:
 
==Description==
 
==Description==
 +
The HTTP inbound adapter works defining a mapping between an Action and a Formatter. The Action is defined by the value of the request parameter '''GV_ACTION'''.
 +
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:
 +
* <pre>http://<host>:<port>/gvhttp/inbound</pre>
 +
* <pre>http://<host>:<port>/gvhttp/secure/inbound    (requires authentication)</pre>
 +
  
 
=={{GVESB}} Configuration==
 
=={{GVESB}} Configuration==
The GVHTTPAdapter Element is used by: GVAdapters.
+
The GVAdapterHttpConfiguration Element is used by: GVAdapters.
  
The following table shows the GVHTTPAdapter element's attributes:
+
The following table shows the '''GVAdapterHttpConfiguration''' attributes:
 
{|class="gvtable"
 
{|class="gvtable"
 
! Attribute !! Type !! Description
 
! Attribute !! Type !! Description
Line 10: Line 16:
 
| type || fixed || This attribute must assume the value '''module'''.
 
| type || fixed || This attribute must assume the value '''module'''.
 
|-
 
|-
| name || fixed || Module Id always set to '''HTTP_INBOUND'''.
+
| name || fixed || Module Id always set to '''HTTP_ADAPTER'''.
 
|}
 
|}
  
Contains the sub-element [[#Configuration|Configuration]].
+
Contains the sub-elements [[#InboundConfiguration|InboundConfiguration]] [[#Formatters|Formatters]].
  
==Configuration==
+
==InboundConfiguration==
  
Might contain the sub-elements:
+
Contains the sub-elements:
* [[#ServletMappings|ServletMappings]]
+
* [[#ActionMappings|ActionMappings]]
* [[#GVConnection|GVConnection]]
+
* [[#InboundTransactions|InboundTransactions]]
* [[#HTTPTransactions|HTTPTransactions]]
 
  
===ServletMappings===
+
===ActionMappings===
  
This element might contain more sub-elements ServletMapping.
+
This element can contain more sub-elements '''ActionMapping'''.
 +
An '''ActionMapping''' defines a mapping between a request Action and a configured Formatter.
  
The following table shows the ServletMapping element's attributes:
+
The following table shows the '''ActionMapping''' attributes:
 
{|class="gvtable"
 
{|class="gvtable"
 
! Attribute !! Type !! Description
 
! Attribute !! Type !! Description
 
|-
 
|-
| Mapping || required ||The attribute's value cannot be null.
+
| Action || required || Defines the action name, referenced by the request parameter '''GV_ACTION'''. 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.
 
|}
 
|}
  
Each ServletMapping might contain the following sub-elements:
+
Each '''ActionMapping''' can contain the following sub-elements:
 
* [[Description]]
 
* [[Description]]
 
* [[#RetCodeConversionIn|RetCodeConversionIn]]
 
* [[#RetCodeConversionIn|RetCodeConversionIn]]
Line 62: Line 82:
 
|}
 
|}
  
===GVConnection===
 
 
This element contains configuration informations about connection to {{GVESB}} via [[GVConnector]] client class.
 
 
The following table shows the GVConnection element's attributes:
 
{|class="gvtable"
 
! Attribute !! Type !! Description
 
|-
 
| ConfigFilename || required || GVC configuration filename.
 
|}
 
  
===HTTPTransactions===
+
===InboundTransactions===
  
 
This element contains the transaction definitions for the managed services.
 
This element contains the transaction definitions for the managed services.
  
Might contain the sub-element [[#Transaction|Transaction]].
+
Can contain the sub-element [[#Transaction|Transaction]].
  
 
====Transaction====
 
====Transaction====
Line 83: Line 93:
 
This element contains the transaction definitions for a given service.
 
This element contains the transaction definitions for a given service.
  
All service managed by the HTTPAdapter must have a Transaction element that defines the transaction requirements.
+
All service managed by the '''GVAdapterHttpConfiguration''' should have a '''Transaction''' element that defines the transaction requirements.
  
The following table shows the Transaction element's attributes:
+
The following table shows the '''Transaction'''attributes:
 
{|class="gvtable"
 
{|class="gvtable"
 
! Attribute !! Type !! Description
 
! Attribute !! Type !! Description
 
|-
 
|-
| system || required || The attribute's value can't be null.
+
| service || required || The service name. The attribute's value can't be null.
 
|-
 
|-
| service || required || The attribute's value can't be null.
+
| system || optiona || 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.
 
The attribute's admitted values are:
 
The attribute's admitted values are:
* yes
+
* true
* no
+
* false
 
|-
 
|-
| timeout || optional || This parameter defines the transaction timeout in seconds.
+
| 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.
 
| 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.
Line 106: Line 116:
 
|}
 
|}
  
Might contain the sub-element Description.
+
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 {{GVESB}} service and to convert the service's output into a HTTP response.
 +
 
 +
Can contain the sub-elements:
 +
*[[ExtendedInboundParamHandlerFormatter]]

Revision as of 11:02, 26 July 2013

Description

The HTTP inbound adapter works defining a mapping between an Action and a Formatter. The Action is defined by the value of the request parameter GV_ACTION. 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
  • http://<host>:<port>/gvhttp/secure/inbound    (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. 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:

  • 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.

Each ActionMapping 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:
  • ignore
  • 0to1
  • 1to0

RetCodeConversionOut

The following table shows the RetCodeConversionOut element's attributes:

Attribute Type Description
RetCodeConversion optional The attribute's admitted values are:
  • ignore
  • 0to1
  • 1to0


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 optiona Default is ALL.
transacted required This parameter defines if a service must be executed in transaction.

The attribute's admitted values are:

  • true
  • false
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:

  • after
  • before

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: