Difference between revisions of "GVExample CCardQuery"

From GreenVulcano Wiki
Jump to: navigation, search
(Created page with "==Description== This service has the scope of showing how {{GVESB}} uses DataHandler for quering a DB and implements a Web Services. CCardQuery Service executes the fol...")
 
(Defining Systems, Channels and Operations)
Line 19: Line 19:
  
 
To define a System, go to {{VULCON}} core view and insert the System CREDIT with the Channel CHANNEL_CREDIT_WS, with the following operations:
 
To define a System, go to {{VULCON}} core view and insert the System CREDIT with the Channel CHANNEL_CREDIT_WS, with the following operations:
* dh-call:
+
* [[dh-call]]:
 
{|class="gvtable"
 
{|class="gvtable"
 
! Attribute !! Value  
 
! Attribute !! Value  
Line 54: Line 54:
  
 
Now insert the [[Service]] CREDIT_EXTERNAL with the [[Channel]] CHANNEL_CREDIT_EXT with the following operations:
 
Now insert the [[Service]] CREDIT_EXTERNAL with the [[Channel]] CHANNEL_CREDIT_EXT with the following operations:
* ws-call:
+
* [[ws-call]]:
 
{|class="gvtable"
 
{|class="gvtable"
 
! Attribute !! Value  
 
! Attribute !! Value  
Line 60: Line 60:
 
| Name || QueryExternal
 
| Name || QueryExternal
 
|-
 
|-
| [[AxisWebServiceInvoker]] || operation="Query" <br/> ref-dp="EXTERNAL::QueryWSDataProvider"<br/> returnType="body-element"<br/> type="invoker" <br/> WSDLInfo:
+
| [[Ws-call#AxisWebServiceInvoker|AxisWebServiceInvoker]] || operation="Query" <br/> ref-dp="EXTERNAL::QueryWSDataProvider"<br/> returnType="body-element"<br/> type="invoker" <br/> WSDLInfo:
 
: type="wsdlinfo"
 
: type="wsdlinfo"
 
: wsdl="file://<nowiki>${{gv.app.home}}/xmlconfig/wsdl/ExternalCreditService.wsdl"</nowiki>
 
: wsdl="file://<nowiki>${{gv.app.home}}/xmlconfig/wsdl/ExternalCreditService.wsdl"</nowiki>

Revision as of 17:43, 11 February 2012

Description

This service has the scope of showing how GreenVulcano® ESB uses DataHandler for quering a DB and implements a Web Services.

CCardQuery Service executes the following operations:

  1. Receives a request Web Service from client, with a credit card number to be controlled.
  2. If this card is locally managed, reads the data using DataHandler.
  3. If this card is managed by an external system, forwards a Web Service request to that system.
  4. Returns the response to the client

VulCon Configuration

To configure CCardQuery service follow these steps:

  1. Define Systems, Channels and Operations
  2. Define the Services
  3. Implement the flows.

Defining Systems, Channels and Operations

To define a System, go to VulCon core view and insert the System CREDIT with the Channel CHANNEL_CREDIT_WS, with the following operations:

Attribute Value
name DataHandler
DBOBuilder name="CREDIT::CCardQuery"
jdbc-connection-name="ds.test_gv"

DHVariables:

name="decimal-separator" value="."
name="grouping-separator" value=","
name="format" value="#0.00"
DBOBuilder/ DBOSelect name="CCardQuery"
transformation="CCardQuery"
type="dbo"
statement id="1"

type="select"

select p.NAME, cc.CNUMBER, cc.CREDIT, cc.ENABLED
from PERSON p, CREDIT_CARD cc
where p.ID = cc.ID_OWNER
and cc.CNUMBER = @{{CNUMBER}}

The operation defined in the DataHandler makes use of the data-trasformation module for the data transformations that allow to have data in XML format. So, you need to define the following parameters into the GVDataTrasformation section:

Attribute Value
DataSourceSet/LocalFSDataSource formatHandled="xsl" name="XSLDataSource"
repositoryHome="${{gv.app.home}}/gvdte/datasource/xsl"
type="datasource"
XSLTransformation name="CCardQuery" DataSourceSet="Default"
XSLMapName="

DataHandler/CREDIT/CCardQuery.xsl"
type="transformation"

XSLTransformation name="QueryExternalInput" DataSourceSet="Default"
XSLMapName=" CREDIT_EXTERNAL/QueryExternalInput.xsl"
type="transformation"
XSLTransformation name="QueryExternalOutput" DataSourceSet="Default"
XSLMapName=" CREDIT_EXTERNAL/QueryExternalOutput.xsl"
type="transformation"


Now insert the Service CREDIT_EXTERNAL with the Channel CHANNEL_CREDIT_EXT with the following operations:

Attribute Value
Name QueryExternal
AxisWebServiceInvoker operation="Query"
ref-dp="EXTERNAL::QueryWSDataProvider"
returnType="body-element"
type="invoker"
WSDLInfo:
type="wsdlinfo"
wsdl="file://${{gv.app.home}}/xmlconfig/wsdl/ExternalCreditService.wsdl"

Definition of Services

To define the CCardQuery Service, use the voice "Wizard new Service" (Right clicking the element Services) and set the following parameters:

Attribute Value
Service name CCardQuery
Group CREDIT_GRP
Scenario Synchronous- Synchronous
Server (Participant) system="CREDIT"
channel="CHANNEL_CREDIT_WS"
request operation= "DataHandler"

A new Flow has been created and must be modified in its main steps. But first it is also needed to add a Participant with the attributes:

  • system="CREDIT_EXTERNAL"
  • channel="CHANNEL_CREDIT_EXT"